Jump to content

Windows 11 Virtual Machine Platform - WSL2 Boot Loop


Recommended Posts

On 7/28/2024 at 6:24 PM, wacko37 said:

Sadly this seems to be the case, as I'm having severe stability issues on the VM when gaming with this "custom" CPU passthrough method.

 

I'm not exactly sure why but after 20+ mins of solid gaming without any FPS drops / lagging the VM starts to lag hard, it never locks up totally but FPS drop to 10 FPS. Sometimes the VM recovers after 1min but it quickly drops to 10fps again, other times the FPS drop and then starts bouncing between 10 to 60fps ( have set a global limit of 60fps ) but it never fully recovers until a fully shutdown and reboot of the VM.

 

There seems to be no specific reason for it, as the VM was working absolutely perfectly with heavy loads before the FPS drops. Changing settings within the game has zero effect on this outcome or how the VM runs in general. I've mainly been using GTA5 to test but it doesn't matter the game at all.

 

I reverted back to the standard CPU passthrough mode applied by default in Unraid to test. I can see the moments where the VM starts to struggle but it always recovers quickly and FPS come back up, settings within the game most definitely have an effect on stability in this type of CPU passthrough.

 

It's almost as if certain features of the CPU are not being enabled correctly as @mackid1993 has pointed out, but I don't know how to go about proving that theory.

 

The only reason I'm using a custom CPU passthrough is because its the only thing that allows Roblox to be played within a VM as mentioned in my previous comment. Ive exhausted all other avenues to achieve this and I have no idea why the custom CPU passthrough allows Roblox to work but it does. Sadly that brings other no serious issues along with it.

 

Attached are both XMLs in .txt files

 

As always any advice or knowledge is much appreciated.

2024-07-20 - Windows 11 - Gaming VM - Custom CPU passthrough.txt 10.24 kB · 0 downloads 2024-07-27 - Windows 11 - Gaming VM - XML - Default CPU passthrough.txt 10.01 kB · 0 downloads

Just a suggestion. Buy an nvme drive, bind it to VFIO and pass it through over PCIe to your VM. Use a disk cloning tool such as Macrium Reflect to clone your vidsk to the nvme drive. Then boot baremetal into the nvme drive and play Roblox. Plug a monitor, mouse and keyboard into your server.

Link to comment
5 hours ago, mackid1993 said:

Just a suggestion. Buy an nvme drive, bind it to VFIO and pass it through over PCIe to your VM. Use a disk cloning tool such as Macrium Reflect to clone your vidsk to the nvme drive. Then boot baremetal into the nvme drive and play Roblox. Plug a monitor, mouse and keyboard into your server.

Thanks for the time and reply as always.

 

I have really thought long and hard about doing a dual boot system to alleviate all the issues regarding a VM but decided against in the end because the servers primary purpose is to be a Server that's available 24/7, then 2nd to that are the dockers/containers also online 24/7, that's the only reason the system exists.

 

The VM was a added luxury and allows me to get the most out of that hardware thats running 24/7, but I'm sure you already fully understand my reasoning.

 

I have a dedicated/binded NVME drive to the VM, along with a GPU and NIC, lucky my 2080ti has a USB controller built-in so thats passthrough also. It's only really the CPU & Ram being shared.

 

It's like I'm so so close to having my perfect system/Gaming VM but yet so far away 😔 

 

Do you know what's the difference between the default CPU mode "Passthrough" and the "Custom" mode mentioned here in this thread?

 

Whatever that's doing it's appeasing Roblox for some reason.

 

 

Edited by wacko37
Spelling
Link to comment
7 hours ago, JonathanM said:

Shared, yes, but also remember the VM "motherboard" is running in code on the host. Restrict the motherboard, hamstring the VM.

 

True that, the glue that holds it all together how could I forget.

 

I'm stuck in a conundrum, with default CPU mode = passthrough my VM is stable and works a treat but Roblox crashes after 20sec without error.

 

On the other hand with CPU mode = custom Roblox works ok but my VM has delayed stability issues causing lagging.

 

It's thanks to the info on this thread and also from the last few comments from this GitHub thread (May 10th onwards) that helped me to get Roblox to actually load.

 

https://github.com/zhaodice/qemu-anti-detection/issues/56

 

For some reason changing the "Model=0" within the added <qemu:commandline> section to the XML allowed Roblox to function. From my limited understanding adding the <qemu:commandline> section to the XML seemed to override the default <CPU> section of the XML, this lead me to this thread and found that I didn't need the <qemu:commandline> section to achieve a working Roblox.

 

Sadly I have very limited understanding of what this is actually doing to allow Roblox to work. Surely there is some kind of tweak that can be applied when using the CPU mode "passthrough" that would appease Roblox.

 

Why can't my kids play something other than ROBLOX!!! 😭

Link to comment
  • 1 month later...

Hi Community, back again but this time it’s very good news.

 

Basically, I’ve gone full circle and now back on (<cpu mode='custom') I’ve been running this setup for 3-4 weeks now and everything is working perfectly with zero instability across all games. When the VM is idle the resource usage almost nothing….. FINALLY a perfect VM!!!

 

Roblox is working via the Windows Store app as mention here: 

 

Long story short, “Unraid Share Mode: VirtioFS Mode” was the culprit here and was causing the system to randomly lock up. Once removed all my issues were resolved and as mentioned the VM idle resources are back to near zero.

 

I’m glad in a way, as its forced me to learn more about the XML view by adding necessary features and pinning “emulatorpin” & “iothreadpin” which have also helped drastically with stability.

 

I have attached my XML and will now be marking this thread as resolved.

 

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm'>
  <name>Windows 11</name>
  <uuid>351920c1-41b7-abf6-86a9-df25e7703fa5</uuid>
  <description>Windows 11 - Gaming VM</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm"/>
  </metadata>
  <memory unit='KiB'>10485760</memory>
  <currentMemory unit='KiB'>10485760</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <iothreads>2</iothreads>
  <cputune>
    <vcpupin vcpu='0' cpuset='5'/>
    <vcpupin vcpu='1' cpuset='13'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='14'/>
    <vcpupin vcpu='4' cpuset='7'/>
    <vcpupin vcpu='5' cpuset='15'/>
    <emulatorpin cpuset='2-4,10-12'/>
    <iothreadpin iothread='1' cpuset='2-4,10-12'/>
    <iothreadpin iothread='2' cpuset='2-4,10-12'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-7.2'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/d566211d-a3fe-da18-b5e2-8ec98fd0e29e_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='custom' match='exact' check='full'>
    <model fallback='allow'>Skylake-Client</model>
    <topology sockets='1' dies='1' cores='3' threads='2'/>
    <feature policy='disable' name='hle'/>
    <feature policy='disable' name='rtm'/>
    <feature policy='disable' name='mpx'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='hypervisor'/>
  </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>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/ISOs/Win11_23H2_EnglishInternational_x64v2.iso'/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <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/ISOs/virtio-win-0.1.248-1.iso'/>
      <target dev='hdb' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x15'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0x16'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/>
    </controller>
    <controller type='pci' index='8' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='8' port='0x17'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/>
    </controller>
    <controller type='pci' index='9' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='9' port='0x18'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='10' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='10' port='0x19'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/>
    </controller>
    <controller type='pci' index='11' model='pcie-to-pci-bridge'>
      <model name='pcie-pci-bridge'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='12' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='12' port='0x1a'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </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:19:a0:d0'/>
      <source bridge='br0.1'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' 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>
    <audio id='1' type='none'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x2'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x3'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0e' slot='0x00' function='0x0'/>
      </source>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'/>
</domain>

 

Edited by wacko37
Code insert was missing - option was available in edit post
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...