Resize Disk for Windows VM in Unraid

Whenever I create a VM, whether it be within Unraid or otherwise, inevitably I create it with a disk that is too small for its intended purpose. Often, I will create it to test things out, like AMD Passthrough in Unraid, with only a small enough disk to do the testing I need to. However, these experiments, once functional often grow into something that you wish to use for other purposes. Once that happens, the 40G virtual disk you created to just hold Windows, drivers, etc. becomes drastically too small. Luckily these are virtual disks, and can be expanded arbitrarily quite easily… unless you’re using Windows.

There are two basic phases of expanding a disk in Unraid + Windows. First we’ll tackle the Unraid portion, which is pretty simple. Then we’ll handle the Windows portion, since it requires you to move the recovery partition it includes, which requires a quick explanation.

AMD Passthrough in Unraid

XFX Radeon RX 6800 QICK 319
XFX Speedster XICK 319 Radeon RX 6800 Black

Recently, I tried my iRacing / NAS rig in VR with an Oculus Quest 2 that a friend of mine brought over. However, after fiddling with some settings to make it not look like crap, it seems like either the CPU (hopefully fixed here) or the current 1080Ti is holding it back. Though I would love to upgrade to a 30-series Ampere GPU, the new Navi AMD GPUs are actually better at traditional rasterization workloads (at least per dollar). Given the 1080Ti’s performance, it’s actually quite difficult to beat it on any sort of budget. However, really any GPU is hard to come by these days as we’re in the midst of a global silicon shortage. Luckily, I was able to get my hands on an XFX Speedster XICK 319 Radeon RX 6800 Black from Best Buy with 10 windows open, wildly refreshing during Best Buy’s last restocking. Unlike the nVidia GPUs, however, AMD’s have been previously plagued with a reset bug which requires rebooting the host OS when the guest is shutdown / booted up. Combine this with the RX 6800s being quite new, there’s a few complications involved in getting Unraid AMD passthrough running.

Read More

Zen 1 Turbo Boost in Unraid

Zen1 Logo (AMD)
Ryzen 7 1700 (Zen 1) on Unraid

One of the most frustrating things that has plagued my Unraid gaming VM setup has been that it doesn’t seem up to snuff when running games like iRacing. This as well as other single-threaded operations seem to run at a snails pace compared to what I’d expect. It turns out, this is partially a problem with AMD’s Zen 1 architecture compatibility with Linux. Unraid does not like to work well with the Zen architecture’s C-states, which must be disabled in the BIOS for system stability. However, doing so also seems to affect its Turbo Boost capability, as it will not single-thread boost up to the rated 3.7GHz. I’ll walk through what I did to enable, or work around at least, Zen 1 Turbo Boost in Unraid.

Read More

X370 Motherboard PCI / IOMMU Mapping

MSI X370 Gaming Pro Motherboard
MSI X370 Gaming Pro Motherboard

Since the NAS was going to be a typical tower and in the living room, the overarching goal was to make it also have the functionality of a gaming PC. To get true USB Hot-Plugging will require us to pass through an entire USB controller just like we did the Pascal GPU. We’ve covered the basics of IOMMU groups, and most server / workstation hardware (CPUs, motherboards, and chipsets) would make this pretty easy. However, I put this together out of older hardware I had laying around. Specifically, I have a Zen 1 Ryzen 7 1700 dropped into an X370 motherboard (MSI X370 Gaming Pro). Since all this hardware was made for “consumers”, the designers did not put a lot of thought into how things can be isolated and virtualized. So, the next step I need to take is to map all the IOMMU groups to actual devices on the motherboard.

Read More

Unraid PCIe and IOMMU Groups

Passing through a GPU on Unraid is usually a pretty easy task. Issues are easily solved as long as it’s in one of the “GPU” / main PCIe slots on most motherboards. There are some issues using it in the primary slot which are easily overcome. I discussed in my unRAID Pascal GPU Passthrough guide. However, for more advanced setups, you’ll need to start passing through other PCIe devices to virtual machines. This starts to get a bit more tricky and the many guides have some shot-gun approaches to solving the problems associated with these advanced setups. In order to maximize system stability, you’ll want to avoid these shot-gun approaches and the pitfalls associated with them. In this post I’ll give you a basic understanding of PCIe and IOMMU groups. Then discuss one of the more commonly touted “solutions” and the pitfalls associated with it.

Read More

Unraid VM USB Hot Plug

Windows Device Manager with USB Devices
USB Controllers in a Windows VM

Once you have basic GPU passthrough configured, you can get near bare-metal performance in a VM on Unraid using KVM under the hood. However, one thing that is a little awkward are USB devices. The host, in this case Unraid, owns, initializes, and configures USB devices by default. This gets even more complicated when you consider that Unraid boots off a USB device rather than another drive in the system.

Here we’ll look at how you can get close to hot-plugging USB devices into a VM. In a future post we’ll take it a step further to get near-baremetal functionality just like we did with the GPU.

Read More

unRAID Pascal GPU Passthrough

I decided recently to move on from my Synology NAS as the core storage / server device in my network infrastructure. I have re-purposed my previous gaming machine to become a heavier-duty server. There will be more to come on this setup later. I chose unRAID because I wanted it to also serve dual-duty as a living room gaming machine. One of the major advantages of unRAID is that it provides a good front-end to KVM virtualization under the hood. In order to enable nearly bare-metal performance on a VM, you have to direct-pass through a GPU to the VM. However, as we find this is not straightforward with nVidia cards.

Read More