PC Builds

How to convert your physical gaming PC into an Unraid VM w/Passthrough

By March 20, 2021No Comments

Introduction

Originally, I was going to make a single post, for both upgrading my PC, and converting it to leverage unraid.

However, after doing a LOT of googling for issues, I realized I needed to make a seperate post regarding the steps I had to take.

Assumptions

This article, assumes you have a WORKING PC, for which you wish to convert to an unraid VM. In my case, this is a working PC, with two dedicated SSDs, as well as a dedicated RTX 2070.

This assumes, you want to pass through the physical devices directly to the VM, to completely hide the fact, your PC is running inside of a VM.

This means, you displays, work like normal. You can plug in a USB device, normally. You can connect to WIFI, normally. etc.

Step 1. Configure IOMMU groups

This allows us to flag the devices for direct-passthrough.

From your unraid panel, goto Tools -> System Devices.

Next, you are going to want to check anything which you want passed directly into the VM.

While you MAY be tempted to click the checkmark next to your NVMe controllers, DON’T!!!!! Trust me- I spent many hours having to power down my system, and manually edit the config files to get it back up and running.

Select your GPU.

I selected my SECOND NIC, which is NOT in use by unraid. Do not check anything in use by unraid. I also selected the wifi device.

I selected one of my USB 3.0 controllers. To note, I cannot / did not select the other controller, because my unraid thumb drive is connected to it, as well as my z-wave and rtl_sdr stick.

Each device you are checking, puts a flag, which prevents it from being loaded into unraid. Don’t get too crazy here.

IF you mess up, and cannot get unraid to boot properly

  1. Power down the machine.
  2. Plug the thumb drive into another machine.
  3. Delete or Rename /boot/config/vfio-pci.cfg
  4. Remove thumb stick, reinstall, reboot.

Step 2. CPU Isolation

This will allow us to isolate certain CPU cores from unraid, and prevent them from being used by docker, etc. This means- the CPU cores you select, will be unavailable for use!

This setting dramatically improved performance of my gaming VM.

Navigate to Settings -> CPU Pinning. Scroll down to CPU Isolation.

Select the PAIRs you would like to dedicate to your VM. Emphasis on pairs. If your CPU does hyper-threading, ensure you select the proper pairs. The “HT CPUs” aren’t exactly real CPU cores, so, do keep this in mind.

Step 3. Reboot

Warning- This DOES assume you were not using the unraid UI via the machine you are working on…. Remember- we DID exclude the GPU, so, you may not have a UI when you reboot. Keep this in mind!

Step 4. Create the VM.

For Logical CPUs, Select the pairs you isolated in step 2.

For Initial / Maximum memory, ensure you set both fields to the same value, to disable memory ballooning which will impact performance.

Ensure BIOS is set to OVMF.

For the VirtIO Drivers ISO, you will need to click to select the preloaded ISO. This will be required to get the VM up and working properly.

For Primary/Other disks- assuming you want to do entire-disk passthrough-

  1. Select Manual
  2. Find the device’s path. ls /dev/disk/by-id
  3. Put the full device path here.
  4. For bus, select SATA. Don’t click virtio. I did this, and spent 30 minutes undoing it.

Next- Select your graphics card

Optional- Specify your sound card.

For your network bridge, set the proper bridge/vlan.

Lastly, you will need to select the devices to pass into the VM.

As noted in step 1, I am passing two entire USB hubs into the VM. This will ensure I can just plug in a device to the specified hub, and it will work with no issues.

I am also passing in my 2nd NIC, as well as my intel ax200 wifi chip.

After you hit this point, SAVE, but, don’t launch it yet. There are a few additional manual steps I found extremely helpful.

Step 5 – Other Misc Tweaks

The steps in this post assisted quite a bit with the performance of my NVMe SSDs.

https://forums.unraid.net/topic/94321-performance-issues-when-passing-through-entire-nvme-controller/?do=findComment&comment=871877

This post, was helpful in resolving an issue, which causes the CPU to hang at 100% when shutting down the VM.

Without disabling WSD, the CPUs allocated to the VM would hang at 100% usage until manually clicking force stop. After disabling WSD, the VM will shutdown normally.

https://forums.unraid.net/topic/91319-solved-vm-start-upshutdown-crashes-unraid/?do=findComment&comment=847826

Step 6 – Cross your fingers, and turn it on!

Hopefully after following the steps I documented above, you won’t have to spend the 8+ hours I did trying to track down and troubleshoot random issues.

The results of my “Gaming VM” are documented in a seperate post HERE.

Issues I have not yet resolved

  1. How to either run Corsair iCue software, or just disable the damn LEDs all over my RAM.
    1. Resolved- boot bare metal with a windows install, run the iCue software, and set a “hardware profile”. The hardware profile is saved in the ram somehow, and does not need the software running. I set my profile to just “Black” which disables the LEDs. You can also set a hardware profile to change the color based on temp. F
  2. How to disable the red LEDs on my hyper-212
    1. Resolved- Use wire cutters to snip the wires.
  3. Basically- disabling all of the blinky lights all over my PC.
    1. Resolved. Unplugged power LED & HDD LED.

Leave a Reply

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 85 other subscribers

%d bloggers like this: