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
Kabion

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

Post by Kabion »

Hello again,
Here is a list of my USB controllers and usb devices
The 06:00.0 - 2 is from my usb pci card I added. Also these no longer show up in my usb-devices after I assigned them to the pciback.

Code: Select all

lspci | grep USB
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
06:00.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
06:00.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
06:00.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)

 usb-devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 2
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1a.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 6
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=8008 Rev=00.05
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 2
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1d.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 8
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=8000 Rev=00.05
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh=14
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic xhci_hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=01 Prnt=01 Port=12 Cnt=01 Dev#=  3 Spd=480 MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0608 Rev=07.02
S:  Product=USB2.0 Hub
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=02 Prnt=03 Port=02 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=046d ProdID=c52b Rev=12.01
S:  Manufacturer=Logitech
S:  Product=USB Receiver
C:  #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=98mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=04 Lev=02 Prnt=03 Port=03 Cnt=02 Dev#=  5 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=046d ProdID=c52f Rev=22.00
S:  Manufacturer=Logitech
S:  Product=USB Receiver
C:  #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=98mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=04 Lev=01 Prnt=01 Port=08 Cnt=02 Dev#=  2 Spd=480 MxCh= 4
D:  Ver= 2.10 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=174c ProdID=2074 Rev=01.00
S:  Manufacturer=ASRock
S:  Product=ASM107x
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:  If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub

T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 6
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic xhci_hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=05 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  2 Spd=5000 MxCh= 4
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=174c ProdID=3074 Rev=01.00
S:  Manufacturer=ASRock
S:  Product=ASM107x
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=8mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
I plan on redoing the whole system this was more of a trial run.. I need to put the guest system on the SSD.
my windows scores with 3 cores and 8g of ram was
7.3 cpu, 7.8 ram, 7.9 on both graphics, and 5.9 on hd
I'd have to say everything was successful.

Just for reference my system specs:
i5 4670 cpu + Hyper 212 Evo cpu cooler
ASROCK Z87 extreme 4 MB
16 G G.Skill 1600 ram
240 Gig seagate SSD
EVGA 8800 GTS 512 for linux (was from my old pc)
Sapphire AMD 7870 Ghz ed. for Windows
750W Thermaltake toughpower PSU
mbalino

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

Post by mbalino »

Good news everyone!!!!

From ASUS DEPARTMENT:

"Hi Marcel, to get back to your previous enquiry/feedback for Vt-d issues, according to our Product Manager, the new BIOS will have that function included.
The new BIOS will be released around the end of the DEC. 2013"

This BIOS will correct the UEFI problem for the Vt-d in the IVY Bridge chipset X79 (TUF Sabertooth)

Regards
Marcel
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 »

mbalino wrote:Good news everyone!!!!

From ASUS DEPARTMENT:

"Hi Marcel, to get back to your previous enquiry/feedback for Vt-d issues, according to our Product Manager, the new BIOS will have that function included.
The new BIOS will be released around the end of the DEC. 2013"

This BIOS will correct the UEFI problem for the Vt-d in the IVY Bridge chipset X79 (TUF Sabertooth)

Regards
Marcel
That sounds promising. Asus MUST test VT-d with PCI passthrough, else it's useless. For a test setup they need either Linux with Xen or KVM, or alternatively VMWare ESX/ESXi with VMDirectPath I/O pass-through (see also here about VT-d enabled motherboards https://communities.vmware.com/thread/401594).

EDIT: I think I found something: http://rog.asus.com/forum/showthread.ph ... R4E-boards !!! Read the entire thread, specifically also this http://rog.asus.com/forum/showthread.ph ... post350690 and what follows.

EDIT 2: I just noticed that you already posted there.

P.S.: Can you PM me your contact as Asus. I like to check some things about BIOS support for VT-d using a 3930K Sandybridge-E CPU on the Asus Sabertooth X79. The mods in the above forum claim that newer BIOS releases do support VT-d, I need to check before I update.
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 »

Kabion wrote:Hello again,
Here is a list of my USB controllers and usb devices
The 06:00.0 - 2 is from my usb pci card I added. Also these no longer show up in my usb-devices after I assigned them to the pciback.

Code: Select all

lspci | grep USB
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
06:00.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
06:00.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
06:00.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)

 usb-devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 2
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1a.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 6
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=8008 Rev=00.05
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 2
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1d.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 8
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=8000 Rev=00.05
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh=14
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic xhci_hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=01 Prnt=01 Port=12 Cnt=01 Dev#=  3 Spd=480 MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0608 Rev=07.02
S:  Product=USB2.0 Hub
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=02 Prnt=03 Port=02 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=046d ProdID=c52b Rev=12.01
S:  Manufacturer=Logitech
S:  Product=USB Receiver
C:  #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=98mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=04 Lev=02 Prnt=03 Port=03 Cnt=02 Dev#=  5 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=046d ProdID=c52f Rev=22.00
S:  Manufacturer=Logitech
S:  Product=USB Receiver
C:  #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=98mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=04 Lev=01 Prnt=01 Port=08 Cnt=02 Dev#=  2 Spd=480 MxCh= 4
D:  Ver= 2.10 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=174c ProdID=2074 Rev=01.00
S:  Manufacturer=ASRock
S:  Product=ASM107x
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:  If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub

T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 6
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=03.11
S:  Manufacturer=Linux 3.11.0-12-generic xhci_hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=05 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  2 Spd=5000 MxCh= 4
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=174c ProdID=3074 Rev=01.00
S:  Manufacturer=ASRock
S:  Product=ASM107x
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=8mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
I plan on redoing the whole system this was more of a trial run.. I need to put the guest system on the SSD.
my windows scores with 3 cores and 8g of ram was
7.3 cpu, 7.8 ram, 7.9 on both graphics, and 5.9 on hd
I'd have to say everything was successful.

Just for reference my system specs:
i5 4670 cpu + Hyper 212 Evo cpu cooler
ASROCK Z87 extreme 4 MB
16 G G.Skill 1600 ram
240 Gig seagate SSD
EVGA 8800 GTS 512 for linux (was from my old pc)
Sapphire AMD 7870 Ghz ed. for Windows
750W Thermaltake toughpower PSU
That's weird. lspci clearly shows your USB controllers, whereas usb-devices misses most of them: bus 3 is missing ???, and what about all the other PCI IDs that lspci gave?

I seem to remember that I also saw some strange phenomenas when adding a SATA/USB controller, and that I had to play with hardware setups. Sometimes moving a PCI card to a different slot may help. I also remember that I changed a BIOS setting with regard to the PCI standards / autodetect. You could try that too and see if the PCI devices become visible under usb-devices. Sorry I can't be of much help here.

Thanks for your WEI results - they look good!

If you have a bare metal Windows install as well (dual-boot), would you be able to run Passmark on both bare metal and under the Windows VM? If not, could you at least share the Passmark results of your Windows VM? Please post here: http://forums.linuxmint.com/viewtopic.p ... 5&t=153482.

I'm having a hard time getting people to understand that Xen with VGA passthrough can really replace dual-boot :D .
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
mbalino

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

Post by mbalino »

Sent the PM

Please confirm that received, I don;t know why but it is showing in my outbox ... (like not been sent)
Marcel
powerhouse wrote:
mbalino wrote:Good news everyone!!!!

From ASUS DEPARTMENT:

"Hi Marcel, to get back to your previous enquiry/feedback for Vt-d issues, according to our Product Manager, the new BIOS will have that function included.
The new BIOS will be released around the end of the DEC. 2013"

This BIOS will correct the UEFI problem for the Vt-d in the IVY Bridge chipset X79 (TUF Sabertooth)

Regards
Marcel
That sounds promising. Asus MUST test VT-d with PCI passthrough, else it's useless. For a test setup they need either Linux with Xen or KVM, or alternatively VMWare ESX/ESXi with VMDirectPath I/O pass-through (see also here about VT-d enabled motherboards https://communities.vmware.com/thread/401594).

EDIT: I think I found something: http://rog.asus.com/forum/showthread.ph ... R4E-boards !!! Read the entire thread, specifically also this http://rog.asus.com/forum/showthread.ph ... post350690 and what follows.

EDIT 2: I just noticed that you already posted there.

P.S.: Can you PM me your contact as Asus. I like to check some things about BIOS support for VT-d using a 3930K Sandybridge-E CPU on the Asus Sabertooth X79. The mods in the above forum claim that newer BIOS releases do support VT-d, I need to check before I update.
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 »

@mbalino: done
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 »

Here a short update: After installing and running LM16 with Xen 4.3 and xm on an external USB drive for a while, I decided to install it on my rig. I'm now running LM16 Mate and it works just fine.

I think the boot time is a little shorter too. Need to see if and how I can shorten the how-to. Yet, I don't plan to delete the LM13 and LM14 stuff. I may place it in a separate post and link to it.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Nesousx

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

Post by Nesousx »

Hi powerhouse,

Can you give me the xen* package version number please? Have you tried xl toolstack as well?
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 »

Nesousx wrote:Hi powerhouse,

Can you give me the xen* package version number please? Have you tried xl toolstack as well?
Xen: 4.3.0-1ubuntu1.2

No, I tried only xm.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Jess1981

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

Post by Jess1981 »

First of all I wanted to say thank you for this amazing guide. I was not able to get this working a year ago, but today best Christmas gift ever is that everything runs great. The only issue that sometimes happens is my HDMI audio not working, but so far my system is stable. I have posted pictures of my WEI and Passmark scores below. I also ran a 22GB 1080p blu-ray movie for encoding down to 720p which is the max for my Tv. The conversion on Handbrake took about 34 minutes and avg 108fps. The file size once it was complete is about 2GB.

My system is currently running LM16 Cinnamon and Xen 4.3 with kernel 3.12.6. My hardware info is in the sig and I have 6 cores/8GB(1866Mhz) of ram passed to win7. Win7 is using catalyst driver 13.12 while Mint is using Mesa 10.0 from git. The fglrx drivers gave me error 22s when trying to start win7, so Mint will stay open source.

Again thank you so much and Happy Holidays to everyone.
NHiX

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

Post by NHiX »

Thanks for your amazing guide !
I try it with my CentOS with many changes :)

But, i have a question, for USB and almost for logitech hardware like G510, G13 or/and G600 with my Dom0 Windows
If i try to passthru my USB Controller to my Dom0 for logitech drivers
Install on my Dom0, Synergy in server mode
After, install Synergy in client mode on my DomU
Do you think that's work ?
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 »

NHiX wrote:Thanks for your amazing guide !
I try it with my CentOS with many changes :)

But, i have a question, for USB and almost for logitech hardware like G510, G13 or/and G600 with my Dom0 Windows
If i try to passthru my USB Controller to my Dom0 for logitech drivers
Install on my Dom0, Synergy in server mode
After, install Synergy in client mode on my DomU
Do you think that's work ?
1. You may want to search the Internet for CentOS specific instructions. But in general, it should work similar to my how-to.

2. I'm a bit confused. dom0 (your CentOS) doesn't need passthrough to handle USB or other devices with hardware drivers. You can passthrough USB devices to your Windows (domU) guest, but then only Windows can use them.

If I understand you correctly, you are asking how to use synergy? See point 8 and this post: http://forums.linuxmint.com/viewtopic.p ... 80#p706770. You install synergy onto your Centos as server (server configuration), and in Windows as client (download the Windows version). For more information check the Synergy documentation: http://synergy-foss.org/help/.

I haven't used synergy for a while as I use a KVM USB switch and pass through some USB controllers to the Windows domU for mouse, keyboard, and various other devices I'm using. But you should definitely try out Synergy.
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 »

Jess1981 wrote:First of all I wanted to say thank you for this amazing guide. I was not able to get this working a year ago, but today best Christmas gift ever is that everything runs great. The only issue that sometimes happens is my HDMI audio not working, but so far my system is stable. I have posted pictures of my WEI and Passmark scores below. I also ran a 22GB 1080p blu-ray movie for encoding down to 720p which is the max for my Tv. The conversion on Handbrake took about 34 minutes and avg 108fps. The file size once it was complete is about 2GB.

My system is currently running LM16 Cinnamon and Xen 4.3 with kernel 3.12.6. My hardware info is in the sig and I have 6 cores/8GB(1866Mhz) of ram passed to win7. Win7 is using catalyst driver 13.12 while Mint is using Mesa 10.0 from git. The fglrx drivers gave me error 22s when trying to start win7, so Mint will stay open source.

Again thank you so much and Happy Holidays to everyone.
Thanks for posting the benchmark results! Could I ask you for some more details?

1. Hardware specs:
Motherboard (exact model)
BIOS release
CPU (exact model)
Primary GPU
Secondary (passed through) GPU
Which Windows version (7, 8, 8.1 ?)

2. I opened a separate benchmark thread to show off VGA passthrough to the "unbelievers" :) . Can you repost your benchmarks to the following thread: http://forums.linuxmint.com/viewtopic.p ... 5&t=153482.

Enjoy the holidays!
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 »

Just finished ironing out some issues with my new LM16 installation, such as Samba share (every time, but EVERY time I forget to issue a samba password) and remote desktop (installed xrdp, but forgot to install a VNC server - go figure?!).

I did some simple performance tests within the Windows 7 domU, copying files between different drives/folders/shares:

1. Create a 5 GByte file using:

Code: Select all

fallocate -l 5G testimg.img
2. SSD: copy a 5 GByte file from a Samba share on the Linux host (dom0) to a folder in the Windows VM: ~400 MByte per second. Both files reside on the same SSD, on different LVM volumes.
test 1.png
3. Copy a 5 Gbyte file from a Windows folder residing on SSD to a Windows folder on HDD (striped LVM setup with 2 2TB WD green drives): ~170 Mbyte per second
test2.png
Remarks: Except for a tiny /boot partition on /dev/sda1, I use LVM everywhere. Both Linux host (/ and /home) and the Windows VM disk images are on LVM (see the how-to, win7.cfg file). I'm also using the latest stable GPLPV drivers! The SSD is a Sandisk Extreme 120GB drive.

Considering the generally poor performance of WD green drives (yes, these are the slow 5,600 rpm ones), I can't complain about the disk read/write speed when using two drives in striped mode. Performance is similar to a RAID0 setup, IMHO.

Some people claim better performance with KVM and VFIO on the latest kernel 3.12, but I have never compared it and I don't believe I can get much more out of my hardware. See https://bbs.archlinux.org/viewtopic.php?id=162768.

In short - I'm one happy fellow with this setup :D .
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Jess1981

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

Post by Jess1981 »

Thanks for posting the benchmark results! Could I ask you for some more details?

1. Hardware specs:
Motherboard (exact model)
BIOS release
CPU (exact model)
Primary GPU
Secondary (passed through) GPU
Which Windows version (7, 8, 8.1 ?)

2. I opened a separate benchmark thread to show off VGA passthrough to the "unbelievers" :) . Can you repost your benchmarks to the following thread: http://forums.linuxmint.com/viewtopic.p ... 5&t=153482.

Enjoy the holidays!
1. Motherboard : ASrock 970 Extreme3 R2.0 Bios Ver 1.3
CPU: FX-8350 @ 4GHZ
Primary GPU: Radeon HD 6450
Secondary GPU: Sapphire Radeon HD 6950
Windows: Windows 7 64-bit Pro SP1

2. Reposted the benchmarks. Cheers.
NHiX

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

Post by NHiX »

Hello

I have a big problem with my UEFI BIOS...
I can start Linux Mint 16, without problem, but don't start with Xen, on my screen I can see 3 lines only, and stop :(
I try with ubuntu 13.10, same error :/
with option in grub "nomodeset" my X is broken :/


If you can help me, please :)
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 »

NHiX wrote:Hello

I have a big problem with my UEFI BIOS...
I can start Linux Mint 16, without problem, but don't start with Xen, on my screen I can see 3 lines only, and stop :(
I try with ubuntu 13.10, same error :/
with option in grub "nomodeset" my X is broken :/


If you can help me, please :)
My advise: stay clear of UEFI !!!!! There is absolutely no reason to use it. Go into the motherboard BIOS and disable UEFI boot, or choose legacy boot or whatever it's called in the BIOS. Most if not all boards will still support legacy boot.

I don't remember when UEFI boot was introduced in Xen, but it wasn't too long ago (actually, I'm not even sure it was). Xen 4.3 may not include the UEFI patch. Even if the current kernel/Xen release support UEFI, it's best to avoid it!

UEFI is one of these ideas that sound great in the beginning (and on paper), but in the end it's half-baked implementation, vendor-centric features (secure boot for example), and lack of interest by the open source community have left it in a pretty bad shape in the Linux/Xen etc. world.

Anyway, the very first thing to check is to see if the current version of Xen (4.3) actually supports UEFI boot.

If you absolutely must have UEFI boot, check the following thread and the links in the first post for help on UEFI: http://forums.linuxmint.com/viewtopic.php?f=46&t=97221. Perhaps there is a way to chain-load Xen? But I don't know. Good luck!

P.S.: If the suggestions don't work, please open a separate thread and post a link to it here.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
NotYetRated

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

Post by NotYetRated »

Thanks so much for the guide! I got it up and running on my system in no time. I will post benchmarks as you request tomorrow, as I have not run them yet. But I can say that performance is incredible. Cannot tell the difference from a standard system.

I have 2 Windows VM's each with passed through graphics cards, and each one can game as I please.

I have a question though, a couple really.

1. What method is suggested for backup?
2. WHat is the best way to do VM installs. On same drive as Domu?
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 »

NotYetRated wrote:Thanks so much for the guide! I got it up and running on my system in no time. I will post benchmarks as you request tomorrow, as I have not run them yet. But I can say that performance is incredible. Cannot tell the difference from a standard system.

I have 2 Windows VM's each with passed through graphics cards, and each one can game as I please.

I have a question though, a couple really.

1. What method is suggested for backup?
2. WHat is the best way to do VM installs. On same drive as Domu?
Welcome to the club! Wow, with 2 graphics cards passed to different Windows VMs you got yourself a two-seat gaming rig - that's cool!!! Would you mind to share your hardware specs, both out of my curiosity and in order to share "Xen VGA passthrough certified" motherboard, CPU, and graphics cards for reference. Please also include the current BIOS version you run on your motherboard.

Now to your questions:

1. What method is suggested for backup?

You need to back up two things: Linux Mint (dom0) and your Windows VMs. I am assuming that you followed my guide to the point and that you have created LVM volumes for everything but the /boot partition. If yes, you can use the scripts below - after you make the necessary changes to make them work in your environment !!!.

Warning: Use the scripts below with great caution !!! If not modified to your needs, or used incorrectly, they can wipe all your data !!! Use at your own risk! I won't take any responsibility whatsoever.
That sounds frightening - well it should. Before running any of the scripts, change the variables / directories / LVs etc. to match your setup. For a "dry run", create test/dummy files in the backup directory and echo out the command lines that contain a "dd" command ! See what it does.

A. Simple backup script for domUs:

Code: Select all

#!/bin/sh
mv /media/backup/guest-win7.img /media/backup/guest-win7.img.old
lvcreate --size 10G --snapshot -n win7-snap /dev/guest/win7
echo Creating backup copy of win7 domU...
pv /dev/guest/win7-snap | dd of=/media/backup/guest-win7.img
lvremove -f /dev/guest/win7-snap
echo Finished
See my post here: http://forums.linuxmint.com/viewtopic.p ... 13#p647303.

The above script first moves (renames) a file named guest-win7.img to guest-win7.img.old (to keep a second backup copy).
Then it creates a snapshot volume with 10G spare space (you can reduce that to 1G if your guest is NOT running) named "win7-snap" of LVM volume /dev/guest/win7 where "guest" is the name of your volume group (VG), and "win7" the name of your Windows VM volume (LV).
"pv" is just a pipe that shows some progress indicator. The script is using the "dd" command to make an uncompressed bit-by-bit copy of your VM into an image file named guest-win7.img that should reside on separate disk mounted to /media/backup.In other words, you need to create the mount point /media/backup (sudo mkdir /media/backup) and mount your backup drive to that mount point.
Once the backup is finished it will remove the win7-snap snapshot LV.
Note: Don't run your Windows VM while running a backup on it ! With Windows creating a zillion files while running you would backup Windows in a running state that may or may not be bootable. The snapshot feature of LVM actually freezes the VM the moment you create the snapshot. Any changes to the file system after creating the snapshot will be written to a special reserved space that you defined with the --size 10G option. Of course, you must have some spare room on your VG (volume group - in this example it's "guest") to create the snapshot.

Example: I use a 120GB SSD for both the Linux dom0 and the Windows domU. Windows takes ~70GB, Linux / ~15GB, and ~24GB for /home, the /boot partition (the only real non-LVM partition) takes 1GB. This adds up to 110GB, giving me 10GB spare space to create the snapshot LV. Of course the snapshot can reside on any drive or partition that belongs to the "guest" VG used in my example.

You can modify the script to run it twice for 2 different VMs you have, for example using

Code: Select all

for i in win7a win7b
do
mv /media/backup/guest-${i}.img /media/backup/guest-${i}.img.old
lvcreate --size 10G --snapshot -n ${i}-snap /dev/guest/${i}
echo Creating backup copy of $i domU...
pv /dev/guest/${i}-snap | dd of=/media/backup/guest-${i}.img
lvremove -f /dev/guest/${i}-snap
echo Finished
done
In the above example I used two LVM volumes win7a and win7b for the two Windows VMs.


B. A little more advanced script to backup the domU (VM) into a compressed .gz file, running on multiple cores using pigz:
EDIT: I modified the script as follows:
dev="/dev/mapper/backup"
to
dev="/dev/mapper/backup-guests"


The /dev/mapper/... uses the following convention: /dev/mapper/VG-LV

The example below uses VG=backup and LV=guests

Code: Select all

#!/bin/sh

# Backup script for a virtual machine using RAW storage on a LVM volume

mt="/media/backup"					# mount point of backup drive
dev="/dev/mapper/backup-guests"		# backup volume or drive to mount (in this case it's a LVM volume)
group="vm"						# LVM group holding guest LV
guest="win7"						# LV name of guest

# See if $mt is already mounted, if not, mount it
if (mount | grep -q "$mt"); then
	mtd="yes"
else
	mtd="no"
	mkdir "$mt"
	mount "$dev" "$mt"
	if (mount | grep -q "$mt"); then
		echo
	else
		echo "Unable to mount $mt"
		exit 2
	fi
fi

sleep 2

# Get the size of the guest VM
size=`lvs --noheadings --units=b -o lv_size /dev/$group/$guest | cut -d'B' -f1`

# Make sure the backup volume is big enough to hold the backup.
# This test assumes uncompressed backup and isn't scientifically correct.
# If you are short on backup space but sure you got enough space for
# a backup, you can remove the following if...else..fi section.
if [ $size -gt `du -sb "$mt" | awk '{print $1}'` ]; then
	echo "Not enough space on backup volume ! Abort"
	exit 2
else
	echo
fi

# Move the existing backup file to ...old (and overwrite the ...old file)
mv "$mt"/$group-$guest.img.gz "$mt"/$group-$guest.img.gz.old

# Create a snapshot of the guest VM
lvcreate --size 10G --snapshot -n $guest-snap /dev/$group/$guest

# Backup guest VM
echo "Creating backup copy of $group-$guest..."
echo
dd if=/dev/$group/$guest-snap bs=1024k | pv -s $size | pigz -c > "$mt"/$group-$guest.img.gz

# Remove snapshot
lvremove -f /dev/$group/$guest-snap
sleep 2

# Unless $mtd flag is 'yes', unmount $mt
if [ "$mtd" = "yes" ]; then
	echo
else
	umount -l "$mt"
	rmdir "$mt"
	echo "$mt unmounted"
fi

C. Here is the VM restore script that goes with script B. above:
EDIT: I modified the script as follows:
dev="/dev/mapper/backup"
to
dev="/dev/mapper/backup-guests"


The /dev/mapper/... uses the following convention: /dev/mapper/VG-LV

The example below uses VG=backup and LV=guests

Code: Select all

#!/bin/sh

mt="/media/backup"					# mount point of backup drive
dev="/dev/mapper/backup-guests"		# backup volume or device to mount
group="vm"						# LVM group holding guest LV
guest="win7"						# LV name of guest

echo
echo "This script will restore a VM from your last backup image"
echo "and overwrite your current VM installation."
echo
echo "All data in your current VM will be lost!"
echo
read -p "Are you sure you want to RESTORE your VM from your backup copy (y/n)?" choice

case "$choice" in 
  y|Y ) echo ;
	# See if $mt is already mounted, if not, mount it.

	if (mount | grep -q "$mt"); then
		mtd="yes"
	else
		mtd="no"
		mkdir "$mt"
		mount "$dev" "$mt"
		if (mount | grep -q "$mt"); then
			echo
		else
			echo "Unable to mount $mt"
			exit 2
		fi
	fi

	sleep 2

	echo "Restore $group-$guest from backup..."

	pv "$mt"/$group-$guest.img.gz | pigz -d | dd of=/dev/$group/$guest bs=1024k

	# Unless $mtd flag is 'yes', unmount $mt

	sleep 2

	if [ "$mtd" = "yes" ]; then
		echo
	else
		umount -l "$mt"
		rmdir "$mt"
		echo "$mt unmounted"
	fi

	echo "Done";
	exit 0;;
  n|N ) echo ;
	echo "no...exiting restore script"
	exit 1;;
  * ) echo ;
	echo "invalid answer...exiting restore script"
	exit 1;;
esac
Again, modify to your needs !


D. As for your Linux Mint backup, you can modify any of the above backup scripts to meet your need. I use the following command to backup my / (root) LV:

Code: Select all

tar -cpf - --exclude=/media/backup/proc/* --exclude=/media/backup/mnt/* --exclude=/media/backup/sys/* --exclude=/media/backup/dev/*  --exclude=/media/backup/media/* /media/backup | pv -s $(du -sb /media/backup | awk '{print $1}') | pigz > $mt/lm16-root.tgz
Again, you need to adopt it. I had to restore my dom0 only once and it worked - you uncompress and untar the .gz backup file to the respective LVM volume.

Another approach - perhaps more straightforward - would be to dd your entire physical disk (or dd combined with compression into a compressed image file).

Important: When backing up your running Linux dom0, you must use a "snapshot". See above scripts and explanations.

(Note: You actually don't need to take a snapshot of the LV containing the Windows VM when it's not running. But it's a good safety precaution.)

Hope this is useful.
Last edited by powerhouse on Fri Jan 03, 2014 6:45 am, edited 1 time 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 »

NotYetRated wrote:...
1. What method is suggested for backup?
2. WHat is the best way to do VM installs. On same drive as Domu?
1. In addition to my long answer above, you may also check out the "luckyBackup" package. I use it for synchronizing and/or backing up the data on my main computer (the Xen machine) to my networked media PC via Gigabit LAN. It takes a little to get used to it, but once you configured your backup stratagem it works nicely. Ah, I use luckyBackup with ssh to connect to remote PCs. However, for your Windows VMs there is nothing that beats the simplicity of a simple dd (A or B above), or script C using compression. My machine compresses and backs up a 70GB Windows VM in ~6 minutes. To restore Windows from a backup takes even less, ~5 minutes.
Advice: After your Windows installation and applying all the updates etc., make a "golden" backup copy and keep it in a safe place. If you ever run into serious problems (virus or other malware, or just a screwed up system), you can always go back to that golden copy, even if your regular backups were infected too.

2. It depends on what hardware you are using. I'm running both Linux dom0 and my Windows VM on a SSD, so there is little performance hit when running two OS at the same time on the same drive. If you use regular HDDs for your domUs (VMs), it's better to have the domUs on separate drives for performance reasons. Of course, I take for granted that you run both domUs at the same time.

I am contemplating on writing a LVM how-to, not a guide on how to install it, but how to use it. I've managed to learn quite a bit by making some stupid beginner mistakes. For example, use VGs sparingly! Don't create different VGs for everything you can think about. BUT, use a different VG for your backup drives/partitions.

If you use one VG for your dom0, domUs, and all data drives/partitions, you can easily allocate or reallocate disk resources as needed. DON'T allocate all disk space (PV) to your OS, VMs or data LVs - keep some spare disk (PV) resources. For example, if you have a 1TB drive but need only 200GB now for various LVs, allocate around 400-500GB to them (if you know the data will grow, else much less) and keep the rest unused.

LVM allows you to assign hardware (PV) to specific LVs, so you can make sure that Windows VM #1 runs on one drive, whereas Windows VM #2 runs on another physical drive.

If you need RAID 0 like performance, use two disks with stripe (also an LVM function). BUT, don't run 2 VMs on the same striped LV. If you have only 2 HDDs for VMs, use them in the regular fashion with LVM and have each VM forced to use one physical disk. Here is some more on LVM: http://www.howtogeek.com/howto/40702/ho ... in-ubuntu/ and http://www.centos.org/docs/5/html/5.1/C ... index.html.

LVM also provides a RAID 1 like backup option, mirroring all data to another disk.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Locked

Return to “Virtual Machines”