Virtualization on FW16's Ryzen 9 (7940HS)

One thing that might have an impact is I do not see OVMF nvram firmware in your configuration. I’m guessing that is the critically missing piece. Here’s my os block, you’ll need the ovmf package installed and to update the paths for your system.

  <os>
    <type arch="x86_64" machine="pc-q35-8.2">hvm</type>
    <loader readonly="yes" type="pflash">/run/libvirt/nix-ovmf/OVMF_CODE.fd</loader>
    <nvram template="/run/libvirt/nix-ovmf/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>

Thank you for your response!

Adapted your <os>-Block to my system.

Old:

  <os firmware="efi">
    <type arch="x86_64" machine="pc-q35-6.2">hvm</type>
    <boot dev="hd"/>
  </os>

New:

  <os>
    <type arch="x86_64" machine="pc-q35-6.2">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE.fd</loader>
    <nvram template="/usr/share/OVMF/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/Windows11_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>

virt-manager only accepts the new code, when i remove firmare="efi".

I cannot change machine to 8.2, i get an error:

'/usr/bin/qemu-system-x86_64' does not support machine type 'pc-q35-8.2'

With the new code I only get a black screen on the console and on the external display. Machine runs but appears to do nothing.

Log-Entries do not look any different. When I try to post them here I get an 403 Error form the forums page…

Ok, got bei “new” OS-Block working.

I had manually to delete the existing vars-File. After that I could boot with the new settings.

The problem however stays the same. I still get the error:

2024-05-09T08:53:45.602111Z qemu-system-x86_64: -device vfio-pci,host=0000:03:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio_listener_region_add received unaligned region

and Error 43 in device manager.

When I turn on the VM and have a display connected to the GPU via its USB-C-port, the display posts and then freezes while the VM continues to boot and work fine on the console.

I downloaded the rom-file with GPU-Z and tried:

<hostdev mode="subsystem" type="pci" managed="yes">
  <source>
    <address domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
  </source>
  <rom bar="on" file="/usr/share/vgabios/amdrom"/>
  <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0" multifunction="on"/>
</hostdev>

Settings applied, the display remains in Standby after starting the VM. Apart from that nothing changes.

Maybe the card detects that it is virtualized. The AMD Adrenaline software tells me that it only supports AMD-Systems.

Skip the Adrenaline software! Go straight for the drivers. The Adrenaline software does some extra stuff to detect the VM and never gets a far as actually installing the drivers. You can bypass it completely.

https://www.amd.com/en/support/downloads/drivers.html/graphics/radeon-rx/radeon-rx-7000-series/amd-radeon-rx-7700s.html

Got just the driver installed, still no difference. Something is very odd. I just tried to boot from a Ubuntu-Image to verify if it is a driver issue in Windows or an issue with the VM itself.
While navigating through GRUB I have an output on the console and the display which is connected to the GPU’s USB-C. As soon as I boot to the live system, the output on the connected display freezes and in Display settings I can only find the virtual monitor. When i shutdown the live system display output works again…
I suspect that the card somehow fails during boot - either because it “knows” that it is plugged in to a VM or something else…
I’m out of ideas on how to investigate this…


How do you bypass this? I don’t see a link for a direct driver download anywhere on that website, only Adrenalin. I’ve installed the drivers directly by extracting them from Adrenalin downloads but do you literally do this each time there is an update?

I had dGPU passthrough working just fine using proxmox, but when i tried using libvirt, i got stuck in the same place.
Switching to using bare qemu commands instead of going through libvirt solved it for me. I don’t know what libvirt is doing to mess this up, and also not sure how to address it there. I guess there’s a config option missing. Perhaps adding '-vga none -nographic" using libvirt would solve it, but I have not tried this myself. (using <qemu:commandline > and <qemu:arg …/> options).

Do you mind sharing your qemu commandline that is working? i would like to compare the options that libvirt is using…

From the logs I have the following command:

/usr/bin/qemu-system-x86_64 \
-name guest=Windows11,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-2-Windows11/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/Windows11_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine pc-q35-6.2,usb=off,vmport=off,dump-guest-core=off,kernel_irqchip=on,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=pc.ram \
-accel kvm \
-cpu host,migratable=on,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x1fff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-stimer-direct=on,hv-reset=on,hv-vendor-id=1234>
-m 31737 \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":33278656512}' \
-overcommit mem-lock=off \
-smp 16,sockets=16,cores=1,threads=1 \
-uuid jbasjdbbjbdf\
-smbios 'type=0,vendor=INSYDE Corp.,version=03.03,date=03/27/2024,release=3.3' \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=33,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=localtime,driftfix=slew \
-global kvm-pit.lost_tick_policy=delay \
-no-hpet \
-no-shutdown \
-global ICH9-LPC.disable_s3=1 \
-global ICH9-LPC.disable_s4=1 \
-boot strict=on \
-device pcie-root-port,port=16,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \
-device pcie-root-port,port=17,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=18,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=19,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \
-device pcie-root-port,port=20,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 \
-device pcie-root-port,port=21,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 \
-device pcie-root-port,port=22,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 \
-device pcie-root-port,port=23,chassis=8,id=pci.8,bus=pcie.0,addr=0x2.0x7 \
-device pcie-root-port,port=24,chassis=9,id=pci.9,bus=pcie.0,multifunction=on,addr=0x3 \
-device pcie-root-port,port=25,chassis=10,id=pci.10,bus=pcie.0,addr=0x3.0x1 \
-device pcie-root-port,port=26,chassis=11,id=pci.11,bus=pcie.0,addr=0x3.0x2 \
-device pcie-root-port,port=27,chassis=12,id=pci.12,bus=pcie.0,addr=0x3.0x3 \
-device pcie-root-port,port=28,chassis=13,id=pci.13,bus=pcie.0,addr=0x3.0x4 \
-device pcie-root-port,port=29,chassis=14,id=pci.14,bus=pcie.0,addr=0x3.0x5 \
-device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 \
-blockdev '{"driver":"file","filename":"/home/matthias/Schreibtisch/ubuntu-22.04.4-desktop-amd64.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}' \
-device ide-cd,bus=ide.1,drive=libvirt-2-format,id=sata0-0-1,bootindex=2 \
-blockdev '{"driver":"host_device","filename":"/dev/nvme0n1","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"u>
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"discard":"unmap","cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.4,addr=0x0,drive=libvirt-1-format,id=virtio-disk0,bootindex=1,write-cache=on \
-netdev tap,fd=34,id=hostnet0,vhost=on,vhostfd=36 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:4c:e7:52,bus=pci.1,addr=0x0 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev spicevmc,id=charchannel0,name=vdagent \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \
-chardev socket,id=charchannel1,fd=31,server=on,wait=off \
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0 \
-chardev socket,id=chrtpm,path=/run/libvirt/qemu/swtpm/2-Windows11-swtpm.sock \
-tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \
-device tpm-crb,tpmdev=tpm-tpm0,id=tpm0 \
-audiodev '{"id":"audio1","driver":"spice"}' \
-spice port=5900,addr=127.0.0.1,disable-ticketing=on,image-compression=off,seamless-migration=on \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1 \
-device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0,audiodev=audio1 \
-chardev spicevmc,id=charredir0,name=usbredir \
-device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=1 \
-chardev spicevmc,id=charredir1,name=usbredir \
-device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 \
-device vfio-pci,host=0000:03:00.0,id=hostdev0,bus=pci.6,addr=0x0,rombar=1,romfile=/usr/share/vgabios/dummy.rom \
-device vfio-pci,host=0000:03:00.1,id=hostdev1,bus=pci.7,addr=0x0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

Looks like you are using the qxl-vga driver, I don’t know if that plays well with dGPU passthrough / Looking Glass. I suggest you replace the above with ‘-vga none -nographic’.

My commandline looks like this:

-accel kvm
-daemonize
-nodefaults
-machine hpet=off,type=pc-q35-8.1
-rtc driftfix=slew,base=localtime
-global kvm-pit.lost_tick_policy=discard
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg
-device qemu-xhci,p2=15,p3=15,id=xhci,bus=pci.1,addr=0x1b
-iscsi initiator-name=iqn.1993-08.org.debian:01:39407ad058b
-device pvscsi,id=scsihw0,bus=pci.0,addr=0x5
-device ich9-intel-hda,id=audiodev0,bus=pci.2,addr=0xc
-device hda-micro,id=audiodev0-codec0,bus=audiodev0.0,cad=0,audiodev=spice-backend0
-device hda-duplex,id=audiodev0-codec1,bus=audiodev0.0,cad=1,audiodev=spice-backend0
-boot menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg
-smbios type=1,uuid=
-drive if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE_4M.secboot.fd
-drive if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/dev/vm1/vm-108-efidisk,size=540672
-smp 8,sockets=1,cores=8,maxcpus=8
-cpu qemu64,+aes,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=ezkvm,hv_vpindex,kvm=off,+kvm_pv_eoi,+kvm_pv_unhalt,+pni,+popcnt,+sse4.1,+sse4.2,+ssse3
-m 16384
-vga none
-nographic
-spice port=5903,addr=0.0.0.0,disable-ticketing=on
-device virtio-serial-pci
-chardev spicevmc,id=vdagent,name=vdagent
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0
-device virtio-mouse
-device virtio-keyboard
-audiodev spice,id=spice-backend0
-device ivshmem-plain,memdev=ivshmem0,bus=pcie.0
-object memory-backend-file,id=ivshmem0,share=on,mem-path=/dev/shm/lg03,size=128M
-device vfio-pci,host=0000:03:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,multifunction=on
-device vfio-pci,host=0000:03:00.1,id=hostpci0.1,bus=ich9-pcie-port-1,addr=0x0.1
-device usb-host,bus=xhci.0,port=1,hostbus=1,hostport=2.2,id=usb0
-drive file=/dev/vm1/vm-108-boot,if=none,id=drive-scsi0,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap
-device scsi-hd,bus=scsihw0.0,scsi-id=0,drive=drive-scsi0,id=scsi0,rotation_rate=1,bootindex=0
-drive file=/dev/vm1/vm-108-tmp,if=none,id=drive-scsi1,discard=on,format=raw,cache=none,aio=io_uring,detect-zeroes=unmap
-device scsi-hd,bus=scsihw0.0,scsi-id=1,drive=drive-scsi1,id=scsi1,rotation_rate=1
-netdev id=hostnet0,type=tap,script=/root/bin/qemu-ifup.sh,downscript=no,vhost=on
-device id=net0,driver=virtio-net-pci,netdev=hostnet0,mac=,bus=pci.1,addr=0x0

Note that this does still read a proxmox config file & uses the proxmox ovmf firmware (as i run the same VM from proxmox as well).

Note also that prior to passing through the dGPU i installed all the Framework 16 drivers for Windows 11, i guess that includes the gpu driver.

Another way to diagnose this could be to make a Linux VM, and passthru the GPU to the Linux VM.
If that fails to work, you are likely to get more meaningful error messages in the Linux syslog.
Once you fix the problem on the Linux VM, hopefully that will fix the problem on the Windows VM also.

So there are some updates:

  1. After disabling QXL I got a working display output in my display, but only with a 800x600 resolution. But cool!

  2. I booted the VM into a Ubuntu-ISO and got my correct 1920x1080 resolution, even the displaytype was identified correctly. Even cooler!

  3. I did a clean reinstall of Windows and extracted the driver files from the amd driver package using 7zip. I then updated the driver using device manager and after install Error 43 came right back. That sucks.

  4. I created another VM and installed Ubuntu. The passtrough worked fine after i changed the BIOS to OVMF and added KVM=Hidden. I ran an GLmark2 Benchmark and got a score of 8665. So it seems to be working. I then changed the virtual harddrive to my windows hard drive - Error 43 disappeared but I was stuck at a resolution of 800x600 pixel. I then reinstalled the drivers and Error 43 came right back.

One potential issue you may hit (that I didn’t see mentioned here yet) if you want to pass through the AMD graphics is that AMD’s consumer GPUs don’t support SR-IOV. This means the dGPU can only be passed through to a single VM.

Intel iGPUs (and I think Nvidia GPUs ones with a tweaked driver) support SR-IOV, which lets you use the GPU for things like hardware acclerated video encode/decode across multiple VMs (or both the VM and the host system) at the same time. I use it on my home server running Unraid, to transcode video (TV shows recorded with a HDHomeRun) in a Docker container while also using hardware accelerated transcoding in a Windows Server 2022 VM for Blue Iris (security camera software).

1 Like

Ah so there is progress, looks like you’re almost there :slight_smile:
Error 43 indicates driver errors, this could be because the driver doesn’t want to play nice in a VM (NVidia is notorious for that, but hey, this is AMD, and should work better). It could also indicate that the driver is expecting a different pci bus configuration (which is more likely i think).

There’s a few more things you could try. Looking at the command-line you posted earlier, i suggest the following:

  • in the ‘-device vfio-pci,host=0000:03:00.0’ line add ‘multifunction=on’, and remove the ‘romfile=…’ option.
  • also in the ‘-device vfio-pci’ lines, you now have different bus= assignment, each with address 0x0. Instead, try having them on the same bus, but then with address 0x0.0 and address 0x0.1 respectively, that way the video and audio devices are configured as subfunctions of the same master device, just like on the host.
  • in the ‘-cpu’ line, try adding the ‘kvm=off’ flag.

Not sure how to do that in libvirt, but surely it has an option for using ‘multifunction’ devices, which is the essence here.

Good luck!

Thank you for your input!

I followed your guide, but without success. PCI-Assignments should be in order now?

I reinstalled Windows again and rebooted the host before installing the framework driver package on the VM.

One strange thing i noticed is, that I cannot reboot the VM. If I do, I loose the disyplay output. I have to shutdown the VM and then start it again in order to get display output. Rebooting with Ubuntu on the VM on the other hand works just fine.

I only use the card in one VM at a time.

Here is my current log (I removed my serial number):

2024-05-18 18:43:21.075+0000: starting up libvirt version: 8.0.0, package: 1ubuntu7.10 (Marc Deslauriers <marc.deslauriers@ubuntu.com> Fri, 12 Apr 2024 13:48:21 >
LC_ALL=C \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
HOME=/var/lib/libvirt/qemu/domain-3-ubuntu22.04 \
XDG_DATA_HOME=/var/lib/libvirt/qemu/domain-3-ubuntu22.04/.local/share \
XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain-3-ubuntu22.04/.cache \
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain-3-ubuntu22.04/.config \
/usr/bin/qemu-system-x86_64 \
-name guest=ubuntu22.04,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-3-ubuntu22.04/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/Ubuntu_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap">
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine pc-q35-6.2,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=pc.ram \
-accel kvm \
-cpu host,migratable=on,kvm=off \
-m 16000 \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":16777216000}' \
-overcommit mem-lock=off \
-smp 8,sockets=8,cores=1,threads=1 \
-uuid ................ \
-smbios 'type=0,vendor=INSYDE Corp.,version=03.03,date=03/27/2024,release=3.3' \
-smbios 'type=1,manufacturer=Framework,product=Laptop 16 (AMD Ryzen 7040 Series),version=A7,serial=FRAGACCPA740830006,sku=FRAGACCP07,family=16in Laptop' \
-smbios 'type=2,manufacturer=Framework,product=FRANMZCP07,version=A7,serial=leftout 00XS,asset=*,location=*' \
-smbios type=3,manufacturer=Framework,version=A7,serial=......,asset=...,sku=..... \ #serial left out
-smbios >
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=33,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc,driftfix=slew \
-global kvm-pit.lost_tick_policy=delay \
-no-hpet \
-no-shutdown \
-global ICH9-LPC.disable_s3=1 \
-global ICH9-LPC.disable_s4=1 \
-boot strict=on \
-device pcie-root-port,port=8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 \
-device pcie-root-port,port=9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
-device pcie-root-port,port=10,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
-device pcie-root-port,port=11,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
-device pcie-root-port,port=12,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \
-device pcie-root-port,port=13,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \
-device pcie-root-port,port=14,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x6 \
-device pcie-root-port,port=15,chassis=8,id=pci.8,bus=pcie.0,addr=0x1.0x7 \
-device pcie-root-port,port=16,chassis=9,id=pci.9,bus=pcie.0,multifunction=on,addr=0x2 \
-device pcie-root-port,port=17,chassis=10,id=pci.10,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=18,chassis=11,id=pci.11,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=19,chassis=12,id=pci.12,bus=pcie.0,addr=0x2.0x3 \
-device pcie-root-port,port=20,chassis=13,id=pci.13,bus=pcie.0,addr=0x2.0x4 \
-device pcie-root-port,port=21,chassis=14,id=pci.14,bus=pcie.0,addr=0x2.0x5 \
-device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 \
-device virtio-scsi-pci,id=scsi0,bus=pci.5,addr=0x0 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.6,addr=0x0 \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/ubuntu22.04.qcow2","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-3-format","read-only":false,"discard":"unmap","driver":"qcow2","file":"libvirt-3-storage","backing":null}' \
-device virtio-blk-pci,bus=pci.4,addr=0x0,drive=libvirt-3-format,id=virtio-disk0 \
-blockdev '{"driver":"file","filename":"/home/matthias/Schreibtisch/Win11_23H2_German_x64v2.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":>
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}' \
-device ide-cd,bus=ide.0,drive=libvirt-2-format,id=sata0-0-0 \
-blockdev '{"driver":"file","filename":"/home/matthias/Downloads/virtio-win-0.1.240.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}>
-blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \
-device ide-cd,bus=ide.1,drive=libvirt-1-format,id=sata0-0-1 \
-netdev tap,fd=34,id=hostnet0,vhost=on,vhostfd=36 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:27:88:9e,bus=pci.1,addr=0x0 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,fd=31,server=on,wait=off \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-chardev spicevmc,id=charchannel1,name=vdagent \
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-audiodev '{"id":"audio1","driver":"spice"}' \
-spice port=5900,addr=127.0.0.1,disable-ticketing=on,image-compression=off,seamless-migration=on \
-device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0,audiodev=audio1 \
-chardev spicevmc,id=charredir0,name=usbredir \
-device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 \
-chardev spicevmc,id=charredir1,name=usbredir \
-device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 \
-device vfio-pci,host=0000:04:00.0,id=hostdev0,bootindex=1,bus=pci.9,addr=0x0 \
-device vfio-pci,host=0000:03:00.0,id=hostdev1,bus=pci.3,multifunction=on,addr=0x0 \
-device vfio-pci,host=0000:03:00.1,id=hostdev2,bus=pci.3,addr=0x0.0x1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.7,addr=0x0 \
-object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \
-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.8,addr=0x0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
char device redirected to /dev/pts/0 (label charserial0)
2024-05-18T18:44:42.549183Z qemu-system-x86_64: terminating on signal 15 from pid 1553 (/usr/sbin/libvirtd)
2024-05-18 18:44:43.350+0000: shutting down, reason=destroyed

Not sure if this is the problem, but it seems you are still missing the

-vga none
-nographic

arguments in your command, meaning that qemu will still enable it’s default vga display, that could be a problem.

@CodeMichael did you ever figure out how to get dgpu to attach and detach without going unstable?

Has anyone else figured this out? It’d be awesome to be able to detach it when launching the VM to attach it to the VM, then have it reattach to the computer after the VM shuts down.

This is the script I’ve been using which seems to be stable, but I wouldn’t say I’ve gone through extensive testing either.

1 Like

Does this mean the comment about instability in your repo’s main README.md is possibly no longer valid?

I haven’t used it much, but so far its been stable. I’ve been refactoring my repo after rebuilding my desktop, so I haven’t update in a bit, but I’ll correct that statement when I do get around to updating.

So… I finally got it working. What a mess.

Upgrading to Ubuntu 24.04. instantly solved all my problems. I guess the machine version 6.2 was the problem. With 24.04. I now have version 8.2.

I created a new machine and only needed the kvm=hidden tag to get it working… :smiley:

Thanks to all of you for your help.

1 Like