tag:blogger.com,1999:blog-4503882914271431046.post6805850380120123509..comments2023-07-05T16:48:11.153+03:00Comments on Tavi's thought: VGA passthrough with KVM on Fedora 16Tavihttp://www.blogger.com/profile/12625987236761170260noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-4503882914271431046.post-79448894873245660112012-12-12T19:00:18.034+02:002012-12-12T19:00:18.034+02:00You can and run as many VMs as you want as long as...You can and run as many VMs as you want as long as you have enough system resources for all of them + physical machine and you don't have 2 VMs that try to access th same passthrugh hardware.Tavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-45237115915094215242012-12-09T09:43:42.493+02:002012-12-09T09:43:42.493+02:00Question - does the vga passthrough only allow one...Question - does the vga passthrough only allow one active vm? So if I wanted to run win7 and linux vms at the same time I could not do this? Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-80052614978179374542012-10-29T23:22:37.814+02:002012-10-29T23:22:37.814+02:00Network speed is not a problem anymore, I've d...Network speed is not a problem anymore, I've done just that ;)Tavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-42349888070831184332012-10-29T16:29:11.370+02:002012-10-29T16:29:11.370+02:00Also, in regards to the OP's mention of Networ...Also, in regards to the OP's mention of Network speed, try just using a bridged connection. I'm getting full duplex GB without issue.<br />Just setup a bridge to wherever and add the device as "shared device" to your guest.Benjamin Selingerhttps://www.blogger.com/profile/00544628955249190595noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-73300129623087472702012-10-29T16:27:26.245+02:002012-10-29T16:27:26.245+02:00Nvidia is unsupported except for Quadro cards. I&...Nvidia is unsupported except for Quadro cards. I've never got one to work with KVM though with a tonne of work and many angry all-nighters, I've got an 8800gts working poorly under Xen.<br />I gave up for now and bought an ATI card for this purpose. Any ATI card 6xxx or lower will work with KVM very easily with no special configuration. KVM has an issue with rebooting guests attached to 7xxx series cards (host crashes with kernel bug at drivers/pci/ats.c:62, but I'm working on this).<br /><br />7xxx series cards work perfect with Xen 4.1 and later, Xen's just a little scattered right now so it takes some work to setup. All you REALLY need to know is that with Xen, you must use the "xen-pciback" driver to bind your card to Xen guest. This can be done by adding "xen-pciback.passthrough=1 xen-pciback.hide=(01:00.0)(01:00.1)" to the XEN kernel at boot. Note, this is not the same as adding to your regular kernel command line. Xen has a special Dom0 kernel that is also added to grub.<br /><br />I'm doing some experimenting right now but once I'm done I'll have writeups for several cards on both Xen and KVM, and possibly some .deb packages to automate things.Benjamin Selingerhttps://www.blogger.com/profile/00544628955249190595noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-4321032176669939592012-10-27T13:17:50.050+03:002012-10-27T13:17:50.050+03:00omg. Okay I think I'll do a real write up on ...omg. Okay I think I'll do a real write up on this shortly.<br /><br />Long short, KVM works with most ATI cards pretty well, out of the box with Ubuntu/Debian/Mint/whatever (At the time of this writing, I'm running Mint13 - Cinnamon).<br /><br />Login as root:<br />sudo su -<br />#You'll definitely need this.<br />apt-get install virt-manager<br /><br />#May need this. I needed it for one card but not for another.<br />echo "options kvm allow_unsafe_assigned_interrupts=1" > /etc/modprobe.d/kvm.conf<br /><br />#Most definitely need this.<br />echo "pci-stub" >> /etc/modules<br />#And this.<br />usermod -a -G libvirtd yourusername #Replace with your username.<br /><br />Then, really, all you have to do is startup virt-manager, create a new guest (I've used Win7/8 both successfully), shut down the guest and add your PCI device via the virt-manager interface.<br />There are a TONNE of old instructions on the Internets and most of them are massively outdated. There really isn't any more to this than what I've just mentioned.<br /><br />There are of course some caveats. Some systems may require you to append "iommu=pt iommu=1" to your grub command line like so:<br /><br />nano /etc/default/grub<br />#find the line that says GRUB_CMDLINE_LINUX="" and make it look like this:<br />GRUB_CMDLINE_LINUX="iommu=pt iommu=1"<br /><br />I do not need that line with my system (Sabertooth 990fx, AMD 8120fx 8core)<br /><br />My Radeon 67xx worked perfect. My RadeonHD 9800 works, but when the guest reboots, the host crashes.<br /><br />Long short, older ATI cards seem to work very well with very little configuration. Benjamin Selingerhttps://www.blogger.com/profile/00544628955249190595noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-90536062413879821612012-10-20T06:35:30.329+03:002012-10-20T06:35:30.329+03:00hello, i also have been experimenting with kvm and...hello, i also have been experimenting with kvm and vga passthrough, i was able to get my 7870 sapphire card working http://thread.gmane.org/gmane.comp.emulators.kvm.devel/94524<br /><br />but i suffer from bluescreens on the reboot of the vm, do you also have this issue or could this be my videocard?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-6269968459534664702012-10-19T18:53:14.848+03:002012-10-19T18:53:14.848+03:00Append blacklist radeon to /etc/modprobe.d/blackli...Append blacklist radeon to /etc/modprobe.d/blacklist.confTavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-8384170659244214872012-10-18T20:29:21.017+03:002012-10-18T20:29:21.017+03:00Could you expand on point 6 please - how do you bl...Could you expand on point 6 please - how do you blacklist the video card?https://www.blogger.com/profile/18408439413981267545noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-27997399462222826542012-08-30T15:56:09.210+03:002012-08-30T15:56:09.210+03:00What about dmesg | grep -e DMAR -e IOMMU ? It has ...What about dmesg | grep -e DMAR -e IOMMU ? It has to show both IOMMU and DMAR stuff. What OS do you use? Grub2 or Grub legacy?<br /><br />Can you try the following things:<br />- put Intel Integrated video as primary in the UEFI<br />- uninstall or blacklist and unload any driver for the nvidia card<br />- now try to boot the vm with the nvidia card attached<br /><br />It's very strange that the log is empty, it should always record something, at least the startup command for the vm. If you boot the vm without any video card attached, does the log contain something?<br /><br />The easy way to passthrough the video card to a vm is to have a secondary video card just for the vm, and a primary (like the intel integrated one that should be more than enough for day to day activities) for the base OS. But you could also try to use the same video card for the base OS and the vm, that's a little more difficult to setup because you have to unbind it from the OS first and then pass it to the vm.<br /><br />XEN might work better with nvidia cards than KVM<br />http://wiki.xen.org/wiki/Xen_VGA_PassthroughTavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-78465116828850077052012-08-30T14:53:38.604+03:002012-08-30T14:53:38.604+03:00Yes, my monitor was connected to nvidia video card...Yes, my monitor was connected to nvidia video card when i tried to boot VM with those pci devices passed to it. I use nvidia GPU as primary. There also is some lame intel onboard vga card. Setting that as primary in UEFI, booting OS and trying to launch VM gave me error<br /><br />My environment:<br />CPU intel core i5 x64 (quad-core) (supports vt-x and vt-d),<br />Motherboard supports those too (since UEFI has settings to turn them on)<br /><br />rndbit-desktop ~ # kvm-ok <br />INFO: /dev/kvm exists<br />KVM acceleration can be used<br /><br />rndbit-desktop ~ # dmesg | grep IOMMU<br />[ 0.000000] Intel-IOMMU: enabled<br />[ 22.230870] vboxpci: IOMMU not found (not registered)<br /><br />VirtualBox (i have it installed) one must not be important i guess..<br /><br />VM log file (assuming it is /var/log/libvirt/qemu/WinServer2008.log, WinServer2008 is VM name ofc ) is completely empty.<br /><br />I tried to boot using on-board vga card and launch VM with attached pci devices. This is result:<br />Error starting domain: Unable to read from monitor: Connection reset by peer<br />Traceback (most recent call last):<br /> File "/usr/share/virt-manager/virtManager/asyncjob.py", line 45, in cb_wrapper<br /> callback(asyncjob, *args, **kwargs)<br /> File "/usr/share/virt-manager/virtManager/asyncjob.py", line 66, in tmpcb<br /> callback(*args, **kwargs)<br /> File "/usr/share/virt-manager/virtManager/domain.py", line 1120, in startup<br /> self._backend.create()<br /> File "/usr/lib/python2.7/dist-packages/libvirt.py", line 551, in create<br /> if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)<br />libvirtError: Unable to read from monitor: Connection reset by peer<br /><br />lspci still lists those pci devices tho.<br /><br /><br />What i should expect here? Can attached pci video card to VM still provide services to host? It would be rather unconvenient if attached pci device gets to be exclusive to VM, which then would mean i need two separate video cards, for vm and for host.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-25005091555311555252012-08-29T20:08:32.010+03:002012-08-29T20:08:32.010+03:00When you tried to boot the vm with the Nvidia card...When you tried to boot the vm with the Nvidia card, was the monitor connected to it, to the VGA/HDMI whatever of the Nvidia card?<br />Unfortunately I don't know if this will work with KVM as easy as the AMD card I use. I don't have a proper Nvidia card to test. But let's see if we can make it work ;).<br />If you could make sure IOMMU and Passthrough are fully enabled first of all (what processor do you have, Intel or Amd? ). Then if you could post the log of the vm after you try to boot it with the Nvidia card. Also in the BIOS/UEFI what's the primary graphic card? onboard or pci express?Tavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-10706195737344534052012-08-29T15:42:22.121+03:002012-08-29T15:42:22.121+03:00Hey,
I was able to set it all up to a point on lin...Hey,<br />I was able to set it all up to a point on linux mint 13. Thing is - after VM with attached vga card is booted - monitor goes black (power saving mode) and i cant see a thing. Any idea what could be causing it? I attached two pci devices:<br />01:00.0 VGA compatible controller: NVIDIA Corporation GF116 [GeForce GTX 550 Ti] (rev a1)<br />01:00.1 Audio device: NVIDIA Corporation GF116 High Definition Audio Controller (rev a1)<br />Attaching only vga caused error - complaining about 01:00.1 being in-use.<br />I also have on-board intel graphics card. Tried to boot using that - vm could not start either. Too bad i did not copy error message.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-91424911191278886952012-08-21T22:16:39.660+03:002012-08-21T22:16:39.660+03:00Teradici PCoIP would probably support the 3d graph...Teradici PCoIP would probably support the 3d graphics remotelyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-36701185267744863722012-08-21T05:15:49.246+03:002012-08-21T05:15:49.246+03:00I did not succeed with Fedora. Will try later with...I did not succeed with Fedora. Will try later with other OS/BIOS combination.<br />Maybe my VGA card is too old, so will try with my SAN HBA also.TooMeeKhttp://toomeek.waw.pl/blognoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-84654481967577658112012-08-20T01:31:53.475+03:002012-08-20T01:31:53.475+03:00I have an Intel HD3000 integrated video from the c...I have an Intel HD3000 integrated video from the cpu, and an AMD HD6770 that I pass to the VM. This machine for me is a headless VM server so when I connect a keyboard, mouse and monitor to it, I play with the VGA passthrough VM, for me each of the video cards displays something when the VM is on, the HD3000 shows the login console for Fedora, and the HD6770 shows the Windows VM desktop, games, applications. Also in the UEFI I've selected the onboard VGA (Intel HD3000) as primary VGA.Tavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-55231758673392815562012-08-17T22:13:09.316+03:002012-08-17T22:13:09.316+03:00One more question: Did You succeed with ONE VGA in...One more question: Did You succeed with ONE VGA in host system? Or used two of them? Radeon and something else, like on-board VGA?<br />Your screen should goes to black if it was single VGA.TooMeeKhttp://toomeek.waw.pl/blognoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-21054231953184660332012-08-15T21:22:36.830+03:002012-08-15T21:22:36.830+03:00Yep, CERN is CentOS clone, but it's not exacly...Yep, CERN is CentOS clone, but it's not exacly Scientific Linux, it's another distro ;)<br />So, I'm gonna try with Fedora, I have additional GF 210 card, so maybe will work as primary video and will try to assign HD4890 to VM..<br />Just tried that (unbind VGA card), however it didn't worked. My keyboard LEDs was all blinking together.TooMeeKhttp://toomeek.waw.pl/blognoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-51656741834995857822012-08-13T22:06:33.964+03:002012-08-13T22:06:33.964+03:00TooMeeK, I'm not familiar with Scientific Linu...TooMeeK, I'm not familiar with Scientific Linux, it's a RHEL/CentOS clone right? I'd guess first of all you should try something newer if you can, 2.6.32 is old, for me switching from Fedora 16 (kernel 3.3.0) to Fedora 17 (kernel 3.3.4 + updated programs) solved the last few bugs I had. Also make sure there isn't anything that uses or owns the video card before you try to attach it to the VM, especially the video card driver.Tavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-10983577504783377562012-08-13T02:21:54.025+03:002012-08-13T02:21:54.025+03:00Cool, You did it.
Some time ago I've tried wit...Cool, You did it.<br />Some time ago I've tried with HD 4890 and failed..<br />Any advices?<br />http://toomeek.waw.pl/blog/?p=764<br /><br />I see You've also redirected video to external monitor.. ?<br />For best networking performance You need something like PC-over-IP protocol, or very good video codec for VNC.<br /><br />ps. Google redirected me to Your YT video :DTooMeeKhttp://toomeek.waw.pl/blognoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-60508780447951904402012-07-20T21:51:39.228+03:002012-07-20T21:51:39.228+03:00Thanks for sharing this info!
I'm really inte...Thanks for sharing this info!<br /><br />I'm really interested in how it works for you on Ubuntu 12.04. I've seen other Fedora reports with Xen but never with KVM. I thought the KVM team dropped VGA passthrough in favor of Spice, which is something altogether different.<br /><br />Good luck!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-70097146098891354232012-07-04T10:01:58.868+03:002012-07-04T10:01:58.868+03:00Nice tuto. Gonna try this one in the coming days w...Nice tuto. Gonna try this one in the coming days with an nvidia. Always dreamed to get better perfs in a VM.<br /><br />Btw, if you wanna do remote gaming, give a try to http://www.splashtop.com/home Using it for months to play from my android tablet and this remote control application is really really awesome for gaming or video streamingAnonymoushttps://www.blogger.com/profile/00551286458815706528noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-82820103784788455962012-06-08T18:32:49.346+03:002012-06-08T18:32:49.346+03:00Great job!
I have an Evga SR-2 board with dual CP...Great job!<br /><br />I have an Evga SR-2 board with dual CPUs (24 cores), 2 Radeon 6990 (4 GPUs), 3 Dell U3011 displays, obscene amounts of RAM and disk...<br /><br />I have been waiting for an opportunity to turn this into a Linux box (Ubuntu) with KVM + VGA Passthrough so that I can do development in near-enough native speeds.<br /><br />I'll be among the first ones to try out your configs and benchmarks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-62802195833484211512012-05-09T00:27:34.497+03:002012-05-09T00:27:34.497+03:00Hi, I have been quite busy with school (i'm a ...Hi, I have been quite busy with school (i'm a 1st year undergraduate Computer Science) and as souch I haven't had enough time to try a lot of games, but in my case old games like AOE III, Halo CE, they had no problem running in the vm, I did try to play Battlefield 3, although it started fine, it got stucked in a loop at the beginig of single player.<br /><br />Performance wise, the Heaven benchmark fps from the vm with ATI HD6770 are a bit higher than what I got when I first tested Windows 7 native, but that was marginal and I think is due to newer drivers.<br /><br />I do plan to do a lot more testing and a proper benchmark, native Win7 gaming vs KVM and/or Xen VM VGA Passthrough gaming with more games on Fedora 17 and/or Ubuntu 12.04 host in about 4-5 weeks from now.Tavihttps://www.blogger.com/profile/12625987236761170260noreply@blogger.comtag:blogger.com,1999:blog-4503882914271431046.post-19326873030633341622012-05-06T10:44:15.970+03:002012-05-06T10:44:15.970+03:00Hello,
Great post! Thanks very much for providing...Hello,<br />Great post! Thanks very much for providing this information. I've setup a similar config, except with an AMD Phenom X6 and ASUS M5A99X EVO. <br /><br />Unfortunately I have a performance problem as of the two games I've tried testing on:<br /> * 'killing floor' is far slower and jerky compared to non virtualised. <br /> * L4D2 crashes before getting to the game menu.<br /><br />IOMMU is definitely working, as the passed through card gives me DVI out, and I'm able to play killing floor at very low settings, but passing through either my HD6850 or HD6450 gives no difference in performance.<br /><br />I also get a bunch of IRQ MSI messages in the /var/log/messages. Do you get anything similar?<br /><br />Cheers, Evan.Evan Fraserhttps://www.blogger.com/profile/02227307753735935497noreply@blogger.com