Skip to content

Commit 1a75d0d

Browse files
committed
wizard: create a serial only config
1 parent 1c4fcc8 commit 1a75d0d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Platform/Shared/VMWizardHardwareView.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,16 @@ struct VMWizardHardwareView: View {
108108

109109

110110
if !wizardState.useAppleVirtualization && wizardState.operatingSystem == .Linux {
111-
DetailedSection("Hardware OpenGL Acceleration", description: "There are known issues in some newer Linux drivers including black screen, broken compositing, and apps failing to render.") {
111+
DetailedSection("Disply Output", description: "There are known issues in some newer Linux drivers including black screen, broken compositing, and apps failing to render.") {
112+
Toggle("Enable display output", isOn: $wizardState.isDisplayEnabled)
113+
.onChange(of: wizardState.isDisplayEnabled) { newValue in
114+
if !newValue {
115+
wizardState.isGLEnabled = false
116+
}
117+
}
112118
Toggle("Enable hardware OpenGL acceleration", isOn: $wizardState.isGLEnabled)
119+
.disabled(!wizardState.isDisplayEnabled)
113120
}
114-
115121
}
116122
}
117123
.textFieldStyle(.roundedBorder)

Platform/Shared/VMWizardState.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ struct AlertMessage: Identifiable {
142142
@Published var storageSizeGib: Int = 8
143143
#endif
144144
@Published var systemCpuCount: Int = 0
145+
@Published var isDisplayEnabled: Bool = true
145146
@Published var isGLEnabled: Bool = false
146147
@Published var sharingDirectoryURL: URL?
147148
@Published var sharingReadOnly: Bool = false
@@ -466,6 +467,11 @@ struct AlertMessage: Identifiable {
466467
config.displays[0].hardware = AnyQEMUConstant(rawValue: newCard)!
467468
}
468469
}
470+
if operatingSystem == .Linux && !isDisplayEnabled {
471+
config.displays = []
472+
let newSerial = UTMQemuConfigurationSerial(forArchitecture: systemArchitecture, target: systemTarget)!
473+
config.serials = [newSerial]
474+
}
469475
let mainDriveInterface: QEMUDriveInterface
470476
if systemArchitecture == .aarch64 && operatingSystem == .Windows {
471477
mainDriveInterface = .nvme

0 commit comments

Comments
 (0)