From fd9dcbc2d685e17900dfcb835f97fbacb3fbb08e Mon Sep 17 00:00:00 2001 From: Lierfang Support Team Date: Fri, 4 Jul 2025 15:31:28 +0800 Subject: [PATCH] Fix virtio-gpu issue on x86_64 https://github.com/jiangcuo/pxvirt/issues/186 --- PVE/QemuServer.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 07980c52..82dcc2f0 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1833,6 +1833,14 @@ sub print_vga_device { my ($conf, $vga, $arch, $machine_version, $machine, $id, $qxlnum, $bridges) = @_; my $type = $vga_map->{$vga->{type}}; + # x86_64 need using vga device for display! + if ($arch eq 'x86_64' && defined($type) ){ + if ($type eq 'virtio-gpu-pci') { + $type = 'virtio-vga'; + } elsif ($type eq 'virtio-gpu-gl-pci') { + $type = 'virtio-vga-gl'; + } + } my $vgamem_mb = $vga->{memory}; my $max_outputs = ''; @@ -1882,7 +1890,7 @@ sub print_vga_device { $pciaddr = print_pci_addr($vgaid, $bridges, $arch, $machine); } - if ($vga->{type} eq 'virtio-gpu-gl-pci') { + if ($vga->{type} eq 'virtio-gpu-gl-pci' || $vga->{type} eq 'virtio-vga-gl') { my $base = "/usr/lib/$arch-linux-gnu/lib"; die "missing libraries for '$vga->{type}' detected! Please install 'libgl1' and 'libegl1'\n" if !-e "${base}EGL.so.1" || !-e "${base}GL.so.1";