[Guide] Remote Gaming on Unraid

7. Configure and Install the VM

1. Download and transfer the software to the Unraid server. (click me)
  1. Download a Windows 10 ISO from the official Microsoft Windows 10 Media Creation Tool.
  2. Transfer the Windows 10 ISO to your isos share on Unraid.
    If you can’t see your isos share, make sure it’s being exported in Shares>isos>SMB Security Settings.
2. Go to the VMs tab and create a new VM. (click me)
  1. Select Windows 10.
    image
  2. Give it a Name.
  3. Give it a Description.
  4. CPU Mode: Host Passthrough
  5. Logical CPUs: Select an appropriate amount (usually 6-10 cores/threads), using only the isolated CPUs that we selected earlier.
  6. Initial Memory/Max Memory: set both of these values to the number you want.
    Here we’ll use 8192MB for 8GB.
  7. Machine: Q35-4.2
    4/16/20 update: use i440FX-4.2, only use Q35-4.2 if you run into issues
  8. BIOS: OVMF
  9. Hyper-V: No
  10. USB Controller 3.0 (qemu XHCI)
    (if you don’t have USB 3.0, use 2.0 (EHCI)
  11. OS Install ISO: Select your Windows ISO
  12. OS Install CDRom Bus: SATA
  13. VirtIO Drivers ISO: Select the virtio ISO you downloaded
  14. VirtIO Drivers CDRom Bus: SATA
    image
  15. Primary vDisk Location:
    1. Auto (uses your Domains share)
    2. Cache
      (not recommended, if you want to use the cache configure your domains share correctly)
    3. Direct disks
      (not recommended)
    4. Manual (if you want to use an unassigned drive)
  16. Primary vDisk Size: 128GB or larger
    (you can expand this later)
  17. Primary vDisk Type: raw
  18. Primary vDisk Bus: VirtIO
  19. Graphics Card: VNC
    (do not pass through your GPU yet)
  20. VNC Video Driver: QXL (best)
  21. VNC Password: (blank)
  22. VNC Keyboard: English-United States (en-us)
  23. Sound Card: None
    (we will fix this later)
  24. Network MAC: (no changes)
  25. Network Bridge: br0
  26. USB Devices: none
  27. Other PCI Devices: none
  28. Uncheck “Start VM after creation”
3. Start the VM (click me)
  1. You will control the VM through the Windows icon.
    Click it, and click start.
    image
  2. Click the icon again and click VNC Remote.
    image
  3. You may have missed the startup process where it says “Press any key to boot from CD/DVD”

    You missed the screen if you’re sitting at this.

    No worries though, just leave the VNC Remote screen open, Force Stop the VM, and start it again. Make sure you click the connect button on the VNC Remote window.
    image
    Once you have pressed the elusive any key you can move onto the next step.
4. Install Windows (click me)
  1. Use these default options, click “Next”.
  2. Click “Install Now”.
  3. Click “I don’t have a product key”. (we can add one later)
    Click this option even if you do have a product key.
  4. Use “Windows 10 Pro”, click “Next”. (I highly suggest this option since it has RDP built in)
  5. Accept the terms, click “Next”.
  6. Select “Custom: Install Windows only (advanced)”.
  7. You will likely see this screen, stating “We couldn’t find any drives.” Click “Load driver”.
  8. Click “Browse”.
    image
  9. Find the virtio-win CD Drive.
    image
  10. Navigate to the viostor/w10/amd64 folder, then click “OK”.
    image
    Your screen should look like this. Click “Next.” Wait for it to finish installing drivers.
  11. Select your drive and click “Next”. DO NOT CLICK “New”.
  12. Grab a cup of BAWLS™ and wait for it to finish.
  13. When it’s finished, let it reboot automatically.
  14. Select your region, and click “Yes”.
  15. Select your keyboard layout, and click “Yes”.
  16. Skip the second keyboard layout.
  17. Click “I don’t have internet” at the bottom left of the screen.
  18. Click “Continue with limited setup” at the bottom left of the screen.
  19. Create your user account. Click “Next”.
  20. Do not add a password now, we will do this later. Click “Next.”
  21. Click “No”.
  22. Click “Decline”.
  23. Turn all of these toggles to “No”. Make sure you scroll down and toggle all of them.
    Click “Accept” when you are sure that you got all of them.

  24. Grab a Smoke and a Pancake. Wait for this to finish.

    Pipe and a Crepe?
  25. Finished! (ish)
    We still have more stuff to do.
5. Configure Windows and Install Software (click me)
  1. Install virtio guest tools.
    Go to “This PC” then open the CD drive.

    Scroll down, and install virtio-win-gt-x64 with all default options.
    Confirm all prompts.
  2. You may get this message from Windows now that you have network connectivity.
    image
    You can tell it to piss off.
  3. Now is a good time to enter a password. Click start, type password and click “Change your password”.

    Using anything besides a normal password will not be covered by this guide.
    1. Add a password. Click “Next”.
    2. Click “Finish”.
  4. Configure RDP
    1. Click start, type “remote” and click “Remote Desktop settings”
    2. Toggle “Enable Remote Desktop” to “On”
      Click “Confirm”.
    3. Click “Show Settings” next to “Make my PC discoverable…”
    4. Select “Turn on Network discovery” and “Turn on file and printer sharing”
  5. Configure auto-login
    1. Click start, type “netplwiz” and press Enter.
    2. Uncheck “Users must enter a user name and password to use this computer.”
      Click “Apply”.
    3. Fill out the password twice.
      Click “OK”, the click “OK” on the main window.
  6. Change your VM’s name (this will show in your game clients)
    1. Right click on “This PC” and click “Properties”.
    2. Click “Change settings”.
    3. Click “Change…”.
    4. Change the VMs name.
      Click “OK”.
      Click “OK”.
    5. Click “Close”.
    6. Click “Restart Now”.
      image
6. Verify Windows logs in automatically.

Updated Auto-login procedure (click me)

>>Return to table of contents<<

8. Pass through your GPU (and Other Hardware)

1. Shut down your VM in the VMs tab.
2. Determine your device IDs (click me)
  1. Navigate to Tools>System Devices
  2. You may see this warning at the top. You can ignore it.
  3. What we’re looking for here is your device IDs. In this case, we will use the P2000 as an example.
    It’s usually easiest to press CTRL+F and find “nvidia” to highlight the devices we are looking for.
    In this case, there are two devices related to the P2000. We want to reserve both of these IDs in our syslinux config so that Unraid does not load them.

    And for another example, the RTX 2070 has 4 devices associated with it.
  4. Repeat this step for any other devices you want to be passed through to VMs. Other devices will not be covered in this guide.
3. Edit syslinux.cfg (click me)
  1. Navigate to Main, then click on your Unraid Flash device.
  2. Scroll down to “Syslinux Configuration” and click the toggle that switches from “Menu View” to “Raw View”.
    Each section under “label” is a boot option for Unraid. The top one is the default, so we will be using that.
    Add vfio-pci.ids= after the isolcpus= section as shown in the screenshot below. Add your passthrough device IDs in order that they appear in the system info we grabbed above.
    Shown below are the 4 devices for the RTX 2070.
    Apply changes and move on to the next step.
4. Reboot your Unraid server.
5. Edit the VM (click me)

image

  1. Remove the “OS Install ISO” text field.
    image
  2. Change the graphics card from VNC to your GPU.
    Take note of the device’s bus, in this case it’s “09”.
  3. Select your GPU’s vBIOS that we uploaded earlier in step [6.7] .
    It is located in /mnt/user/isos/biosname.rom
  4. Change the sound card to the GPU’s Audio controller.
    Make sure the bus starts with the same number.
  5. Since we are using a RTX card in this example, there are two additional devices for the USB-C hub that must be passed through. Every device will be different.
    Every device on the GPU must be passed through for native function.
  6. Click Update.
  7. Return to the VMs tab, and edit the VM again.
    image
  8. Switch from “Form View” to “XML View”
    This view will look intimidating, but it’s acutally not that bad.
    Any changes that you make in XML View will be reverted if you change back to Form View.
    Since that’s the case, I would highly recommend creating a local backup of your XML configuration when you’re done editing it.

    Your view should now look something like this.
  9. Find the <cputune> section and add the line <emulatorpin cpuset='X'/> below the core assignments.
    Where X is the CPU core you are pinning the emulation processes to.
    For the highest performance, use a core that is:
    1. Not in use by the VM
    2. Isolated from the Unraid host
    3. Not shared with another VM’s emulator pin (this doesn’t matter as much)
    4. Reference section 6.2 for more information on CPU pinning. In my case, cores 11 and 23 are isolated from the Unraid host, and I’m not going to use them for any VM. I will use core 11 for this VM, and I will use core 23 for two other VMs.
  10. Press CTRL+F and find your VBIOS file.
    (or just scroll down and find it)
  11. Each device starts with <hostdev mode=...
    and ends with </hostdev>
    The black brackets are host devices. There should be one host device for each device we passed through earlier.
    The red line is the physical bus, slot, and function the device is assigned.
    The blue line is the virtual bus, slot, and function the device is assigned.
    Note they are all on the same physical bus (magenta circle)
  12. Add a flag on the first virtual line below the BIOS that says multifunction='on'
    image
  13. Next, we need to change the virtual devices to be on the same bus, and set the functions to the same as their host.
    The first virtual bus (blue/yellow) is '0x00' so we’ll use that for all further virtual devices.
    The first virtual slot (blue/green) is '0x06' so we’ll also use that for all further virtual devices.
    The virtual functions (blue/cyan) must match the physical functions (red/cyan).
    image
  14. Scroll down, click “Update”
6. Boot the VM

>>Return to table of contents<<

1 Like

9. Install Drivers and Hosting Software

1. You'll notice that you no longer have the option to use the VNC Remote to control your server, since we removed it. (click me)

We’ll be using RDP on windows instead.
image

  1. Open RDP on your local windows machine. Type in the name of the VM that we created earlier. If you forget what it is, good news! You get to dive into your router to figure out what it’s IP is.
    image
  2. Connect, and when prompted to authenticate click “Use a different account”.
    Use the VM’s username and password we set up earlier.
    image
  3. Check this box and click “Yes”.
    image
  4. If that all worked, then you can access your VM remotely!
2. Verify that your devices are working properly. (click me)
  1. Click start, type “Device Manager” and open it.
  2. Look in “Display Adapters” for your GPU.
    If it’s showing here without an error sign, then you passed it through correctly.
    If there’s an error, please revisit the steps regarding editing the VM’s XML and BIOS passthrough.
    (example, Code 43)
  3. Verify that your sound device is working properly.
3. Install Graphics Drivers (click me)

(with all default options)

  1. Nvidia (use Geforce Experience if you want to use moonlight)
  2. AMD
  3. Intel
  4. MSI Afterburner (for Nvidia/AMD GPUs)
  5. Double check Device Manager after installing drivers to ensure Display Adapters and Sound devices are identified correctly.

>>Return to table of contents<<

1 Like

10. Configure Hosting Software

1. General (click me)
  1. User Account Control loves to mess with Parsec. Disable it.

  2. Install Hosting Software
    1. Ninite (Installs 7zip, Google Chrome, Classic Start, Steam,
      WinDirStat, and TeamViewer)
    2. Unfortunately, we need to use TeamViewer for this one step. Open TeamViewer on both your Unraid VM and your client. Connect, and re-log into windows through TeamViewer.
    3. Parsec
      Create an account and log in.
      Right click on the Parsec icon in the tray, and select “Run when my computer starts”.
    4. Log in with the same Parsec account on your client, and connect to your VM.
      The rest of the guide will not be using RDP to access the machine, but instead will use Parsec. RDP will be your fallback if something goes wrong with Parsec.
    5. You can now uninstall TeamViewer if you want.
      Good riddance.
      image
    6. Rainway
2. Graphics (click me)
  1. Resolution & Framerate
    Now that you can access your PC remotely, it’s time to make sure that your dummy plug supports the resolutions and framerates that you want to stream in.
    Again, this guide covers the use of Nvidia GPUs, so for AMD and Intel the process will be different.
    1. Open the NVIDIA Control Panel.
    2. Navigate to Display>Change resolution, and see if the resolution that you want is listed.
      Most of you will use 1080p, and that’s just fine.
    3. If for some reason the resolution that you want isn’t listed, click “Customize…”
      Check the box that says “Enable resolutions not exposed by the display” and click “Create Custom Resolution…” then click “Accept”.

    4. Enter in the resolution and refresh rate.
      In this case, I want to stream some Modern Warfare at 1080p 120Hz!
    5. Click “Test” and confirm that it is working.
      image
  2. High Performance mode
    1. Open the NVIDIA Control Panel.
    2. Click “Manage 3D Settings”
    3. Under “Power Management Mode”, change it to “High Performance”
      Make sure to apply the settings.
    4. Click the start menu or search bar, and type powercfg.cpl and press Enter.
    5. Click “Show additional plans”
    6. Select “High Performance”
  3. Disable Sleep
    1. Click either of these options
    2. Turn both off
      image
  4. Disable Hibernation
    1. Open command prompt as Administrator
    2. type powercfg -h off and press Enter
      image
3. Parsec (click me)
  1. Open up the settings panel in Parsec, and go to Host.
    1. Hosting Enabled: Enabled
    2. Host Name: [blank]
    3. Resolution: Autodetect
      If you leave this on Autodetect, you can change the resolution in windows which will change the stream resolution.
    4. Bandwidth Limit: 50Mbps
      We will override this later, use the highest setting for now.
    5. Exclusive Input Mode: On
    6. H.265 (HEVC) On
      This should be on if your hardware supports it. You will also have to turn it on client-side, otherwise it will fall back to H.264. (remind your friends to turn it on as well)
    7. Display: [default]
    8. Echo Cancelling: Off
    9. Virtual Gamepad Type: Xbox 360
  2. Next, go to Network.
    1. Client Port: 0
    2. Host Start Port: 8000
    3. UPNP: Off
  3. Scroll all the way down. Where it says “For advanced usage, you can edit the configuration file directly.”
    Click that.
    Here you can override setting limits and enable advanced ones.
    image
    1. encoder_bitrate = 100
      Bitrate in Mbps.
    2. server_refresh_rate = 60
      This is the refresh rate of the Parsec server. This is the framerate sent to the client.
      It’s possible to set this to higher refresh rates such as 100, 120, or 144… But keep in mind you’ll have to have the client, server, and network hardware to match.
4. Rainway (click me)

There’s not a whole lot to configure in Rainway. Here are some simple things to look at.

  1. Connect your relevant accounts in Settings>Account.
  2. In Settings>Hardware/Encoding
    Ensure that your GPU is selected. If you have passed through your Intel iGPU, that option is preferable if you have a 7th Gen or newer Intel CPU.
    Select your main display and audio device as well.
    Do not use Software encoding unless you’re looking for a bad time.
  3. In Settings>Stream
    Select
    1. Quality
      1. Fast = 3 Mbps
      2. Balanced = 7 Mbps
      3. Beautiful = 12 Mbps
      4. Very Pretty = 25 Mbps
      5. Extremely Pretty = 50 Mbps
    2. Framerate
      1. 30 FPS
      2. 60 FPS
      3. 120 FPS
      4. 144 FPS
    3. Stream Scaling (only useful if you are running into bandwidth issues IMO)
  4. In Settings>Network
    Disable the default port, and instead use the fallback port 40136.
5. Steam & Steamlink (click me)
  1. Go to Steam>Settings in the Steam Client
  2. Go to Settings>Remote Play, check “Enable Remote Play”
  3. Click “Advanced Host Options”
  4. Copy the following options below and press “OK”.
    image

>>Return to table of contents<<

11. Network Configuration

I’m going to make you do things the right way with pfSense, not the “easy way”.
We will be making aliases for the IPs and ports that will be in use, in addition to the normal static IP and port forwarding.

1. Reserve a static IP for your VM. (click me)
  1. From your pfSense dashboard, click Status>DHCP Leases
  2. Find the VM that we created.
    Click the first + sign, and create a static mapping for its IP address.
  3. Use an IP that’s outside of your DHCP range, but in your network’s subnet.
    For me, my network is 192.168.3.0, and my DHCP range is .100 - .254
    192.168.3.55 is not in use by any other device, and fulfills those conditions.
    Scroll all the way to the bottom and click “Save”.
2. Identify Ports needed by your applications (click me)
  1. Parsec needs 3 ports per remote connection.
    For ease of use, we’re going to forward a UDP port range of 30, for up to 10 remote players.
    This range is 8000:8029.
  2. Rainway requires UDP port 40136 to be forwarded for remote connections.
3. Create Aliases for IPs and ports. (click me)
  1. Navigate to Firewall>Aliases
    1. Navigate to IP
    2. Add a new entry (at the bottom)
    3. Fill out these fields with Name, Description, Type, and the IP that we set earlier.
      Save when you’re finished.
  2. Navigate to Firewall>Aliases
    1. Navigate to Ports
    2. Add a new entry (at the bottom)
    3. Fill out these fields with Name, Description, Type, and the port range we determined earlier.
      Save when you’re finished.
  3. Repeat the steps above for any and all IPs or ports that you would like to create an alias for.
4. Forward ports (click me)
  1. Navigate to Firewall>NAT>Port Forward
    Add a new entry.
  2. Fill out the following fields, using the Aliases we created.
    (interface, protocol, destination, destination port range, redirect target IP, redirect target port, and NAT reflection)
    Save changes when you’re done.

>>Return to table of contents<<

12. Potential issues

Issue: No sound from Parsec (click me)
  • Parsec by default captures your primary audio device.
  • Even if you have passed through your audio device correctly, if it doesn’t have a target it will not render audio. This is why I recommend HDMI dummy plugs over other models, since they also emulate sound devices.

Troubleshooting:

  1. Right click on your sound icon, then “Open Sound settings”
  2. Click “Sound Control Panel”

    This is a functioning dummy plug/sound device

    This is a non-functioning dummy plug/sound device
    image

Solution:

Luckily, you can solve this problem by using Virtual Audio Cable.
Simply install it, and you’re good to go. (you may have to restart Parsec and/or the VM)

Issue: Black screen with Nvidia RTX client (not host)

Solution:

When “H.265 HEVC” is enabled in Client Settings, also make sure to turn on “Decoded Compatibility”.

>>Return to table of contents<<

1 Like

13. Experimental Performance Settings

In addition to the settings above, you may find that the settings below improve your VM’s performance even further. They may also cause unexpected results, and no warranty of any kind is given (expressly or implied) if you decide to use them.
That said, I am using them and I have noticed that performance has increased significantly.

1. Re-enable Hyper-V with XML code

Replace the entire <features></features> code block with the section below.

  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vpindex state='on'/>
      <synic state='on'/>
      <stimer state='on'/>
      <reset state='on'/>
      <vendor_id state='on' value='1234567890ab'/>
      <frequencies state='on'/>
    </hyperv>
    <kvm>
      <hidden state='on'/>
    </kvm>
    <vmport state='off'/>
    <ioapic driver='kvm'/>
  </features>

And replace the <clock></clock> code block with the section below.

  <clock offset='localtime'>
    <timer name='rtc' present='no' tickpolicy='catchup'/>
    <timer name='pit' present='no' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
    <timer name='tsc' present='yes' mode='native'/>
  </clock>
2. Overclock your GPU

[Guide] Overclocking (the right way) on Nvidia GTX and RTX series cards

14. Benchmarks

All benchmarks below were run with 4 cores/8 threads from an AMD Ryzen 9 3900X and a Nvidia RTX 2070 locked at 1050mV.

The following 3 tests were conducted at 1080p, all settings maximum with motion blur turned off. These tests were benchmarked remotely through parsec, encoded with h.265. Desktop and in-game refresh rate were set to 60 or 120fps, in borderless window mode. Three VM modes were tested: i440fx-4.2 with emulator core pinned, i440fx-4.2, and Q35-4.2.

1. F1 2019 (click me)

F1 2019 seems to have the most consistent results, and at maximum settings seems to be a good test of both CPU and GPU.

Raw numbers
image

Min/Avg/Max FPS
F1 2019 1

Total Score
F1 2019 2

2. Metro Last Light Redux (click me)

Even though this is the remastered version of MLL, performance is pretty solid across the board. There is a noticeable uptick in average FPS and total score with i440fx-4.2 and the emulator core pinned.

Raw numbers
image

Min/Avg/Max FPS

Total Score

3. Rise of the Tomb Raider (click me)

ROTR benchmark numbers are a sum of 3 tests, which is why FPS numbers are so high. Maximum FPS isn’t too important, keep an eye on average and minimum FPS instead.

Raw numbers
image

Min/Avg/Max/Overall FPS

The following benchmarks were run on the same hardware, exclusively on Forza Horizon with i440fx-4.2 and the emulator core pinned. The goal was to explore the hardware encoding performance differences between h.264 and h.265, at various resolutions and frame rates.

4. Forza Horizon 4 (click me)

Raw numbers

4K60 h.265 vs h.264
Encoding performance is near identical, at least with the RTX 2070. However, h.265 bandwidth is much lower and image quality is much higher. It’s hard to show in still pictures, but it’s extremely noticeable in motion. Use h.265 whenever possible.

1080p h.265 at 240/120/60 FPS
These tests were were performed at minimum graphics settings to achieve maximum performance.
Encoding at higher frame rates reduces rendering performance (albeit very little), and increases network bandwidth used. A higher frame rate also reduces overall image quality, but may* increase responsiveness.

>>Return to table of contents<<

I don’t even game and this already sounds so damn cool.

2 Likes

You read my mind! Been wanting to do one of these!

1 Like

Very intriguing.

Bad link: post 5, setup #1 CPU lists E5-2630L v2, however hyperlink goes to 9600K on amazon.

Intel Xeon E5-2630L V2

Good link: https://ebay.to/3bYucoz

1 Like

Thanks, I’ll update it!

WoW! That is an impressive how to guide.

1 Like

This is awesome! Exactly what I needed. Thanks @JDM_WAAAT!

1 Like

Under “OS Install CDRom Bus:” you recommend “USB”. It seems to not find the install media unless I use “sata”. Am I missing a step?

1 Like

I will correct that. It should be SATA, thanks for pointing that out.

1 Like

Updated. Thanks again.

1 Like

Wish I could find the time to spend trying to set up pfSense with my AT&T Fiber. This looks like a fun afternoon of tinkering. I assume we could use a previous running Win10 VM with a passthrough GPU once Parsec is installed and configured

I’m running PFsense with att fiber. Not much work. Just put the modem they provide into bridge mode.

1 Like

i had planned on using the guide I found here, just haven’t gotten around to it.