Jump to content

HELP, cant create an empty VM to passthrough NVMe: VM creation error


Go to solution Solved by ghost82,

Recommended Posts

On 1/4/2023 at 10:13 AM, ghost82 said:

 

Exactly, try this, copy/paste and save xml:

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>Windows 11</name>
  <uuid>bf15b8e2-225d-d84f-2b67-00d3e3e61b20</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm"/>
  </metadata>
  <memory unit='KiB'>9437184</memory>
  <currentMemory unit='KiB'>9437184</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
    <vcpupin vcpu='4' cpuset='8'/>
    <vcpupin vcpu='5' cpuset='9'/>
    <vcpupin vcpu='6' cpuset='10'/>
    <vcpupin vcpu='7' cpuset='11'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-7.1'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/bf15b8e2-225d-d84f-2b67-00d3e3e61b20_VARS-pure-efi-tpm.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode='custom'>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='1' dies='1' cores='8' threads='1'/>
    <cache mode='passthrough'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <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='0x04' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:b2:bb:98'/>
      <source bridge='virbr0'/>
      <model type='virtio-net'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 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='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-gb'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <tpm model='tpm-tis'>
      <backend type='emulator' version='2.0' persistent_state='yes'/>
    </tpm>
    <audio id='1' type='none'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <boot order='1'/>
      <alias name='ua-sm2262'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <qemu:override>
    <qemu:device alias='ua-sm2262'>
      <qemu:frontend>
        <qemu:property name='x-msix-relocation' type='string' value='bar2'/>
      </qemu:frontend>
    </qemu:device>
  </qemu:override>
</domain>

 

If it doesn't work attach diagnostics.

If part of the code is stripped it could be an unraid issue.

You didn't have any graphics defined in the xml, I added basic qxl + vnc, so connect to the vm with builtin novnc.

Once and if you fix the nvme issue you can try to passthrough the igpu.

 

 

Hi,

It failed with new error, do you need diagnostic for this? It looks like something related to tpm 

 

operation failed: unable to find any master var store for loader: /usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd

 

 

 

 

 

Link to comment
On 1/4/2023 at 10:13 AM, ghost82 said:

 

Exactly, try this, copy/paste and save xml:

 

If it doesn't work attach diagnostics.

If part of the code is stripped it could be an unraid issue.

You didn't have any graphics defined in the xml, I added basic qxl + vnc, so connect to the vm with builtin novnc.

Once and if you fix the nvme issue you can try to passthrough the igpu.

 

 

 

Bro your the best, I had to create another VM, copied the OS part and overwritten yours and it worked but now i want to set iGPU and for some reason when I enter bitlocker it doesnt accept the key, says wrong key, and im using same key for years

 

Also, what will be the setup if i want to use the OS in a window but have it GPU accelerated so i can play a 4K video or something [if its posible?]

Unless GPU always means running with HDMI?

 

Link to comment
14 hours ago, Hexenhammer said:

but now i want to set iGPU and for some reason when I enter bitlocker it doesnt accept the key, says wrong key, and im using same key for years

I never used bitlocker so I really don't know how it works, what I know is that it encrypts the drive.

It could be possible that changing the hardware in the vm makes the drive inaccessible.

If you can access the vm with vnc and unlock the drive try to deactivate bitlocker, do your hardware changes, make sure it works without bitlocker, then reactivate it.

See here for example:

https://social.technet.microsoft.com/Forums/windows/en-US/09caca79-76bf-4e70-81c3-ad8cb4da40e1/bitlocker-and-hardware-modification-best-practice-?forum=w7itprosecurity

 

14 hours ago, Hexenhammer said:

what will be the setup if i want to use the OS in a window but have it GPU accelerated so i can play a 4K video or something [if its posible?]

Unless GPU always means running with HDMI?

From your signature I see you have a 12700 cpu: as far as I know igpu passthrough for this cpu is still unsupported because of intel drivers, but I'm not 100% sure.

If this is true, to have acceleration you need a dGPU installed and passed through, with a server (vnc, or parsec, or etc) configured INSIDE the vm, so the only graphic configured for the vm is the dGPU.

Then you can connect from a second device with the vnc/parsec client and you will stream accelerated contents.

You should not need any dummy plug or monitor connected to the vm, I have a second box with an nvidia gpu running in a windows 11 vm without any monitor nor dummy plug connected.

Edited by ghost82
Link to comment
6 hours ago, JorgeB said:

Changing hardware requires the recovery key, which must be created before.

 

After i enter the recovery key, it "boots" for long time and shows GREEN error screen "Unmountable Volume"

 

I think i need to try and boot into normal windows on this drive, disable bitlocker, boot into unraid and then try again or preferably make an image from NVMe and copy it to RAID0 cache that i have and no longer mess with NVMe passthrough [with the problematic model that i have]

Link to comment
6 hours ago, ghost82 said:

I never used bitlocker so I really don't know how it works, what I know is that it encrypts the drive.

It could be possible that changing the hardware in the vm makes the drive inaccessible.

If you can access the vm with vnc and unlock the drive try to deactivate bitlocker, do your hardware changes, make sure it works without bitlocker, then reactivate it.

See here for example:

https://social.technet.microsoft.com/Forums/windows/en-US/09caca79-76bf-4e70-81c3-ad8cb4da40e1/bitlocker-and-hardware-modification-best-practice-?forum=w7itprosecurity

 

From your signature I see you have a 12700 cpu: as far as I know igpu passthrough for this cpu is still unsupported because of intel drivers, but I'm not 100% sure.

If this is true, to have acceleration you need a dGPU installed and passed through, with a server (vnc, or parsec, or etc) configured INSIDE the vm, so the only graphic configured for the vm is the dGPU.

Then you can connect from a second device with the vnc/parsec client and you will stream accelerated contents.

You should not need any dummy plug or monitor connected to the vm, I have a second box with an nvidia gpu running in a windows 11 vm without any monitor nor dummy plug connected.

 

 

Thank you.

 

So what will be my steps, which part to copy to try and boot with my iGPU?

I can create another VM with iGPU enabled and then copy that block from xml, but which block do i need to copy?

Will your settings persist if i enable GUI to enable iGPU or i need to keep it as xml file all the time to have your settings work?

 

Link to comment
38 minutes ago, SimonF said:

I have 12600k cannot get iGPU working with windows code 43 but works ok for linux

 

Try this

 

https://forums.unraid.net/topic/99478-solved-gpu-passthrough-issue-bar-0-cant-reserve/

 

add the following code to the /flash/config/go file:

 

#!/bin/bash

#fix video for VM
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

 

Those lines unbind the console & by adding it to /flash/config/go will execute this piece of code on every boot of the system.

 

Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...