So I built a decent computer for my father for his B-day. He has been wanting to switch for Linux a long time but, he wants Windows 7 and Windows XP in a virtual machine for work and other programs that aren’t supported on Linux. I’d like to set up GPU passthrough in case he need to run some CAD programs for PLC programs for work on his PC at home. My family has a love hate relationship with windows due to the fact we have to use windows for work and school but, prefer to have full control of our OS with Linux.
OS: Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: AMD RYZEN 5 1600
GPU 1: Radeon R7 240
GPU 2: Radeon R7 350 (GPU that I want to pass though)
Motherboard: ASRock Fatal1ty X370 GAMING X
I am considering switching the OS to fedora since he as a old copy of RedHat 5.1.
Could someone be kind enough to add me on steam at
https://steamcommunity.com/id/LeviTheBold and walk through the process with me?
I personally cant help much besides saying use the search
Hello all! I am Gray from GrayWolfTech. I make videos on Linux and other interesting technology. Wendell has given me permission to post my written guides here for my videos. This is great for two reasons: First it helps grow this community and second my videos reach a wider audience to share what I have learned. I look forward to posting all my guides and videos here, and I am more than happy to answer any questions about the guide you may have.
– Onward! –
Now it’s time for one of the coolest and more advanced capabilities of Linux. KVM, or kernel virtual machines. We are going to go through step by step, how to setup PCI pass-through to a Windows virtual machine on a Debian host to play games!
Thanks to Redhat, KVM can run virtual machines with almost bare metal performance and supports a wide variety of other neat features. The one we are going to focus on in this video is of course, PCI pass-through. The process of allowing a virtual machine full access to a PCI express graphics card for gaming, CAD, or 3D rendering. With this neat capability, you can run Linux as your host OS, and then pass your GPU (or one of your GPUs if you have multiple) to a virtual machine to play games.
Let’s go over the requirements for this project:
First and most important, you should backup any data you have on your PC. If you know what you are doing then you will not lose anything, but accidentally selecting the wrong drive when installing can lead you to be very sad when you figure out the drive you wiped had all your really good porn on it.
Second, this process will take time. For someone who is an experienced Linux user it should take about 20 minutes (not counting time to install Debian or recompile the kernel). For someone who is new it might take longer. Make sure you allow yourself an entire afternoon or a good chunk of 4-5 hours where you could potentially not have a working PC.
Third, follow the instructions I lay out in the video. I will answer questions down belo…
Tested using Fedora (tips (red)hat)
Here’s what I do, starting with a fresh install with compatible hardware and bios settings.
I’m laying out this document as I have personally prepared it for my own personal use if I ever needed to quickly reset the PC to a fully functional PCI-passthrough machine with a very functional Linux host that I use for daily computing + office work. I took pieces here and there (from the interwebs, this forum, etc). For me, it works, 100% of the time. Thanks for all of those involved in making this possible!
Set Repositories/Install RPM Fusion + Installing Software + Installing Sound/Video
su -c 'dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'
sudo dnf install vlc audacity pdfshuffler evince firefox gimp libreoffice openshot obs-studio filezilla p7zip-gui.x86_64 mediawriter.x86_64 simple-scan unrar vim htop nethogs screenfetch lm_sensors.x86_64 hddtemp gnome-terminal-nautilus wine @virtualization
*also check for visual studio code online
sudo dnf install gstreamer1-libav gstreamer1-plugins-good gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer-ffmpeg gstreamer-plugins-good gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-plugins-bad-free gstreamer-plugins-bad-nonfree
sudo dnf install clalsadrv.x86_64 alsa-firmware.noarch alsa-lib.x86_64 alsa-utils.x86_64 alsamixergui.x86_64
sudo modprobe snd-oxygen
sudo modprobe snd-pcm-oss
sudo modprobe snd-mixer-oss
sudo modprobe snd-seq-oss
For DGX Sound Card
***Analog Surround 4.0
For Thinkpad Laptops
sudo dnf install tlp
systemctl enable tlp.service
systemctl enable tlp-sleep.service
sudo tlp start
*** Verification of IOMMU groupings if needed
for d in /sys/kernel/iommu_groups//devices/; do
DRAFT of the article for ubuntu passthrough setup from the live stream. Images are missing for right now. Any comments? A video is being edited that goes through the how-to step by step.
sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install ukuu
Use ukuu to install the latest kernel. In our case we want Kernel 4.14-rc1 because that is the latest kernel as of the time of this writing and this kernel is known to work on this hardware configuration, even though it is a pre-release kernel. This kernel, or later, is also important for AMD Ryzen or Threadripper users as it contains a number of updates for those platforms.
The update utility will often fail the first time due to the cache folders not being created automatically. Just run it again and it will work the second time.
Notice that as it updates the kernel, it also automatically runs update-grub and update-initramfs and that it complains about missing microcode. It isn’t clear if the microcode is required, but the microcode is non-free. It can be found on the internet, however.
We must also add some kernel parameters and re-run the update commands above, but that can be done later.
step 3 (optional, skip)
find microcode and copy to /var/lib/firmware
step 4 (doing the vfio stuff)
We are ready to setup a virtual machine and pass through real graphics hardware to the virtual machine. To start, we need to make sure the host platform has been configured correctly: That hardware virtualization extensions are enabled, and that the IOMMU groupings are suitable.
First, make sure that vt-d (or SVM on the amd platform) is enabled in the UEFI. This varies from platform to platform but typically Level1 Techs motherboard review cover where these options are and what the IOMMU groupings are for particular motherboards.
Most Linux distros do not enable IOMMU by default. You will need to update your grub bootloader config to support IOMMU. F…
windows xp though? That’s a bit… dangerous…
several of the guides are applicable. this one for pop os isnearly identical
The Ultimate (Same GPU) VFIO Passthrough Guide for 2019 (now notes on getting samey graphics cards working)
What are we doing? What is VFIO/Passthrough?
If you are an absolute newbie – all the hub-ubb is about being able to run Linux as your primary OS, with a Windows virtual machine running under Linux for everything else.
The key aspect here, though, is that you are running a computer with two graphics cards and full control over one graphics card is given to the Windows virtual machine.
That means you can run games and GPU-accelerated apps (like the Adobe creative suite) just like they were running on a full computer, but in a virtual machine.
Windows in a VM gives you great flexibility for backups, snapshots and versioning. It gives you better control over your privacy and what the operating system might be doing and it means that Windows only runs on your computer when you have to.
I’ve been running VFIO for about 10 years and I have found that I rarely even need Windows for much of anything in my personal computation needs these days (even for gaming).
Still, there is some usefulness in having the ‘security blanket’ of being able to get to your old Windows install exactly as it was before you switched operating systems without having to reboot.
The System (76)
For this guide, we are using Pop!_OS from System76 as our Linux distro of choice. I got to borrow Eric Raymond’s new computer, a monster 32-core Threadripper 2990WX system and, for this guide, it is equipped with dual Nvidia RTX 2080s from Gigabyte (Eric ultimately gets a WX7100 graphics card).
This is the System76 Thelio Major r1
AMD Threadripper 2990WX
(2x) Gigabyte RTX 2080 GPUs
(4x) 16gb Dual Rank Kingston HyperX 2933 DDR4 (16-18-18-36 1T @ 2933)
Samsung SM97x 2tb NVMe
Intel 750 1.2tb NVMe (guest OS)
Arctic Cooling fans
With Lutris/DXVK and Steam on Linux – I like the idea of having the same GPU horsepower for both guest and host.
This system? It has two Gigabyte RTX…
to what you’d be doing on ubuntu.
start with ls-iommu.sh and make sure you’ve got iommu on, and everything is in appropriate groups.