Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Nvme passtrough to VM - how to

Featured Replies

Hello everyone,

I wanted to use my Nvme only for a VM.

At the moment the Nvme is an unassigned drive, and I've used it to create the disk of the VM.

But this is not a real passtrough - I would like to know how to pass the whole Nvme (to gain the performance peak) to the VM.


Thanks a lot in advance.

Solved by TDA

  • Author
14 minutes ago, TDA said:

Hello everyone,

I wanted to use my Nvme only for a VM.

At the moment the Nvme is an unassigned drive, and I've used it to create the disk of the VM.

But this is not a real passtrough - I would like to know how to pass the whole Nvme (to gain the performance peak) to the VM.


Thanks a lot in advance.

So I rewatched the video of SpaceInvadersOne: 

 

I've made following:

Selected my NVME disk and binded it to VFIO :

- Select the Nvme disk - at the bottom click on : bind selected to VFIO at Boot , then rebooted the server. - Created a new VM, where I selected the Nvme as a PCI device

- Created a new VM , Nvme showed up as PCIE.

- When I try to fire up the VM, following error appears:

image.png.06940dce5941f19e28cecec8b013589f.png

 

 

 

  • Community Expert
23 minutes ago, TDA said:

Hello everyone,

I wanted to use my Nvme only for a VM.

At the moment the Nvme is an unassigned drive, and I've used it to create the disk of the VM.

But this is not a real passtrough - I would like to know how to pass the whole Nvme (to gain the performance peak) to the VM.


Thanks a lot in advance.

Bind to VFIO so you can attach as a PCI device. or you can put the drive path in the disk location.

 

paths are here.

 

ls /dev/disk/by-id/

 

  • Author
1 minute ago, SimonF said:

Bind to VFIO so you can attach as a PCI device. or you can put the drive path in the disk location.

 

paths are here.

 

ls /dev/disk/by-id/

 

I've tried to bind it as VFIO (see my updated post), but I got an error.

I will try to unbind it from VFIO, reboot the server and try through /dev/disk

  • Author
20 minutes ago, SimonF said:

Bind to VFIO so you can attach as a PCI device. or you can put the drive path in the disk location.

 

paths are here.

 

ls /dev/disk/by-id/

 

I've found following:

nvme-KINGSTON_SNVS2000GB_50026B7684ECB8C3@

nvme-KINGSTON_SNVS2000GB_50026B7684ECB8C3-part1@ 

 

How can I map it to my vm exatcly?

  • Community Expert
4 minutes ago, TDA said:

I've found following:

nvme-KINGSTON_SNVS2000GB_50026B7684ECB8C3@

nvme-KINGSTON_SNVS2000GB_50026B7684ECB8C3-part1@ 

 

How can I map it to my vm exatcly?

If you plan to format in the VM use one without part as that is the first partion on the disk.

 

Re pci passthru is your Bios up todate.

 

  • Author
4 minutes ago, SimonF said:

If you plan to format in the VM use one without part as that is the first partion on the disk.

 

Re pci passthru is your Bios up todate.

 

So... I've unmounted the Nvme from Unassigned Drives.

Now I see:

image.png.de561036bd23949976600766168ccb75.png

 

Nonetheless, when i try to add it to the VM, it doesn't work since it want a size.


I still not get why VFIO didn't work since:

image.png.dc055ae3e462d78518c89eaf6e90ceb1.png

 

But let VFIO apart for a moment.

 

How exactly to do it with the ID?

 

I've tried following:

image.thumb.png.bdb828f99b6c09e956ef53f353bb8961.png

 

But...

 

image.png.3293fb19e1a9cf527be5524f41497ab7.png

  • Author

I've now tried following:

image.png.13491599e699dc43976ef510e5762289.png

 

So putted the nvme0n1 (which is my NVME) directly as a /dev/ inside the config of the VM...

VM fired up, and the ISO of windows was able to see the whole disk.

I don't know If this is the correct way.

 

I think I have to set something more to get the NVME working correctly tough...

 

Edited by TDA

  • Community Expert
1 minute ago, TDA said:

I've now tried following:

image.png.13491599e699dc43976ef510e5762289.png

 

So putted the nvme0n1 (which is my NVME) directly as a /dev/ inside the config of the VM...

VM fired up, and the ISO of windows was able to see the whole disk.

I don't know If this is the correct way.

 

 

You need to include the full path /dev/disk/by-id/.......

 

Using /dev/nvmen1 should be fine but that could change if hardware is changed.

 

 

  • Author
3 minutes ago, SimonF said:

You need to include the full path /dev/disk/by-id/.......

 

Using /dev/nvmen1 should be fine but that could change if hardware is changed.

 

 

I've tried with the full path but somehow it won't start :-(

But with /dev/nvme0n1 it's working.

 

Performance arent so great in the end unfortunately ...do I have to change the <target dev='hdd' bus='sata' /> to bus=scsi or something?

  • Author
7 minutes ago, TDA said:

I've tried with the full path but somehow it won't start :-(

But with /dev/nvme0n1 it's working.

 

Performance arent so great in the end unfortunately ...do I have to change the <target dev='hdd' bus='sata' /> to bus=scsi or something?

My bad, was a misstip, now with:

image.thumb.png.e2a612d96c4fbfc7791bbe1e3b7c6d6a.png

 

Is working.

But still confused if it the bus has to be SCSI or SATA for a PCI NVME..

 

EDIT:

if bus = scsi, disk is not detected by Windows installer

if bus = sata, disk is detected

 

It should be correct with the bus = sata right?

Edited by TDA

  • Community Expert
43 minutes ago, TDA said:

My bad, was a misstip, now with:

image.thumb.png.e2a612d96c4fbfc7791bbe1e3b7c6d6a.png

 

Is working.

But still confused if it the bus has to be SCSI or SATA for a PCI NVME..

 

EDIT:

if bus = scsi, disk is not detected by Windows installer

if bus = sata, disk is detected

 

It should be correct with the bus = sata right?

Sata should be fine.  It is using a device path on the host so will show as a disk not a pci device.

  • Author
On 4/2/2025 at 10:49 PM, SimonF said:

Sata should be fine.  It is using a device path on the host so will show as a disk not a pci device.

Thanks for the clarification.
Still a little bit odd that it wasn't working as a VFIO though, since it's usable mapping the device path directly, do you think I made something wrong with the VFIO mapping? Or maybe I'm missing something there?
The NVME is on it's own group:
image.thumb.png.c9c1a391055f5bad2fc0c3c91f2133ab.png

 

 

Mapped, I was able to install Windows SVR2025 on this disk (I've cleared it first).

What's a little bit odd is that, when I stopped the VM it's shown as follow in the UD :

image.thumb.png.858ac715d5bcc4738829e54c131a4644.png

Two partitions are shown as XFS - which is a little bit unclear to me.

 

EDIT:
I saw a threat with issue with passthrough, it seems related to the SM2263XT, and there is a possible workaround, but I dont quite know how to edit the xml in the correct way - and it seems not to be "so stable".

So I will try to use the "normal mapping", without VFIO with this drive for the moment, and eventually use another NVME drive.

Still wondering on the partitioning FILESYSTEM of the NVME when windows was installed.

 

EDIT2:

After redoing the whole thing with Mapped drive at the end it seems to show the right FS:

image.thumb.png.fc2bebc0e85d494837287641bc3d9fd2.png

 

Edited by TDA
update

  • Community Expert
2 hours ago, TDA said:

Thanks for the clarification.
Still a little bit odd that it wasn't working as a VFIO though, since it's usable mapping the device path directly, do you think I made something wrong with the VFIO mapping? Or maybe I'm missing something there?
The NVME is on it's own group:
image.thumb.png.c9c1a391055f5bad2fc0c3c91f2133ab.png

 

 

Mapped, I was able to install Windows SVR2025 on this disk (I've cleared it first).

What's a little bit odd is that, when I stopped the VM it's shown as follow in the UD :

image.thumb.png.858ac715d5bcc4738829e54c131a4644.png

Two partitions are shown as XFS - which is a little bit unclear to me.

 

EDIT:
I saw a threat with issue with passthrough, it seems related to the SM2263XT, and there is a possible workaround, but I dont quite know how to edit the xml in the correct way - and it seems not to be "so stable".

So I will try to use the "normal mapping", without VFIO with this drive for the moment, and eventually use another NVME drive.

Still wondering on the partitioning FILESYSTEM of the NVME when windows was installed.

 

EDIT2:

After redoing the whole thing with Mapped drive at the end it seems to show the right FS:

image.thumb.png.fc2bebc0e85d494837287641bc3d9fd2.png

 

Which version of os you running and do you know the controller type.

 

You can add this in the GUI on 7

 <qemu:arg value='-set'/> > <qemu:arg value='device.0000:04:00.0.x-msix-relocation=bar2'/> 

 

 

 

 

  • Author
19 hours ago, SimonF said:

Which version of os you running and do you know the controller type.

 

You can add this in the GUI on 7

 <qemu:arg value='-set'/> > <qemu:arg value='device.0000:04:00.0.x-msix-relocation=bar2'/> 

 

 

 

 

So I have to retry with the VFIO, and then add the line you wrote in the QEMU Command Line?

 

  • Community Expert
44 minutes ago, TDA said:

So I have to retry with the VFIO, and then add the line you wrote in the QEMU Command Line?

 

Yes

  • 3 weeks later...
  • Author
On 4/5/2025 at 7:49 PM, SimonF said:

Yes

Hello,

I've tried what you suggested:

image.thumb.png.9d4ffcccaa6dc52ec0c9c875ff99d8e5.png

 

I then clicked "update", but it seems not to work.

 

Then I wrote it like this:

<qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.0000:04:00.0.x-msix-relocation=bar2'/>
</qemu:commandline>

 

And this time the code is kept in the GUI.

Unfortunately it tells me:

internal error: process exited while connecting to monitor: qemu-system-x86_64: -set device.0000:04:00.0.x-msix-relocation=bar2: there is no device "0000:04:00" defined

Edited by TDA

  • Community Expert
3 hours ago, TDA said:

Hello,

I've tried what you suggested:

image.thumb.png.9d4ffcccaa6dc52ec0c9c875ff99d8e5.png

 

I then clicked "update", but it seems not to work.

 

Then I wrote it like this:

<qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.0000:04:00.0.x-msix-relocation=bar2'/>
</qemu:commandline>

 

And this time the code is kept in the GUI.

Unfortunately it tells me:

internal error: process exited while connecting to monitor: qemu-system-x86_64: -set device.0000:04:00.0.x-msix-relocation=bar2: there is no device "0000:04:00" defined

Will need to do some more research.

  • Author
On 4/21/2025 at 10:43 PM, SimonF said:

Will need to do some more research.

Did you had any chance to dig it through?
Is there a way I can help you to help me find a solution? 🙂
Thanks in advance for your effort!

  • Community Expert
59 minutes ago, TDA said:

Did you had any chance to dig it through?
Is there a way I can help you to help me find a solution? 🙂
Thanks in advance for your effort!

Looks like you cannot use the PCI ID but need to have an alias. This is unlikely to be removed if you change via the GUI.

 

Change qemu part to be.

<qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.nvmetest0.x-msix-relocation=bar2'/>
</qemu:commandline>

 

Save then edit and change to XML mode and add the alias to you nvme line.

<hostdev mode='subsystem' type='pci' managed='yes'>
  ...
  <alias name='nvmetest0'/>
</hostdev>

 

  • Author

Thanks SimonF;

So I've found in the end where the <hostdev mode='subsystem' type='pci' managed='yes'> is (near the end of the XML), I've tried to add the:

<alias name='nvmetest0'/> , (line 129) so my .XML is like that:

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>SCCM Workbench</name>
  <uuid>dcbf45bc-c685-7500-6c4d-7ac79f373e2c</uuid>
  <description>Windows Server 2025 HyperV</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm" webui="" storage="default"/>
  </metadata>
  <memory unit='KiB'>33554432</memory>
  <currentMemory unit='KiB'>33554432</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='9'/>
    <vcpupin vcpu='1' cpuset='25'/>
    <vcpupin vcpu='2' cpuset='11'/>
    <vcpupin vcpu='3' cpuset='27'/>
    <vcpupin vcpu='4' cpuset='13'/>
    <vcpupin vcpu='5' cpuset='29'/>
    <vcpupin vcpu='6' cpuset='15'/>
    <vcpupin vcpu='7' cpuset='31'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-9.2'>hvm</type>
    <loader readonly='yes' type='pflash' format='raw'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader>
    <nvram format='raw'>/etc/libvirt/qemu/nvram/dcbf45bc-c685-7500-6c4d-7ac79f373e2c_VARS-pure-efi-tpm.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode='custom'>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vpindex state='on'/>
      <synic state='on'/>
      <stimer state='on'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='1' dies='1' clusters='1' cores='4' threads='2'/>
    <cache mode='passthrough'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/SVR/2025/SW_DVD9_Win_Server_STD_CORE_2025_24H2_64Bit_English_DC_STD_MLF_X23-81891.ISO'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.266-1.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <interface type='direct' trustGuestRxFilters='yes'>
      <mac address='52:54:00:18:ae:d4'/>
      <source dev='bond0.10' mode='bridge'/>
      <model type='virtio-net'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <tpm model='tpm-tis'>
      <backend type='emulator' version='2.0' persistent_state='yes'/>
    </tpm>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='fr-ch' sharePolicy='ignore'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <audio id='1' type='none'/>
    <video>
      <model type='qxl' ram='65536' vram='16384' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <alias name='nvmetest0'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.nvmetest0.x-msix-relocation=bar2'/>
  </qemu:commandline>
</domain>

 

But when I save it, it's reverted without the <alias name='nvmetest0' />

 

  • Community Expert
3 minutes ago, TDA said:

Thanks SimonF;

So I've found in the end where the <hostdev mode='subsystem' type='pci' managed='yes'> is (near the end of the XML), I've tried to add the:

<alias name='nvmetest0'/> , (line 129) so my .XML is like that:

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>SCCM Workbench</name>
  <uuid>dcbf45bc-c685-7500-6c4d-7ac79f373e2c</uuid>
  <description>Windows Server 2025 HyperV</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm" webui="" storage="default"/>
  </metadata>
  <memory unit='KiB'>33554432</memory>
  <currentMemory unit='KiB'>33554432</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='9'/>
    <vcpupin vcpu='1' cpuset='25'/>
    <vcpupin vcpu='2' cpuset='11'/>
    <vcpupin vcpu='3' cpuset='27'/>
    <vcpupin vcpu='4' cpuset='13'/>
    <vcpupin vcpu='5' cpuset='29'/>
    <vcpupin vcpu='6' cpuset='15'/>
    <vcpupin vcpu='7' cpuset='31'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-9.2'>hvm</type>
    <loader readonly='yes' type='pflash' format='raw'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader>
    <nvram format='raw'>/etc/libvirt/qemu/nvram/dcbf45bc-c685-7500-6c4d-7ac79f373e2c_VARS-pure-efi-tpm.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode='custom'>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vpindex state='on'/>
      <synic state='on'/>
      <stimer state='on'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='1' dies='1' clusters='1' cores='4' threads='2'/>
    <cache mode='passthrough'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/SVR/2025/SW_DVD9_Win_Server_STD_CORE_2025_24H2_64Bit_English_DC_STD_MLF_X23-81891.ISO'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.266-1.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <interface type='direct' trustGuestRxFilters='yes'>
      <mac address='52:54:00:18:ae:d4'/>
      <source dev='bond0.10' mode='bridge'/>
      <model type='virtio-net'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <tpm model='tpm-tis'>
      <backend type='emulator' version='2.0' persistent_state='yes'/>
    </tpm>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='fr-ch' sharePolicy='ignore'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <audio id='1' type='none'/>
    <video>
      <model type='qxl' ram='65536' vram='16384' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <alias name='nvmetest0'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.nvmetest0.x-msix-relocation=bar2'/>
  </qemu:commandline>
</domain>

 

But when I save it, it's reverted without the <alias name='nvmetest0' />

 

Did you save in xml page or did you revert to form view. Need to save in xml view.

  • Author
1 minute ago, SimonF said:

Did you save in xml page or did you revert to form view. Need to save in xml view.

Saved from the xml view, but still get's overwritten.

  • Author
17 minutes ago, TDA said:

Saved from the xml view, but still get's overwritten.

I've tried to do something like described here:

 

Which states that you have to call the alias like ua-xxxx

So I removed the qemu commandline (removed it), and added directly following in the .xml

But it doesn't work - the Vm starts (sort of... it freeze the GUI for 1min or so.. and then you cannot connect to VNC... so probably something is still wrong - or wronger 😞 )
 

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>test</name>
  <uuid>c60d6936-9b00-8cdc-788e-e9afe3a7da34</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm" webui="" storage="default"/>
  </metadata>
  <memory unit='KiB'>57147392</memory>
  <currentMemory unit='KiB'>57147392</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='9'/>
    <vcpupin vcpu='1' cpuset='25'/>
    <vcpupin vcpu='2' cpuset='11'/>
    <vcpupin vcpu='3' cpuset='27'/>
    <vcpupin vcpu='4' cpuset='13'/>
    <vcpupin vcpu='5' cpuset='29'/>
    <vcpupin vcpu='6' cpuset='15'/>
    <vcpupin vcpu='7' cpuset='31'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-9.2'>hvm</type>
    <loader readonly='yes' type='pflash' format='raw'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader>
    <nvram format='raw'>/etc/libvirt/qemu/nvram/c60d6936-9b00-8cdc-788e-e9afe3a7da34_VARS-pure-efi-tpm.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode='custom'>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vpindex state='on'/>
      <synic state='on'/>
      <stimer state='on'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='1' dies='1' clusters='1' cores='4' threads='2'/>
    <cache mode='passthrough'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/SVR/2025/SW_DVD9_Win_Server_STD_CORE_2025_24H2_64Bit_English_DC_STD_MLF_X23-81891.ISO'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.266-1.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <interface type='direct' trustGuestRxFilters='yes'>
      <mac address='52:54:00:41:9c:69'/>
      <source dev='bond0.10' mode='bridge'/>
      <model type='virtio-net'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <tpm model='tpm-tis'>
      <backend type='emulator' version='2.0' persistent_state='yes'/>
    </tpm>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='fr-ch' sharePolicy='ignore'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <audio id='1' type='none'/>
    <video>
      <model type='qxl' ram='65536' vram='16384' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <alias name='ua-test'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <qemu:override>
    <qemu:device alias='ua-test'>
      <qemu:frontend>
        <qemu:property name='x-msix-relocation' type='string' value='bar2'/>
      </qemu:frontend>
    </qemu:device>
  </qemu:override>
</domain>

 

  • Author

Update:
After waiting long enough the VM starts indeed (strange it need so much time though... like 1/2mins)

And I'm not able to start VM with VNC which prevents me to start the ISO - so either the performance are killed for a reason, or something is still missing.

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.