From 13664282a2a9fb239f62c5777cb45cabcce29fae Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Sun, 11 Jul 2021 20:59:09 -0700 Subject: [PATCH] config: gate bridged networking behind macOS 11.3 Requires inherited sandbox fix to work. --- Configuration/UTMConfiguration+Defaults.m | 6 +++++- Platform/Shared/VMConfigNetworkView.swift | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Configuration/UTMConfiguration+Defaults.m b/Configuration/UTMConfiguration+Defaults.m index 40ad1922..b7c5b80b 100644 --- a/Configuration/UTMConfiguration+Defaults.m +++ b/Configuration/UTMConfiguration+Defaults.m @@ -48,7 +48,11 @@ self.consoleFontSize = @12; self.consoleTheme = @"Default"; #if TARGET_OS_OSX - self.networkMode = @"shared"; + if (@available(macOS 11.3, *)) { + self.networkMode = @"shared"; + } else { + self.networkMode = @"emulated"; + } #else self.networkMode = @"emulated"; #endif diff --git a/Platform/Shared/VMConfigNetworkView.swift b/Platform/Shared/VMConfigNetworkView.swift index 115790b0..1f561ab6 100644 --- a/Platform/Shared/VMConfigNetworkView.swift +++ b/Platform/Shared/VMConfigNetworkView.swift @@ -26,7 +26,13 @@ struct VMConfigNetworkView: View { Form { Section(header: Text("Hardware"), footer: EmptyView().padding(.bottom)) { #if os(macOS) - NetworkModeSection(config: config) + if #available(macOS 11.3, *) { // requires macOS 11.3 inherited sandbox fix + NetworkModeSection(config: config) + } else { + Toggle(isOn: $config.networkEnabled.animation(), label: { + Text("Enabled") + }) + } #else Toggle(isOn: $config.networkEnabled.animation(), label: { Text("Enabled")