PCI Passthrough | Virtual Machine Setup | Part 2
Vložit
- čas přidán 14. 04. 2019
- In this video, I am continuing the PCI Passthrough Series with Virtual Machine Setup in Part 2.
Part 1: System Configuration • PCI Passthrough | Syst...
Part 2: Making The VM
1. Customize config before starting
2. Change firmware from BIOS to UEFI
3. Setup CPU Topology
4. Install Blacklisted GPU as PCI device
Note: Nvideo cards need to do $sudo virsh edit MachineName
5. Setup Windows
6. Setup virtIO Drivers - docs.fedoraproject.org/en-US/...
7. Disable UAC
8. Debloat Win10
9. Install video drivers
Current OS
Debian KDE 10 buster .
►► Digital Downloads ➜ www.cttstore.com
►► Reddit ➜ / christitustech
►► Titus Tech Talk ➜ / titustechtalk
►► Twitch ➜ / christitustech - Věda a technologie
Part 3 would just be fantastic! Cheers Chris
Yes a looking glass part 3 would be very much appreciated, also file sharing between the VM and host would be helpful. thank you for all the great videos!
That part actually is easy, at least with Virtual Box. You simply assign a folder in the configuration and done, that folder is accessible to the virtual machine. I think that you need to jump through that hoop because in many cases people don't want the virtual machine to have access to anything for security reasons.
@@peterjansen4826 it would be convenient to have Windows and Linux share a game drive
Apparently you can use a samba share between the host and guest and with virtio it should be fast. I've tried to set it up but the connection didn't work. Must be because I'm using a bridged connection.
Another thing I'd love to see is how to set up bluetooth passthrough.
and it never happened :-( Check out Pavol Elsig (sp?) channel.. he does all of this and more
@@methanoid okay.... its sad...
Looking Glass should be done. It makes this whole thing worth the effort in the end. Good job on the vid, as a person who did this last year and fumbling through multiple videos and tutorials and forums and just headaches this is a good simple introduction to this process. Keep it coming.
I almost thought that another video wouldn't be coming. Love your videos!
I am so glad that you made these videos! I have literally gone insane because nobody was making proper tutorials for Debian + Radeon but this one was great and now i can finally enjoy retro games on my 1024x768@89hz CRT through a VM :P
Chris, I am very grateful for this video. Thanks so much! I would very, very much like to see a third video on Looking Glass if that is possible. Thanks again!
This is awesome. Got a 5700xt over Christmas so I'd love to pass that through. Can't wait to try it and yes more on looking glass
great vid man, keep up the great work
Great videos! Thank you. Yes, please add looking glass part 3. :)
Thanks Chris I am watching this video a long time after. I am on Manjaro ( so arch ). I got through part one using your video and the arch wiki. In my case I have two identical gpus. Using the Arch wiki I was able to pass through just one using bus ids rather that the card ids. I have the VM Running now setting up all tweaks, peripherals. Thanks so much your videos have been a great help.
definitely need part 3
Thank you soo much for the error 43 fix! it was killing my feeble mind.
Looking glass is great for single monitor setups. ddcutil is also super handy if your monitor controls aren't easily accessible. Setting up a keybind to switch monitor inputs or even a script to autorun when the VM is launched can be helpful too. Evdev passthrough can also be used to quickly switch inputs between the host and guest operating systems without the use of a KVM switch or manually passing through devices in virt-manager.
Looking glass vid please :-D
I use proxmox as my host and run my main OS as a VM too; not just the gaming VM. If you are using a server OS you can disable all output from the host and use all the video cards in your VMs (just ssh into the host if needed)
+1 for Looking Glass guide. There is too much misinformation regarding the topic out there and we need a single comprehensive guide. Please, you have made a great tutorial regarding setting up a GPU passthrough, Looking Glass is what makes this whole thing worth the effort and is a natural sequel to the series.
Very nice and informative video as always. Two questions though. If the setup includes 2 cpu sockets and want to use 2 cores from each socket (total 4) for the VM, how you choose that in manual cpu topology?
Also during passing through the gpu as a good practice all recommend to pass through the audio also. Isn t this usable in cases of monitors with build in speakers? What if someone wants to use pc speakers instead? How onboard sound chip going to act in a situation like this?
Thank you
greath video, Sir hope ure ok ! nice info's...
Thanks very much Chris, I've been looking forward to this. A couple of basic questions: a) is that QEMU you're using, and is VMware/VBox fine also? and b) you talked about using two monitors - is this just during the setup phase? You can have the VM on the same monitor as the host, right?
Thanks! Great video! But u did make one mistake by saying that u absolutely need two GPUs! If you're fine with serial output u can get a way using one GPU 😝
Thank you for these videos on this subject. I would like to see you do it on server house with a Dell R720 or above…..😅
i followed your instructions exactly and the GPU i wanted to isolate (AMD Rx 480) could also be isolated, but when i try to start the VM with PCI passthrough the VM stops immediately and my second monitor on which the VM should be displayed stays black. do you know what the issue could be? without pci passthrough the vm starts
Nice video. Do you have any video for a OSX virtual machine?
Have you done some benchmarks? I really would like to know how gaming performance is general?
I would like to see if it is possible to passthrough Thunderbolt 3 PCIe card to Windows VM and then connect eGPU via Thunderbolt cable and then install Nvidia or AMD drivers in VM like you normally would on a laptop with eGPU (External graphic card). If this makes GPU passthrough a little easier and straightforward to setup compared to regular GPU passthrough.
still waiting part 3 :(
When is video 3 coming out
Recent Intel CPUs can also passthrough the iGPU while the host is still using it (if you're curious search for Intel GVT-g)
@Chris Titus Tech
Chris, thanks for making the second part. A few questions.
- If you use soundcard via PCIe , a soundcard via USB or a DAC via S/PDIF , will you get sound in both the host machine and the virtual machine or do you have to pass it through and will you then only get sound in the virtual machine?
- What is the minimum of CPU cores and RAM which would work? So how many CPU cores and how much RAM does Linux need for the virtual machine and Looking Glass? I assume that Looking Glass needs very little given that it only copies frames but what about KVM? A likely scenario for people who set it up is that they have 8 cores and 16 GB. I know that 8 GB is not enough for gaming these days so I would use as much RAM as possible, preferably 14 or even 15 GB. I also wouldn't want to run games in a virtual machine with less than 6 cores and 12 threads. For many games 4 cores is fine but some recent AAA games need at least 6 cores and 12 threads.
In short, do you think that 1 core and 1-2 GB of RAM would suffice for the host system if you close all other programs?
I would like to see you do the third part. People for whom it is too technical can skip it, right? No harm there.
This all depends on your configuration, you can get sound very easily through virt-viewer (the virt manager console) while using looking-glass, this is the easiest way to pass audio from the VM to the host, however it is the least elegant and also the buggiest.
Another method is to use pulseaudio passthrough, however it requires qemu3.0 (so you might have to compile that yourself if you use ubuntu or debian or any derivative distro from them, my PDF on github covers how to do that and it is a long procedure), however it only works well for 44100Hz and 48000Hz sample rates and you can still in some extreme cases get some choppyness in the audio.
The last method works if you want high quality audio (in the higher khz range) and want the benefits of pulseaudio passthrough without doing a passthrough, that is to pass the audio through a low latency audio stream over a host-only (or rather VM isolated) network using a 2nd network card in the VM that utilizes virtio which is a paravirtualized driver for the VM which essentially gives you a 10Gbit connection between your host and VM.
The audio streaming solution i have used for a long while now is called scream and is an amazing program located on github, again my PDF covers this. You can find scream here: github.com/duncanthrax/scream
this is by far my most favorite way to pass the audio and keep audio from both linux and windows.
----
If you pass a pcie soundcard to the VM you have to follow the IOMMU rules in that it needs to be in its own group and once it is in the VM you cannot use it on the host until the VM is shut off.
for your second question, it depends on your linux environment, but you can manage with 1 core on the linux system, however it would not make the linux system feel any smooth, so 2 cores would be a minimum for the host (so you can keep 2 cores for the host while giving the VM 4 cores if you have a 6 core system or a 4 cores 8 threads sytem).
for RAM again this depends on your environment and what programs you use, remember free ram is used to speed up disk caching in linux, so having just the bare minimum would again be bad (plus opening chrome would instantly result in you running out of ram), however i have managed to get away with just 4gb at my work machine on the linux host (not that i would recommend it for a long period of time if you want to use both systems at the same time) while giving at least 6gb to the windows VM (at work i do not run games but i have a few programs which we still use that are windows only)
just keep in mind that vfio is not meant purely for games, but also as a compatibility tool, as such you can do this with at minimum a 4 core system with 8gb of ram. but for the best experience you would want at least a 6 cores 6 thread system or 4 cores 8 threads (as you will actually benefit from hyperthreading even if you leave the extra threads free to the host only, as the host will utilize the hyperthreading then) and at least 16gb ram if you plan to play games (8gb if you do not plan to play games or anything demanding)
@@HikariKnight
So for the audio you basically have two options if you want good sound without problems: a second soundcard via PCIe (unless you wouldn't mind missing the sound in Linux for a while and change the configuration all the time) or a fast networkcard to pass the sound from the host to the virtual machine if you use a device via S/PDIF. That is not great, it requires extra hardware and costs quite a lot.
Is it possible to give back a PCIe-device to the host system without rebooting?
8 GB of DDR4 definitely does not suffice for gaming but 16 GB extra (32 GB in total in your system: 16 for Linux and 16 for Windows in the virtual machine) for just PCIe-passthrough is in my opinion a bit of a waste of hardware (environment) and money. I haven't considered it yet but I see one more potential problem. Suppose that you have 2*8 GB of RAM and you would give 2 GB to your host (Linux) and 14 GB to the guest (Windows) would you then still be able to use the RAM for Windows in the virtual machine at dual rank? I think that you might get away with 12-14 GB without problems as long as it is dual rank. In Linux without anything open the RAM typically is less than 1 GB. I just looked at it: 749 MB for Manjaro.
These days some games even need at least 6 cores with simultaneous multithreading. For Far Cry 5 it is known that the slowest rendered frames take over 0.1 second if you have only 6 cores without SMT, also for the latest Intel CPU's.
I don't mind to set up a somewhat complicated software system but I would like to use it without needing extra hardware and without loosing quality. Maybe Lutris for some games and booting to Windows for others is more convenient despite the Windows update hell. ;)
How should i setup my cpu topology if i have 4c/8t and i want to assign around 60-70% of my cpu threads to the vm?
About that 'two graphics cards' thingie,
what you can do if you haven't two GPUs is using the GPU card for the VM and the motherboard GPU for the main Host (assuming you plan to just do 2D type stuff in the Linux host)
That is 2 GPUs so yeah that would work. I don't have integrated graphics so this isn't an option for me.
You said you need 2 graphics cards for this to work, can you have integrated graphics working for Linux and a more powerful graphics card for windows to play games on? Would that count as the “2 graphics card”?
Question: In what regards is the performance of the 2nd GPU needed to run the game? Just curious if it needs to be similar to like running it as a primary GPU or is it just used to display the output? Trying to understand PCI passthrough more as I attempting to convert from Windows to Linux, but I am having issues with 2 of my top 3 games i play normally on windows. 1 i have not found a way to get it to run in Linux between lutris, wine, and such... and the 2nd one was working through wine... but broke when the game updated 2 days ago and feel this passthrough method may be an answer to these 2 games I prefer to play. For example, i run a 1080ti to play on a 1440p@165hz monitor, do I need another GPU like the 1080ti or something simple like a 1050ti?
You need high performance graphics card for virtual machine.
I struggled a bit getting to win10, and when I finally launched it, it goes straight to UEFI and I can exit to BIOS in virt, but I can't find the proper boot device. I've watched a few VM setups in linux, but none address this error. Searching for errors just tells me to switch to a different device, but it just brings the UEFI menu back up.
What if i am running a legacy bios system? And yes, both my cpu and motherboard support pci passthrough; but my motherboard doesn't properly support uefi nor the uefi vbios for the graphics card, afaik. What can i do to try an passthrough that works?
As a noob let me ask a question: what are the advantages of this? Does the effort and second graphic card merits the result or is a dualboot nowadays with fast ssd better?
most motherboards don't provide full PCIe performance on any but first PCIe slot, so having uncompromised gpu performance is a bit more tricky
All those videos I see on PCI passthrough everyone is only using 40-50gb of storage but no-one ever shows if it's possible to add a physical drive as a main source of storage only for the virtual machine to be used
It is, when adding a new virtual hard drive, enter the drive path (e.g. /dev/sdb) as the custom path.
Idk if setting the bus to VirtIO helps but I did that and this works like a charm
@@impossibruh6969 thank you so much
@@ritzmat No problem mate ^^
Just keep in mind not to mount the drive on the host when the guest is running.
YES YES YES YES FUCK YES! More of this as the deadline to kill Win7 looms ever closer!
hello, Can i use gpu pass more than one vm's ?
Can it be made with a discrete NVIDIA card on a laptop? Thanks in advance
How to I pass through audio from the guest to the host?
You can have only 1 GPU if you run Linux as a headless system, right? I am working on changing my system to this kind of setup as I use Parsec or Steam Link for all my gaming.
I'm stuck on error 43 with my apu passthough. I keep repairing/installing drivers it still keeps showing ! Graphics device? I also have Red Hat QXL driver. If I remove display/video from virt manager it won't even boot up? But other videos say you want to remove thoses so that pci passthough only sees the passthough devices?
Single GPU passthrough exists now!
Anyone else having problems with blackscreens on Polaris GPUs? Can't seem to get my driver installed
It is not necessary to have 2 different cards, it is possible with two identical cards.
Can't find the answer anywhere. Can video on a motherboard be passed thru to VM? I have Nvidia graphics for GPU, so the motherboard video is going unused. Can I somehow pass it directly thru to one of my VMs?
You can pass the GPU but not the IGPU. The reason is it gets clumped together in IOMMU groups. There are some special circumstances where this doesn't apply, but generally the answer is no.
So pass your card directly or just dual boot.
they can be the same model GPU
I'm interested in a looking glass video, I'm curious to see how it works! This is something I wouldn't do, I think I would prefer my good old fashioned duel boot system. I don't mind rebooting to get native performance for my windows games that refuse to run in Linux.
Please do a looking glass video
Does the second card have to be the same manufacturer? Can you have a Nvidia card as the main and an AMD card as the pass through?
You can use any just as long as they are not the same card. Example: Intel integrated and AMD GPU. Or AMD and Nvidia or two separate series of AMD cards like I did.
@@ChrisTitusTech I am running two separate machines; one for Linux and one for Windows. Thanks for the info, Chris, now I'll have to go back and watch your two previous videos. Have you ever done a video on installing Windows in a virtual desktop? I would LOVE to consolidate my machines and use Linux as my primary OS.
@@teddraper1746 Certainly, I have an entire playlist on virtualization. Check it out and let me know if you would think I should make another video going over it. czcams.com/play/PLc7fktTRMBozdWFrn6--hqAJucYc3FFPB.html
@@ChrisTitusTech, excellent. Looks like a nice project for me on a rainy day. Can't wait to get started!
That moment when everything seems to work and is setup and you realize you bought processor without a graphic card so your hypervisor system have nothing to use as GPU :D
can anyone pass-through an nvidia video card to a linux OS?
If you CPU has integrated graphics couldn’t you passed through your one GPU?
Yes you can because that would be considered 2 GPUs. Should of phrased it differently, but you need 2 different GPUs... Integrated counts as one ;) For my setup the Ryzen 1700 doesn't have integrated, so I needed 2 physical graphics cards.
Would you to point out that if you have the VM installed directly onto an SSD block device (as in you passed through the physical block device and installed the system onto that) you need to do additional editing of the XML file to make the physical ssd appear as a thin provisioned disk so it will run TRIM instead of an actual defragmentation in the background when windows decides to automatically defragment the disks.
as obviously doing an acutal defragmentation on an SSD will hurt its overall lifespan and in worst cases can cause data corruption.
This is not an issue when storing the system in a qcow2 file or any other virtual disk image file! Only when you use the actual block device as the disk for the VM, qemu pass the block device as a traditional HDD.
Hope this is something you will cover relatively soon, as this is something people never cover (however they do suggest installing the VM directly on an SSD block device if you can).
PS: yes cover looking-glass, a lot of changes has happened lately like hotkey support and being able to only disable part of spice (for those with mouse issues when using looking-glass but want to keep all other features of spice but pass the keyboard+mouse to the VM with a software kvm), plus it is a good thing to cover in general.
I have no use for it myself, but this series would be incomplete without it.
Also I am opening a github repo containing my large document for in depth configuration of vfio (the same one i emailed you ages ago) along with the start my markdown conversion of it.
It will be named vfio-setup-docs.
Well put Hikari, I left out SSD passthrough mainly due to length of video and it adds another layer of complexity. I actually disable the QXL driver in the video and didn't have any mouse/keyboard issues after doing so. Would be nice if there was a better method though ;)
@@ChrisTitusTech yes i figured you left it out due to length, just wanted to address it for the few that might watch and use a block device.
sadly disabling the QXL driver didnt fix the mouse issue for me when i originally did it so i was stuck with a software KVM script 😅 not an issue for me though as it lets me give direct access to the mouse when needed ;D and in some games that actually helps with some oddities.
i will give disabling the QXL driver another try though with the updated looking-glass, as the software kvm switch is the only thing that prevents my 100% seamless setup from, well being 100% seamless :)
Edit: the PDF and repo is up now and i will be starting to markdownify it over easter :D
@@ChrisTitusTech small update for you chris, disabling the QXL driver does not solve mouse issues for everyone yet. it is still an issue on my system but not at work so no idea what is causing it as both systems have the same base image on the host and VM. looks like i am stuck with the software kvm switch script :)
the tutorial is good, but i can't proceed because i only have my 1660 super
How use two identical cards (first for HostOS, second for GuestOS) for GPU passthrough.
wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Using_identical_guest_and_host_GPUs
But can your GPU run Game of Thrones
Passthru also handy for Crypto Mining in a VM, virtually apart from your main system.
Not the 'best' way to mine, but if you only have one pc its better than mining on OS with unblocked access to pcieBus/drives/partitions holding your important/personal stuff.
Can u add arabic in cc.
i'm waiting for a sandy bridge xeon to ship, looking forward to shelf my pentium. i'm planning on running a few tests running windows on a linux host that mainly handles storage stuff for ssd caching but i have only one gpu... you say it's impossible but i read it CAN be done..? gitlab.com/YuriAlek/vfio
to clarify, i do have a second pcie16x slot and a random gpu to shove in but it's populated by the nvme card adapter.
Just following this excellent follow through, and I'm interested where it might go with this turn of events from Wendle? czcams.com/video/PLy1n7X2cAU/video.html
I am using windows 10 as host and guest OS is kali Linux.
My secondary gpu is NVDIA quadro p4000 . How can I use that gpu for kali in virtual box?
thanks in advance.
I think you could have done a better job with this video as you skimmed through the subject. Anyone looking to get serious with PCIe pass through should head over to level1techs.com/. Also they have a CZcams channel however be prepared to spend 4-8 hours, maybe more reading and learning how this works. The Arch linux wiki is also invaluable, search arch linux and subject like pcie pass through.
Looking Glass isn't there yet for prime time. However I would be interested in a video walking through the steps, if it is well made I suspect the developer may put it up on the website.