Skip to content

Commit

Permalink
wizard: default to virtio-gpu-pci for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Apr 23, 2023
1 parent 139df6d commit b8a4398
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Platform/Shared/VMWizardState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,14 @@ enum VMWizardOS: String, Identifiable {
// only change UEFI settings for Windows
config.qemu.hasUefiBoot = systemBootUefi
}
if isGLEnabled || operatingSystem == .Windows, let displayCard = config.displays.first?.hardware {
if operatingSystem == .Linux && config.displays.first != nil {
// change default display to virtio-gpu if supported
let newCard = isGLEnabled ? "virtio-gpu-gl-pci" : "virtio-gpu-pci"
let allCards = systemArchitecture.displayDeviceType.allRawValues
if allCards.contains(where: { $0 == newCard }) {
config.displays[0].hardware = AnyQEMUConstant(rawValue: newCard)!
}
} else if isGLEnabled || operatingSystem == .Windows, let displayCard = config.displays.first?.hardware {
let newCard = displayCard.rawValue + "-gl"
let allCards = systemArchitecture.displayDeviceType.allRawValues
if allCards.contains(where: { $0 == newCard }) {
Expand Down

0 comments on commit b8a4398

Please sign in to comment.