Two-Player Gaming PC

TwoVirtualMachinesOneComputer

Background

Notes on setting up a 2-player, one-cpu gaming PC for my kids.

I originally setup a single gaming PC for my kids and then realized it would be nice if they could play against each other. Rather than building a second entire PC I decided to just add a second GPU and run Windows 10 virtualized twice. Two monitors, two keyboards, two mice, one computer tower.

Inspired by Linus Tech Tips: 2 Gaming Rigs, 1 Tower video.

Built with a Ryzen 3600 CPU, 32GB RAM, 960GB NVME, Corsair 750W PSU, Nvidia Zotac Mini 1070, Nvidia 1080 Founder’s Edition and a ASUS 570-P motherboard in a NZXT H510 case.

Software is unRAID v6.8.3 at time of install. Clean install with two Windows 10 VMs setup.

GPU Handoff from unRAID to VM

The Ryzen 3600 has no intergrated graphics so after booting unRAID with one of the GPUs it needs to be handed off for one of the Windows 10 VMs to use. Many tutorials either suggested this happened once the VM was started, while others suggested you needed to install a separate GPU for unRAID to use. It wasn’t happening automatically for me and I couldn’t easily install a third GPU on this motherboard. Also, it seemed wasteful to have a GPU installed just for booting with no other use.

In the unRAID forums I came across a solution that is working for me.

Essentially I use the UserScripts plugin to run the following code once every boot before the VMs are started.

1
2
3
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

This successfully allows the VMs to take control over their assigned GPUs even if unRAID was outputting to them at boot time.

Juggling USB Devices

By default each VM template needs to be assigned the USB devices that are passed through at boot.

Two problems arose.

First, if you wanted to add a new USB device, like a webcam or flash drive, the VM needed to be shutdown, and the newly plugged in device manually assigned through the unRAID dashboard. Kids were not amused.

Second, we were trying to use two identical Logitech gaming mice and unfortunately unRAID can’t seem to differentiate two USB devices with the same hardware type. Essentially whichever VM gets assigned one of the mice, would get both of them.

My solution was to get two inexpensive PCI-E USB controller cards and then passthrough each entire controller card to each VM and let them handle the devices directly.

SpaceInvaderOne has an excellent video discussing how to do exactly this with unRAID and it worked wonderfully. I added the cards, assigned them to each VM and added a USB hub below each monitor. Now anything plugged into that hub is ONLY seen by the associated VM. This solves the issue of duplicate hardware types and also means I don’t need to manually assign any new USB devices in the VM template.

There is another issue avoided by passing through the USB controller card. If you are manually assigning USB devices and then the USB device is not plugged in when you try to start a VM, the VM will error out and not start. Passing through the always-available hardware controller avoids this issue ever happening and the VM should always be able to start reliably regardless of whether all the normal USB devices are attached.