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.

[GUIDE] Optimizing Windows VMs in unRaid

Featured Replies

m00nman, I hope you're still around. I'm a bit late to the party, but man, you are my hero. This post should be on Unraid somehow. You have my deepest gratitude!

 

Thank You!

  • 1 month later...
  • Replies 71
  • Views 78.7k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Thanks for the feedback. That's a beefy CPU and should never be maxed out when all VMs are just idling. I wish unraid team just implemented these fixes into the image, but VMs is probably not the main

  • LumpyCustard
    LumpyCustard

    Thank you SO MUCH for this. Your post resolved issues with a small production server I created for a family friend running 11 individual Windows 10 VM's.   Before (all VM's sitting on login

  • Posted in the "feature requests" subforum to include these by default. I doubt it will get any traction though.    

Posted Images

oh m00nman, thanks for the setting for windows VM

I just update the xml in step 1 and the android emulator in my windows VM now run like a rocket!🤪

  • 3 weeks later...
  • Author
On 4/19/2024 at 8:30 PM, shpitz461 said:

Another thing to do on Windows to improve latency is turning on MSI feature for PCIe devices.

 

See here for the utility:

 

https://forums.guru3d.com/threads/windows-line-based-vs-message-signaled-based-interrupts-msi-tool.378044/

 

I've turned on all mine on and set priority to High:

 

image.thumb.png.7fe1addd0a62eee9c2f22b0b88b86ec7.png

 

This can help, when you have a dedicated GPU in passthrough mode. You are not using it correctly though (although no harm done either). You can enable MSI interrupts for devices where MSI or MSI-X is listed under supported modes. If "LineBased" is the only option under supported modes you did nothing. On every VM I checked MSI was enabled for all devices that supported it. I don't believe it's as big of a deal before as it used to be before for passthrough GPUs as vendors now support passthrough to VM for the most part and they didn't before.

 

'Not correctly' in what way?

 

I'm passing a 3090, MSI is enabled on the host (unraid):

Quote

Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+

Enabling MSI in Windows improved the smoothness of the experience, I'm remoting to the VM via Parsec.

  • Author
On 4/24/2024 at 9:15 PM, shpitz461 said:

'Not correctly' in what way?

You've enabled MSI interrupts for devices that only show "LineBased". If 3090 didn't have it enabled by default, that's the only benefit. I had a different nVidia GPU passed through (1660S ?) and it had MSI enabled by default without me changing anything with new nvidia drivers. YMMV on this though, it might still be useful for the GPUs.

On 4/26/2024 at 1:04 AM, m00nman said:

You've enabled MSI interrupts for devices that only show "LineBased". If 3090 didn't have it enabled by default, that's the only benefit. I had a different nVidia GPU passed through (1660S ?) and it had MSI enabled by default without me changing anything with new nvidia drivers. YMMV on this though, it might still be useful for the GPUs.

 

If I'm passing through a virtual iGPU (Intel gvt-g plugin) would this setting help at all?

Edited by Linguafoeda

On 1/17/2024 at 8:38 AM, m00nman said:

 

Pinning is only necessary when you want to have predictable performance for a VM/container, especially under heavy load, at the expense of pinned cores just idling and doing nothing when the VM pinned to them is doing nothing.  Lettings the host's kernel distribute the load (no pinning) between unused or underutilized cores will give you better efficiency, and possibly better performance for all the VMs/containers at the expense of 0 predictability whether that particular VM that you use for, let's say, playing games will have adequate CPU utilization headroom for playing games (there are ways to assign priorities for VMs, but it's beyond the scope here). So it really depends on your use case. Enterprise solutions almost never use cpu pinning because they want to extract maximum performance for all of the VMs/containers.

Hi @m00nman, firstly thankyou so much for your original post and for all that you do, you have made this process so easy for the unexperienced. (me)

I just setup my 1st proper Win 11 gaming VM, my system has a 11700k cpu, 32gb ram, RTX 2080ti and utilising my Unraid mirrored cache nvme drives for my storage within the domains share.

 

I've done all that you have suggested including isolation of CPUs cores 4 to 7 & HT 12 to 15 (if i understand correctly 8 cores?) and 12gb of ram to the VM, my gpu is also bound to the VFIO for the VM only.

 

So as per your quoted comment, I really am starting to see the negative affects on the server itself with half the CPU being lost to the VM. It only gets used for gaming on the weekends, so i would say 10% of the time, not a lot. Its not my main gaming rig for the big AAA games so I think I'm willing to sacrifice not having the cpu cores isolated for a loss in performance.

So i have to ask what is the best way to proceed on that front? Do i just select the cores within the VM template (cpu pinning) or do I just select nothing and let unraid do its thing?

Or, Does it make sense to Isolate CPU cores 6 to 7 & HT 14 to 15 (quarter of the CPU) and pin CPU cores 4 to 5 & HT 12 to 13 that way it will leave more left over for Unraid/dockeretc.

So many options its hard to know the right path, I suppose that life in general....lol.

Any advise is much appreciated, thanks

  • 7 months later...

Just came here to say, good guide, but on later versions unraid, virtio-net is needed as using virtio makes massive CPU spikes.

  • Author
On 12/7/2024 at 2:54 AM, nerbonne said:

Just came here to say, good guide, but on later versions unraid, virtio-net is needed as using virtio makes massive CPU spikes.

Sorry, but because of additional CPU load and extra emulation I find that unlikely.

 

I mean, have you done any testing?  with my VM on virtio the SSD (4x consumer SSD in raid0) benchmark was 3500 but with it on virtio-net it was 9000 

I sometimes get 100% CPU and when I post a thread for help, they are seeing OOM errors in my diagnostics. But I just implemented solution number 1 only to test it out. Also, I have only 1 Windows VM, so solution number 2 is not for me( I think? ) because it is for multiple Windows VMs. I will update you again after 1 month or if I get 100% CPU again. Thank you.

  • Author
On 12/8/2024 at 1:12 PM, nerbonne said:

I mean, have you done any testing?  with my VM on virtio the SSD (4x consumer SSD in raid0) benchmark was 3500 but with it on virtio-net it was 9000 

Here you go:

 

virtio:

image.thumb.png.c399de4e6a18ef9151bc0cb8075c1e1c.png

 

virtio-net
image.thumb.png.9b28f62606a5367adf5d936d3cabd5a4.png

 

cores aren't pinned with virtio like with virtio-net. iperf3 server is on  Windows 2025 VM. Also note that it makes no difference in terms of throughput with my host CPU and with my network (2.5Gbit). It did make a difference when I had i7-4790 (non-k) as my host CPU.

Edited by m00nman

3 hours ago, m00nman said:

Here you go:

 

virtio:

image.thumb.png.c399de4e6a18ef9151bc0cb8075c1e1c.png

 

virtio-net
image.thumb.png.9b28f62606a5367adf5d936d3cabd5a4.png

 

cores aren't pinned with virtio like with virtio-net. iperf3 server is on  Windows 2025 VM. Also note that it makes no difference in terms of throughput with my host CPU and with my network (2.5Gbit). It did make a difference when I had i7-4790 (non-k) as my host CPU.

 

What version of unraid are you using? 

 

What was the host cpu usage during these tests?

 

  • Author
11 hours ago, nerbonne said:

 

What version of unraid are you using? 

 

What was the host cpu usage during these tests?

 

Unraid 6.12.14

Cpu was idle besides this iperf3 test

  • 3 weeks later...

I was going out of my mind trying to understand why even just typing and using windows explorerer to find files was laggy as hell, I had pinned 4 cores/8threads to just the VM (all dockers pinned to the other CPUs/threads) and 16GB of RAM, and a passed through RTX3060 and my windows machine was still laggy for not reason!

 

After following step (1) in your guide `<hyperv mode='custom'>` block and `migratable='off'>` and `<clock offset='localtime'> block` my entire system is running smooth!

 

thank you so much for publishing this information, it has made my windows VM usable again!

  • 3 weeks later...

Is deleting the following block

<cputune>
    .
    .
    .
  </cputune>

The same as selecting all cores from the GUI?

I don't want to have to edit the XML if I don't have to.

Many thanks for your input.

@jademonkee

On UNRAID 7 a lot of the Stuff described here can be changed via the GUI. Editing the XML should not be necessary.

8 minutes ago, pixeldoc81 said:

@jademonkee

On UNRAID 7 a lot of the Stuff described here can be changed via the GUI. Editing the XML should not be necessary.

So if I were to select all cores for a VM, it doesn't prevent them from being used by Unraid processes/Dockers, correct?

@jademonkee

Yes, as long as you do not configure CPU Isolation (Settings > CPU Pinning), the Cores can / will be used by all processes & docker.

 

Otherwise, configure CPU Isolation for some Cores (Beware of HT Pairs) and use them exclusively for vm / docker whatever.

 

AFAIK Core 1&2 will always be used by UNRAID itself.

Edited by pixeldoc81

On 12/18/2023 at 10:35 PM, Dase said:

 

Just open the Windows Start menu and type "core isolation". It'll take you to that settings page. Make sure "Memory integrity" is disabled. That definitely slowed down my Windows 11 VM.

 

This made my (8) VMs sooo much faster.  Thank you!

  • 5 months later...

sorry if anyone is still here. with the new update unraid 7.2 have implemented these fix. However, my cpu i5 12600k just trying to run my vm windows 11 but my cpu usage is still really high. I have passthrouh nvme drive and rtx 4060ti but my computer is still realy laggy. May I ask if there would be a fix for it? Thank you for your time. attached is my diagnotic.

tower-diagnostics-20251109-1814.zip

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.