Announcement

Collapse
No announcement yet.

Xen - VGA passthrough is the way to go!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • xplosivelugnut
    replied
    Finaly an active thread on the subject!

    I've had to follow quite a trail of bread crumbs to make it this far.

    Powerhouse, a few years ago in a thread far far away you mentioned the possibility of having a single GPU and a DomU having exlusive control over it. (can't find it now, sorry)

    This is my configuration I'm stuck with. My Dom0 is supposed to be completely headless. SSH or Serial interaction only. I intend to have a single Windows DomU that will utilise the Geforce GTX 740 GPU. So far I've managed to use PCI passthough to provide an NIC to the Windows guest. I currently using VNC to manipulate the Widnows guest.

    Here's where I keep running in to dead ends. The GPU has also been passed through but it of course gets the insufficient resources error (I think it's 12?) in windows device manager.

    My last attempt at solving this problem involved preventing anything from initialising the GPU untill Windows was brought up to use it.

    I've removed the VGA arbiter from the kernel and it appears that the first thing to interact with the GPU is pciback which seizes it and the NIC. (pciback is compiled in)

    Not sure where to go from here. Grub still shows up on the screen when I reboot even though it's also being piped out the serial port. There's also a little bit of kernel code (?) that's on the screen breifly before the screen goes black. (power light remains green FWIW) I would think, once set up correctly, there'd be nothing on the screen post bios untill the Windows Dom0 started up. I was thinking of using EFI and scrapping grub altogether, though I've never done that.

    Thanks!

    Leave a comment:


  • powerhouse
    replied
    Originally posted by salvo2002 View Post
    Here is a link that explains ?Physicalizing? VMs as Desktops. It's what I am setting up. His setup uses ESXi, I'll be using Xen.

    http://thehomeserverblog.com/esxi-lab-specs/
    Looks like an interesting setup. If I didn't have old hardware lying around that still is good enough for our needs, I would have done the same. Unless I'm converting pictures (from RAW into JPEG or sometimes TIFF), or rip some video for storage on the media center, my PC is totally under-utilized. A few more VMs wouldn't harm.

    Leave a comment:


  • salvo2002
    replied
    ?Physicalizing? VMs as Desktops

    Originally posted by salvo2002 View Post
    @powerhouse

    That is exactly what I am after. I understand what this thread is about and I intend to use VGA passthrough as you've correctly interpreted. I am not worried about HDMI cable length. Blue Jeans Cable has some good info on cable length here: http://www.bluejeanscable.com/store/...hdmi-cable.htm. For USB, I bought some cat5 usb extenders and they work perfect for extending a keyboard and mouse (logitech wireless unifying) It won't support usb hdds or hubs which I don't intend to use anyways.

    Running the cables is easy, I already have a 2 inch PVC pipe running from the rack to the attic that was pre-installed when I built my home. This was my "future proofing". I have 2 x cat6 cables running to each room including the garage. I was planning on using this: http://www.snapav.com/p-1072-b-300-hdmatrix-4x4.aspx which has HDMI over cat5e/6 that supports 1080p60 (36-bit) @ 65 ft, and 1080p60 (24-bit) @ 130ft, so in case I can't run a HDMI cable I'll just use the cat6.

    I've used NX before. But for this setup I don't want to "remote in". In theory, it's the same setup as your intended purpose, just with the heads in different locations. This should be doable so to speak...

    Thanks again for all the info you've posted on VGA passthrough!
    Here is a link that explains ?Physicalizing? VMs as Desktops. It's what I am setting up. His setup uses ESXi, I'll be using Xen.

    http://thehomeserverblog.com/esxi-lab-specs/

    Leave a comment:


  • jockinator
    replied
    yes sonnet, it will work. in my setup I have 1 vga and 1 dvi plug on my monitor. my intel HD4000 is connected with VGA cable and my radeon with DVI.

    you can see a video of my working setup here :
    http://kdj0c.wordpress.com/2013/02/1...i-passthrough/

    you will see that you also need a USB switch (less expensive than KVM) to pass keyboard/mouse to VM.

    Leave a comment:


  • powerhouse
    replied
    Originally posted by sonnet View Post
    Sorry to ask, but couldn't find the answer to my question anywhere else: if I have 2 vga, but only one monitor can I passthrough one of the vga to the guest os?
    If the answer is yes, then my other question is: does the vga that gets passed to the guest os needs to be physically attached to the monitor ?
    Yes to both answers. However, it's not enough to have 2 VGA - your system (CPU, motherboard, BIOS) must support VT-d (Intel) or AMD-Vi (AMD) and it must be enabled. Also, not every VGA card plays nicely with VGA passthrough. Chances are best if you have an AMD (ATI) VGA card to pass through. for more on that, see here: http://forums.linuxmint.com/viewtopic.php?f=42&t=112013.

    Leave a comment:


  • sonnet
    replied
    Sorry to ask, but couldn't find the answer to my question anywhere else: if I have 2 vga, but only one monitor can I passthrough one of the vga to the guest os?
    If the answer is yes, then my other question is: does the vga that gets passed to the guest os needs to be physically attached to the monitor ?

    Leave a comment:


  • salvo2002
    replied
    exactly..

    @powerhouse

    That is exactly what I am after. I understand what this thread is about and I intend to use VGA passthrough as you've correctly interpreted. I am not worried about HDMI cable length. Blue Jeans Cable has some good info on cable length here: http://www.bluejeanscable.com/store/...hdmi-cable.htm. For USB, I bought some cat5 usb extenders and they work perfect for extending a keyboard and mouse (logitech wireless unifying) It won't support usb hdds or hubs which I don't intend to use anyways.

    Running the cables is easy, I already have a 2 inch PVC pipe running from the rack to the attic that was pre-installed when I built my home. This was my "future proofing". I have 2 x cat6 cables running to each room including the garage. I was planning on using this: http://www.snapav.com/p-1072-b-300-hdmatrix-4x4.aspx which has HDMI over cat5e/6 that supports 1080p60 (36-bit) @ 65 ft, and 1080p60 (24-bit) @ 130ft, so in case I can't run a HDMI cable I'll just use the cat6.

    I've used NX before. But for this setup I don't want to "remote in". In theory, it's the same setup as your intended purpose, just with the heads in different locations. This should be doable so to speak...

    Thanks again for all the info you've posted on VGA passthrough!

    Originally posted by powerhouse View Post
    @salvo2002:
    It seems that you are after something different from what this thread is about. The main idea behind VGA passthrough is to avoid dual-boot - in other words, if you were normally using Linux and sometimes MS Windows (e.g. for games that don't run under Linux), you could install a second VGA card and run Windows in a VM using this VGA card. Of course, this works only on your local desktop PC.

    Connecting remote terminals / screens / keyboard/mouse to a server PC is another story. The maximum permissible cable length for HDMI / DVI / whatever is very short, perhaps a couple of feet / 3-4m. The same goes for USB. So if the two "work stations" you like to create are one next to the other, XEN VGA passthrough is a good option. I doubt you can cover the distances from living room to garage using HDMI and USB cables, aside from the technical challenges of installing the cables.

    However, you can use Xen also in the "old-fashioned" way. Create multiple VMs for different purposes and let them run on your server. But you would connect to them via Ethernet cables using some remote thin client or low-end PC. Essentially you would run a remote desktop. Read up on X forwarding (for Linux / X windows) such as ssh -X [email protected] (IP.address.of.server meaning the VM you created under Xen, not the dom0). Also look at SPICE and NX that are more efficient protocols for that.

    Leave a comment:


  • powerhouse
    replied
    @srosato: I had a short look at your Xen HVM with VGA Passthrough installation guide - thanks for sharing. I haven't looked into the details, but do you describe primary passthrough? If not - that is if you describe secondary passthrough - I was wondering why you need to compile the kernel with pciback? Of course there are advantages to having pciback in the kernel, versus loading it as a module (see my how-to on that here: HOW-TO make dual-boot obsolete using XEN VGA passthrough). Or does it have to do with virt-manager?

    Any way, it's an interesting approach and can perhaps solve some common VGA passthrough issues, i.e. video driver blacklisting for one.

    Thanks in advance for your reply.

    Leave a comment:


  • powerhouse
    replied
    @salvo2002:

    It seems that you are after something different from what this thread is about. The main idea behind VGA passthrough is to avoid dual-boot - in other words, if you were normally using Linux and sometimes MS Windows (e.g. for games that don't run under Linux), you could install a second VGA card and run Windows in a VM using this VGA card. Of course, this works only on your local desktop PC.

    Connecting remote terminals / screens / keyboard/mouse to a server PC is another story. The maximum permissible cable length for HDMI / DVI / whatever is very short, perhaps a couple of feet / 3-4m. The same goes for USB. So if the two "work stations" you like to create are one next to the other, XEN VGA passthrough is a good option. I doubt you can cover the distances from living room to garage using HDMI and USB cables, aside from the technical challenges of installing the cables.

    However, you can use Xen also in the "old-fashioned" way. Create multiple VMs for different purposes and let them run on your server. But you would connect to them via Ethernet cables using some remote thin client or low-end PC. Essentially you would run a remote desktop. Read up on X forwarding (for Linux / X windows) such as ssh -X [email protected] (IP.address.of.server meaning the VM you created under Xen, not the dom0). Also look at SPICE and NX that are more efficient protocols for that.

    Leave a comment:


  • srosato
    replied
    Guide to setup Xen HVM with VGA Passthrough

    Well it has been one year and a half that I use that setup and it is still working very well! It has been running stable from the very beggining and I even record a 6 months uptime right now! I run Windows 7 and Linux Mint in parallel without any performance issues. I thought it would be the time for me to share my setup guide I did a while back (requires technical knowledge) in order to setup a Xen on ubuntu and use it as dom-0 to install virtual machines using VGA passthrough. I made a performance video back in the days that display Starcraft2 and Avatar HD running on the Win7 virtual machine while still being able to switch to Linux by switching cable. As of today, I no longer switch cables, I use a KVM and a keyboard shortcut and it works very well.

    The guide: https://dl.dropboxusercontent.com/u/...assthrough.pdf
    The performance video demo (it also display how slow it is using traditional virtualization with Virtualbox): http://www.youtube.com/watch?v=KNDFqIJDB-0

    Originally posted by srosato View Post
    Hi guys, sorry for the late reply, I was in the midst of trying all those experiments. It all worked! Huge success story. I am running Kubuntu 12.04 LTS 64 bits as the dom0 and I have win7 64 bits, another Kubuntu 12.04 desktop 64 bits and a ubuntu 12.04 server 64 bits on top as domUs. Win7 and Kubuntu desktop both have a graphical card assigned to them as PCI Passthrough and it works beautifully. Played Diablo 3 (explains the delay), Crysis2, Starcraft 2, all at high graphics without a single lag/crash/reboot/whatsoever in the Win7 virtual machine. So much that I made this project my end school project at my University, so I will definitely post an how to and videos on how I achieved everything. Its pretty simple in the end. Ubuntu 12.04 LTS or any variant are all now based on kernel 3.2 which has built in support for the Xen hypervisor. The only thing that was needed was to recompile the kernel in order to setup the CONFIG_XEN_PCIDEV_BACKEND built in the kernel and not as a module. I did not have any success of grabbing pci devices when using pciback as a kernel module. When this is done, you just have to fallback the PCI devices (I have given a full host controller for win7 and a usb 3.0 controller for linux). The current limitation is that you cannot dynamically assign a PCI-E (graphic card) to a running DomU, in consequence, you need at least two graphical cards (and a third one if you still want output on the Dom0, which I did) that you assign to each system. Afterwards, you unplug your monitor(s) (I have a three monitor setup and it all works super fine - after some configuration of course) and unplug usb mouse and keyboard to pass them to the other system's assigned graphical and USB ports. My next step it to setup a KVM switch that supports dual DVI-D monitors and usb keyboard and mouse (this one does exactly that) in order to switch between system using the console hotkey (see this manual).

    My hardware for doing this was of course a VT-d enabled CPU and motherboard:

    Asus P9X79, enable vt-d in the bios
    Intel Core i7 3820
    ATI Radeon HD 6850 (DomU win7)
    ATI Radeon HD 6670 (DomU kubuntu desktop)
    ATI Radeon HD 6450 (kunbutu Dom0)
    OCZ Vertex3 SSD 120GB
    24 GB RAM DDR3 1333Mhz (although this sound excessive, I've built this as a workstation since I have servers that will run headless)

    I've made this post fast, as I said, I will create an howto in the near future.

    Leave a comment:

Working...
X