GPU Passthrough and VM questions

I was looking into migrating from W10 to Pop! OS but I still need to run some Windows exclusive programs and a game or 2.

I know about VFIO, so I bought a GTX 1050 for Pop! OS and will be using my RX 580 for the Windows 10 VM. My questions are mostly hardware related:

  1. Can you use the RX580 when the VM is not running? I believe that ain’t possible, but if there is any way I’d like to know about it

  2. Can you setup multiple VMs (say W10 1903 and LTSC) with the same GPU? As long as they are not running at the same time I mean.

  3. Can I share the same secondary drive between Pop! OS and one of the VM’s? When I dual booted both Pop Os and W10, the storage HDD wouldn’t initialize after booting, so I had to go open it up before the music player would be able to read files from it. Quite annoying, but it might be just me not knowing how to use Linux.

  4. Will everything break (VFIO config, commands, virtual machines) when I replace my Ryzen 1600 with a newer CPU, the RX 580 with a beefier GPU or even the whole motherboard? Hardware ID would be different so I guess I would need to setup everything again to have it working just fine.

  5. When it comes to privacy, would the best practice be to work on W10 LTSC completely offline, play only in the W10 1903 VM (no browser, just Steam/Origin/EGS accounts), and then do my searches and daily use in Pop OS through TOR or Ungoogled Chromium with privacy extensions? I am trying to reduce my digital footprint as much as possible.

  6. Is there any way to restore my PopOS installation to a previous point in time, just in case I use the wrong command while configuring the UI to my liking and create an undoable mess? I’m still new to Linux but I’m taking my time to understand it little by little

Thanks guys

It is theoretically possible. I don’t know the current status of how well AMD cards and the AMDGPU driver play with unbinding/rebinding.

Absolutely.

It would be a very bad idea to do this directly (ie the drive being mounted directly).

I would suggest mounting the drive on pop os, then creating a network share and mounting the share in the VM. Samba/SMB is probably the easiest way to go. It is possible to have a specific host<–>vm only network connection, and only allow the network share on that connection.

You probably won’t have to re-install the VM, you will just have to tweak the VM config and/or the VFIO config.

  • CPU: May be fine as is, you would need to update the CPU core pinning in the VM config if you set that up.
  • Motherboard: You would need to edit the address of the GPU in the VM config.
  • GPU: You would need to edit the PCI ID to make VFIO bind to the new GPU.

There are a couple of options for this, but AFAIk nothing is set up by default.

The best way to set this up is using file system snapshots. That requires installing on a filesystem that has snapshots: btrfs, zfs, or LVM (not a filesystem itself, but has snapshots). Then use a tool like timeshift to create, manage and restore the snapshots. https://github.com/teejee2008/timeshift

Taking a snapshot is not a replacement for having a backup. It won’t help if the drive dies, or you accidentally format the drive, or anything similar.

1 Like

Not bad, but you have to restart x. Not sure about wayland.

1 Like

Sounds good!

Great! That sounds amazing, I currently can’t afford a 3rd GPU nor fit one in my case so I think this setup will be good enough!

I will look into that. There is no need to share the drive, you are right. I will just use an external SSD to manage my files while I work on there

Thanks for the information. Notes taken.

I got you. I shouldn’t be scared of messing it up, but last time I tried installing some stuff using the command line I didn’t really understand what was going on. Maybe I should read a little bit more about GNU/Linux

If you run a network share on pop and connect to it over a virtual network that’s only between the host and vm, it will be happy to run at disk speed all day, so on an NVMe drive, your “network drive” could see 2400MB/s easily.

A virtual nic on the right virtual net (ie one that doesn’t connect to any physical network gear) will be happy to go way over the spec speed all day long.

1 Like

Take your time. Ask questions. read manpages (man <command name>).

Work on gaining comprehension of what you’re doing, not just following the steps you see somewhere. Understand why you’re doing it, not just what.

For a Linux veteran, it’s not a complicated setup. For a Linux novice, it definitely can be, simply because of the amount of foundational knowledge people are expected to have beforehand.

1 Like

I think the Pop installer works with btrfs

Understood, I will look into virtual network interfaces a little bit more, now that you cleared that up for me it seems like a nice option.

Thank you! I am excited to begin. I got my hands on a copy of The Linux Command Line: A Complete Introduction and started doing more research about the OS in general to understand the terminal better when it comes to configuring and being capable of using Linux without a GUI for everything

1 Like

That’s a good place to start. Just the other day I had to drop down to the command line to fix some shenanigans around GPU drivers. It’s been a while since I had to do that, but a few minutes later I was up and running again. There’s a lot of stuff like that which will be much less mysterious if you start from the ground up.

Something to think about, if you’re moving from Windows to Linux.

Where all of Windows is Windows, Linux is comprised of hundreds of little programs that all work together. Linux is the kernel, which handles hardware normalization, task scheduling and memory management. (other stuff too, but that’s the essentials) Then you have things like shadow, which does password encryption for login, getty, which is your TTY program (the console login at ctrl+alt+F3). There’s lightdm which is the login screen for some distros, and other distros use gdm. Then you have the file browser, which could be nautilus, thunar or any number of others.

Point is, if you think of Linux as a lot of different things coming together to work as one, you’ll be able to wrap your head around how everything works better.

Every task is handled by a different program.

Got you, thanks a lot!

Now that I know that I will definitely see things differently, thank you Sgt!

1 Like