Setting up my Windows VM

I realized today that I’d forgotten most of the steps involved in setting up the Windows VM I use every day. This post is just going to be a quick check list of (most of) the important steps to recreating it.

For anyone else reading this, I simply wanted a vm that has access to a gpu that I can shove onto its own monitor and move my mouse freely between monitors as if it were part of the host os. So I wanted full screen, shared audio, and most importantly for the window to be contained in the host (most solutions stop at being able to change monitor input.. but then I lose all my nice linux workspaces on that monitor!

So this setup checks all those boxes. I can interact with it freely, share sound back and forth, share clipboard, everything. And since I have 4 workspaces on my upper monitors, I can swap the vm in and out just like I would with any other window. Its basically a windows “workspace”

Minus the windows part, these steps can apply for any other OS. It is absolutely seamless and there isn’t any perceptible lag in sound or input.

  1. Setup virt manager with qemu following whatever is the latest on arch wiki
  2. Get windows ISO, set up and install windows. Make sure to use UEFI
  3. Make sure secondary GPU isn’t being grabbed by host OS on boot. just google it, it was quick to find the first time – but essential step
  4. Add secondary GPU video and audio to the devices to pass through
  5. Check to see if you need to have a patched ROM . Some GPUs require some don’t. Just try booting without a special ROM.
    1. Do I need to specify a ROM if I want it to use default? I don’t remember. But my current vm specifies a rom in the xml
  6. For the second GPU to work properly, it needs to be physically plugged into a monitor. Plug it into whatever monitor you want to use. The VM will share the properties with the real physical monitor. E.g. plug into 4k60 monitor and you’ll have 4k60 coming out of the vm. Plug into 2k144 you get 2k144.
    1. If you switch the monitor to the input of what you plugged into, you will see the VM. You’ll have to do the rest of the setup like this.
  7. On both the VM and the host, install looking glass. Updated instructions should be on the site.
  8. Switch the input on the monitor back to the host os and confirm you can use looking-glass cli command to access the vm
  9. Last step, to send audio through from vm to host, on both vm and host install scream audio.
    1. For some reason on Arch getting scream to work correctly was annoying. The following command sent the audio through to pulse just fine: scream -o pulse -i virbr0 &
  10. That should be it. If future me reads this and missed steps, just add them

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s