HOW-TO make dual-boot obsolete using XEN VGA passthrough

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

mantisghost wrote:Yes I do use Ubuntu 13.04 now. Sadly still did not made it work. Today after restating my pc the vm's no longer work as they shoul. I can start them fine but they wont appear on screen connected to radeon and connecting via VNC leaves me with white window. Nasty stuff so still workning for solution. Who knows maybe its xen 4.2 issue and I will need to go back to xen 4.1. By the way did you try to use KVM? I did heard its faster than xen. I presonally did try to make it work with KVM but it did fail (probably insufficent knowelge ^^ ).
Sorry to hear. Please note my warning at the beginning of my tutorial regarding Xen upgrade. Have you upgraded your packages in the meantime? It turns out that the same (or similar) issue with HVM guests has appeared in Xen 4.2. Open Synaptic (or use apt-get) and try to force a previous version of Xen and the other packages, for example if you use 4.2.3 try 4.2.2 (if available).

Regarding KVM, it's very tempting. I've seen reports using kvm with Nvidia cards (other than the Quadro2000 and higher cards). Here is a kvm guide: https://bbs.archlinux.org/viewtopic.php?id=162768. kvm seems to be getting the edge over Xen, so if you are willing to compile the latest (beta) kernel and other stuff and patch when needed, this seems definitely be worth the effort.

See also this https://bbs.archlinux.org/viewtopic.php ... 7#p1275017 on Xen primary passthru and booting the Windows guest straight from the hard drive.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
GizmoChicken

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by GizmoChicken »

Please accept my apologies if this is too far off topic, but....

For those of you who are using the xl toolstack with Xen 4.2, have any of you had any luck getting virt-manager to work?

In my case, although virt-manager works great with Xen 4.2 when using the xm toolstack, I've had no luck getting virt-manager to work when using the xl toolstack. Here's a link to an "incomplete" bug report that I hope to complete at some point: https://bugs.launchpad.net/ubuntu/+sour ... ug/1180281

Again, sorry to post a bit off topic. Any help would greatly appreciated.
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

GizmoChicken wrote:Please accept my apologies if this is too far off topic, but....

For those of you who are using the xl toolstack with Xen 4.2, have any of you had any luck getting virt-manager to work?

In my case, although virt-manager works great with Xen 4.2 when using the xm toolstack, I've had no luck getting virt-manager to work when using the xl toolstack. Here's a link to an "incomplete" bug report that I hope to complete at some point: https://bugs.launchpad.net/ubuntu/+sour ... ug/1180281

Again, sorry to post a bit off topic. Any help would greatly appreciated.
Haven't used the xl toostack yet, but I believe virt-manager is driven by Redhat, which is bad news as they are pushing kvm.

I use virt-manager as a vnc viewer mainly when testing domU installations, and sometimes to shutdown a badly behaving (Linux) domU. It has a nice GUI for domU configuration, but the way it stores the domU and its configuration are beyond me. The command line isn't too bad, so I won't miss it much when I migrate to Xen 4.2.

I've got scripts to start Windows, do backups, etc. Once everything works it's easy to adapt the scripts and put shortcuts on the desktop.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
mantisghost

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by mantisghost »

After lurking in the almighty internet i did find this https://bbs.archlinux.org/viewtopic.php?id=162768 it is kvm passthrough guide for arc but its writen so badly (or im just too stupid) that i dont get it at all. Still i put it here as its intresting maybe somoene will figure this guide out and remake for Mint.
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

mantisghost wrote:After lurking in the almighty internet i did find this https://bbs.archlinux.org/viewtopic.php?id=162768 it is kvm passthrough guide for arc but its writen so badly (or im just too stupid) that i dont get it at all. Still i put it here as its intresting maybe somoene will figure this guide out and remake for Mint.
So you found it too (see my links above). Yes, this is a little more advanced, compiling kernels etc. But this guy certainly knows his way around (see my previous post on that). I love his description on booting a Windows domU straight from disk using UEFI boot (see also above post).
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
mantisghost

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by mantisghost »

ah sorry im so tired and its so hot here that i did think its something else ^^. Sigh why KVM must be so complicated
Dez

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by Dez »

GizmoChicken wrote: For those of you who are using the xl toolstack with Xen 4.2, have any of you had any luck getting virt-manager to work?
I've been having the same problem and have basically given up on getting it to work at this stage.
powerhouse wrote:
Haven't used the xl toostack yet, but I believe virt-manager is driven by Redhat, which is bad news as they are pushing kvm.

I've got scripts to start Windows, do backups, etc. Once everything works it's easy to adapt the scripts and put shortcuts on the desktop.
XL does simplify things a little.

I've gone from Mint 14/Xen 4.1 to Mint 15 RC/Xen 4.2 without any real problems (aside from virt-manager).

Mint 15 RC (Cinnamon) with the kernel updated to 3.9.2 seems to be working well.
I did try 3.10.0 rc1, but had several problems and went back to 3.9.2.

Xen 4.2 did complain about a USB controller (libxl: error: libxl_pci.c:1001:libxl__device_pci_reset: The kernel doesn't support reset from sysfs for PCI device 0000:00:14.0), but this doesn't appear to affect it's functionality.

Following this: http://xenbits.xen.org/docs/4.2-testing ... cfg.5.html , the config I used (right or wrong) for a Win 8 DomU is:

name= "win8"
builder = "hvm"
memory=4096
vcpus=2
nx=0
vif=[ 'mac=00:16:3e:68:e3:01,bridge=xenbr0' ]
disk=[ 'phy:/dev/mapper/lm14-win8,hda,w' , 'phy:/dev/mapper/hdd-spaceU,hdb,w' ]
xen_platform_pci = '1'
on_poweroff='destroy'
on_reboot='restart'
on_crash='restart'
vnc=0
nographic=1
viridian=1
gfx_passthru=0
pci=[ '01:00.0', '01:00.1' , '00:14.0' , '00:1a.0' ]
pci_power_mgmt=1
localtime=1
GizmoChicken

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by GizmoChicken »

Dez wrote:
GizmoChicken wrote: For those of you who are using the xl toolstack with Xen 4.2, have any of you had any luck getting virt-manager to work?
I've been having the same problem and have basically given up on getting it to work at this stage.'
Hi Dez,

Thanks much for the reply. The problem with virt-manager seems to stem from a problem with libvirt (and/or possibly libxl). I reported the bug here: https://bugs.launchpad.net/ubuntu/+sour ... ug/1180281

If you are using Ubuntu or Mint, would you mind posting (on launchpad) in reply to the above mentioned bug report a comment stating that the bug affects you too?

Thanks much!
mukiex

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by mukiex »

Hey guys,

Just in case anyone got here on a Google search:

Sadly, it IS, in fact, a bug. It's been fixed, but it probably won't be updated in packages for a while:

http://xen.crc.id.au/bugs/view.php?id=5
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

mukiex wrote:Hey guys,

Just in case anyone got here on a Google search:

Sadly, it IS, in fact, a bug. It's been fixed, but it probably won't be updated in packages for a while:

http://xen.crc.id.au/bugs/view.php?id=5
Thanks for the link to the bug report. This bug (XSA46) affects not only Xen 4.2 but also Xen 4.1 (the version that comes with LM 13 and LM 14 used in this how-to). Until the fix (4.2.2-5 for LM 15) hits the Ubuntu / LM repositories the "Packages --> Force Version" option in Synaptic can be used to select an older, working version. See screen shots below.
Screenshot-Synaptic Package Manager .png
Screenshot-Synaptic select version.png
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
willow512

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by willow512 »

Hey all,

I've been attempting to setup a xen based virtualisation system as described by powerhouse. Using an "Asrock Z77 Extreme4", "Intel i7 3770" (non k) and "Sapphire 7870 2GB". I had various degrees of succes so far but none were complete.

I tried mint 15, as that's the latest version, with most success. I got everything running, drivers would detect the video card and when starting in safe mode report the video card by it's proper name. However, when starting windows normally the whole think would bluescreen itself to death at the moment (I presume) the drivers would activate the video card. Mumbling something about "atikmpag.sys" I tried to get around this in various ways, by installing only the drivers (not ccc), by installing different versions of the drivers. Nothing had the desired results.

Following a suggestion I read on the internet I changed the toolchain from xl to xm. Which to my surprise caused the kernel to crash during mint startup. :/ (The tool chain should be fully user space should it not? Why does it cause the kernal to crash?)

I went back to mint 14 and tried again without much luck. This time around the virtual machine refused to start with vague errors which I eventually discovered would go away by removing the passthrough options. Obviously not preferrable if you're trying to get passthrough to work.

By that time I was getting a bit weary, installed windows and went gaming. :oops:

Could you guys give me a second opinion on my hardware (To my knowledge it should work) and could you give me the exact versions of xen and mint you're using, xm or xl toolchain? I'm half thinking that I got builds with mis matched versions somewhere. Did anyone get this working with mint 15? And if so did you encounter the bluescreen and how did you slay this monster? Any suggestions would be most welcome!

Edit: Should read up fully before posting! I'll try out the force version options tonight. I already had a vague suspicion in that direction!

Kind regards
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

willow512 wrote:Hey all,

I've been attempting to setup a xen based virtualisation system as described by powerhouse. Using an "Asrock Z77 Extreme4", "Intel i7 3770" (non k) and "Sapphire 7870 2GB". I had various degrees of succes so far but none were complete.

I tried mint 15, as that's the latest version, with most success. I got everything running, drivers would detect the video card and when starting in safe mode report the video card by it's proper name. However, when starting windows normally the whole think would bluescreen itself to death at the moment (I presume) the drivers would activate the video card. Mumbling something about "atikmpag.sys" I tried to get around this in various ways, by installing only the drivers (not ccc), by installing different versions of the drivers. Nothing had the desired results.

Following a suggestion I read on the internet I changed the toolchain from xl to xm. Which to my surprise caused the kernel to crash during mint startup. :/ (The tool chain should be fully user space should it not? Why does it cause the kernal to crash?)

I went back to mint 14 and tried again without much luck. This time around the virtual machine refused to start with vague errors which I eventually discovered would go away by removing the passthrough options. Obviously not preferrable if you're trying to get passthrough to work.

By that time I was getting a bit weary, installed windows and went gaming. :oops:

Could you guys give me a second opinion on my hardware (To my knowledge it should work) and could you give me the exact versions of xen and mint you're using, xm or xl toolchain? I'm half thinking that I got builds with mis matched versions somewhere. Did anyone get this working with mint 15? And if so did you encounter the bluescreen and how did you slay this monster? Any suggestions would be most welcome!

Edit: Should read up fully before posting! I'll try out the force version options tonight. I already had a vague suspicion in that direction!

Kind regards
If the force version doesn't work (see my post above), please also check your BIOS version and read the manufacturer release notes. Some motherboard BIOS releases may not work, but I believe ASrock has fixed this in a later release.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
willow512

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by willow512 »

Will do. Thanks for the advice powerhouse! I'm suffering a harddisk crash. Everything is backed up but I just don't have the space for virtual machine experiments. :( Should be resolved soon. I'll be sure to give feedback when I know more.
willow512

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by willow512 »

Well shock... It all seems to be working!

I was a bit lazy so I didn't follow your guide to the letter this time.. I downloaded a new version of linux mint 14 from the website and installed it directly to the ssd (no LVM) I checked the xen version which was 4.1.3-3ubuntu1 that was a bit of a bummer since I had expected I'd have to change that. I still installed windows into a virtual machine and set up the drivers. Black screen! With trembling hands I switched my monitor. Lo and behold a friendly blue windows welcome screen was sitting on the other channel.

Couldn't get beyond that. My keyboard is ps2. :/ Maybe you could get that to passthrough, but I didn't see an immediate solution and I figure I need a new keyboard anyway. Once that's done we'll go see if the future is indeed as bright as this login screen seemed to suggest!

I haven't run a full update yet. I expect that mint will try to switch me to the broken version of xen, but now we know how to deal with that.

Thanks powerhouse and everyone who participated in this thread. A virtual client desktop has been a bit of a geekdream of mine for over a year now. Thanks to this thread and my new motherboard it's finally within grasp!
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

willow512 wrote:Well shock... It all seems to be working!

I was a bit lazy so I didn't follow your guide to the letter this time.. I downloaded a new version of linux mint 14 from the website and installed it directly to the ssd (no LVM) I checked the xen version which was 4.1.3-3ubuntu1 that was a bit of a bummer since I had expected I'd have to change that. I still installed windows into a virtual machine and set up the drivers. Black screen! With trembling hands I switched my monitor. Lo and behold a friendly blue windows welcome screen was sitting on the other channel.

Couldn't get beyond that. My keyboard is ps2. :/ Maybe you could get that to passthrough, but I didn't see an immediate solution and I figure I need a new keyboard anyway. Once that's done we'll go see if the future is indeed as bright as this login screen seemed to suggest!

I haven't run a full update yet. I expect that mint will try to switch me to the broken version of xen, but now we know how to deal with that.

Thanks powerhouse and everyone who participated in this thread. A virtual client desktop has been a bit of a geekdream of mine for over a year now. Thanks to this thread and my new motherboard it's finally within grasp!
Yes, that sounds good. The 4.1.3-3ubuntu1 is OK, the 4.1.3-3ubuntu1.5 is broken. You could mark the packages I mentioned and prevent upgrade (using Synaptic, there should be a "keep" or "force" option). Other packages not included in my list can be updated. You definitely ought to get a new keyboard.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Dez

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by Dez »

powerhouse wrote:The 4.1.3-3ubuntu1 is OK, the 4.1.3-3ubuntu1.5 is broken.
The latest update version of Xen 4.2 (4.2.1-0ubuntu3.2) appears to be working ok.

Has Xen 4.1 had another update recently as well?
DrHu

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by DrHu »

OK, but multiboot (ruinning anOS natively) is not the same things as virtualization oe even X-server remote connections (getting to a desktop on a host)

If someone needs a windows OS for gaming for example, or particular software requirements, the a running (non-virtual OS is a requirement)
--users must decide that for themselves

I, for example often run applications in a VM under virtualbox (in seamless mode)
--and for applications I am using that is a fine method, and prevents me needing to multiboot to the alternative OS (windows)
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

DrHu wrote:OK, but multiboot (ruinning anOS natively) is not the same things as virtualization oe even X-server remote connections (getting to a desktop on a host)

If someone needs a windows OS for gaming for example, or particular software requirements, the a running (non-virtual OS is a requirement)
--users must decide that for themselves

I, for example often run applications in a VM under virtualbox (in seamless mode)
--and for applications I am using that is a fine method, and prevents me needing to multiboot to the alternative OS (windows)
The whole point of Xen with VGA / PCI passthrough is that you really don't need to multiboot anymore. You can run Windows in a VM on a Xen/Linux machine without ever having to boot into Windows natively.

The weakest point of virtualization is graphics. VirtualBox which doesn't yet support VGA passthrough (as far as I know) will not allow the guest (VM) to directly control the graphics card. Xen and KVM, on the other hand, have the ability to hand over control of PCI devices (including the VGA) to the guest OS, so the guest OS can take direct control of the graphics card.

In short: Using the method described in this how-to gives the guest OS (e.g. Windows) about the same performance as if it was running natively on the hardware.

I'm running Windows 7 exclusively as a Xen guest and cannot complain about performance. I don't see any need to dual boot, in fact, I cannot, because my Windows 7 is installed as a virtual machine (domU) on a LVM formatted volume. And I don't want to go back to the stone age (dual boot, installing Windows from ISO image, etc.). If Windows breaks, it takes around 7 minutes to restore it from a working backup.

As much as I like VirtualBox, I don't think it compares to Xen (or even the new kid on the block: KVM). It's just not the same. Virtualbox is the perfect solution for things like Microsoft Office applications, or the occasional Windows application that doesn't need GPU power. Once you need the GPU, or any PCI device for native performance, then Xen or KVM may provide a solution (if you got the right hardware, that is).

Hope this explains it.
Last edited by powerhouse on Thu Jun 13, 2013 3:52 pm, edited 2 times in total.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by powerhouse »

Dez wrote:
powerhouse wrote:The 4.1.3-3ubuntu1 is OK, the 4.1.3-3ubuntu1.5 is broken.
The latest update version of Xen 4.2 (4.2.1-0ubuntu3.2) appears to be working ok.

Has Xen 4.1 had another update recently as well?
Do I understand you correctly that

1. You use the xm toolstack?

2. You are able to boot into Windows and it switches to the second graphics adapter?

3. Windows is using the proprietary (AMD or Nvidia) graphics driver and graphics performance is just like native (i.e. it performs as if Windows is running natively on hardware)?

If you answer all 3 questions affirmatively, I'll have to update my how-to :D .

The past few days I've been busy (moving apartments, etc.) so I didn't check for Xen 4.1 updates. Hope to be able to do that soon. I'll post the results.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
willow512

Re: HOW-TO make dual-boot obsolete using XEN VGA passthrough

Post by willow512 »

Hey, so I've been playing around with the system some more, getting thing to work just as I want them to. (Disabling the gui in dom0 and things like that) And everything seems fine sofar. But there are a few questions left.

* First of all, I noticed that the virtual machine only speaks to the graphics card when the drivers activate it. Which is after bootup, Which means that safemode and bootup questions are invisible unless you start a VNC viewer. How do you guys deal with that?

* Is there a script possible on the client to disconnect and reconnect my usb pci device? So that I could use the keyboard/mouse on dom0 when windows isn't running in domU? I understand the graphics card doesn't take kindly to that sort of treatment, but I can imagine that a USB device could handle it.

* I'd like some way of administering xen outside the command line preferrably via the web. (Being able to start windows from my phone would be an awesome party trick) Have you guys found a solution that could help?

* I have a working windows on sdb2 not wrapped in lvm, and bootable from grub is there a way I could import that thing into a VM?
Locked

Return to “Virtual Machines”