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

Questions about virtualization software
Forum rules
Before you post please read how to get help
Locked
mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Tue Nov 26, 2013 11:41 am

Deleted, see post below with Update
Last edited by mbalino on Thu Nov 28, 2013 5:01 pm, edited 1 time in total.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Tue Nov 26, 2013 12:32 pm

Deleted, see post below with updates

Thanks :wink:
Last edited by mbalino on Thu Nov 28, 2013 5:02 pm, edited 1 time in total.

tigerdyr
Level 1
Level 1
Posts: 9
Joined: Fri Nov 22, 2013 6:22 am

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

Post by tigerdyr » Tue Nov 26, 2013 7:49 pm

powerhouse wrote: @tigerdyr: Thanks for your instructions on blacklisting, e.g. "blacklist=<module>,<module>".

Incidentally that blacklisting option may also be the key to solve your problem with the sound driver. Instead of blacklisting the PCI ID of your graphics card and sound module via the pciback script as described in my how-to, add this line to the end of the /etc/default/grub file:

Code: Select all

GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(<your_pci_id_1>)(<your_pci_id_2>)"
for example: GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(02:00.0)(02:00.1)"

This should hide the specified PCI devices from the radeon and snd-hda-intel drivers and allow you to use the snd-hda-intel driver for the other sound module on your motherboard.
Now I have tested it, but the problem remained that the radeon driver was loaded before pciback, so that change alone had no effect, but I suppose if pciback was built into the kernel instead of a module, then that would probably have worked.

After a little more digging around I eventually got it working by adding the pciback module to the initramfs (couldn't find any other method of prioritizing modules):

Code: Select all

echo xen-pciback passthrough=1 >> /etc/initramfs-tools/modules
update-initramfs -k all -c
Or if you don't have any need of booting into Linux with the "windows display adapter" activated, it seems simpler to just do:

Code: Select all

echo "xen-pciback passthrough=1 hide=(01:00.0)(01:00.1)" >> /etc/initramfs-tools/modules
update-initramfs -k all -c

FastRealm
Level 1
Level 1
Posts: 22
Joined: Fri May 24, 2013 2:22 am

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

Post by FastRealm » Tue Nov 26, 2013 11:44 pm

powerhouse wrote:
@tigerdyr: Thanks for your instructions on blacklisting, e.g. "blacklist=<module>,<module>".

Incidentally that blacklisting option may also be the key to solve your problem with the sound driver. Instead of blacklisting the PCI ID of your graphics card and sound module via the pciback script as described in my how-to, add this line to the end of the /etc/default/grub file:
CODE: SELECT ALL
GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(<your_pci_id_1>)(<your_pci_id_2>)"

for example: GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(02:00.0)(02:00.1)"

This should hide the specified PCI devices from the radeon and snd-hda-intel drivers and allow you to use the snd-hda-intel driver for the other sound module on your motherboard.

Now I have tested it, but the problem remained that the radeon driver was loaded before pciback, so that change alone had no effect, but I suppose if pciback was built into the kernel instead of a module, then that would probably have worked.

After a little more digging around I eventually got it working by adding the pciback module to the initramfs (couldn't find any other method of prioritizing modules):
CODE: SELECT ALL
echo xen-pciback passthrough=1 >> /etc/initramfs-tools/modules
update-initramfs -k all -c

Or if you don't have any need of booting into Linux with the "windows display adapter" activated, it seems simpler to just do:
CODE: SELECT ALL
echo "xen-pciback passthrough=1 hide=(01:00.0)(01:00.1)" >> /etc/initramfs-tools/modules
update-initramfs -k all -c


I notice it also, what i did was i build my own kernel with all the xen features then the "xen-pciback.hide" works.
But i still run the script "pciback.conf" and "pciback". if you check the /etc/init.d/pciback it actually call "pciback.conf" and check which PCI can be passthrough.
Do you have any problem running virt-manager on LM16?


@mbalino
1) My suggestion to you is instead of using LM16 to try xen, use LM14 with xen 4.1. Reason because if you follow the awesome guide here, it is sure to work. Where else if you use LM16 and 1st time for you, you are going to have a lot of problem and eventually give up, unless you're one of the lucky ones who get it work on 1st try. I never had such luck. Start from LM14, get use to it and decide if Xen really worth you time to invest or not.

2) I use intel onboard GFX, 7970 and 7850. 7970 and intel (lucid virtu) is for my win gaming, and 7850 for linux. Wanted 7970 and 7850 for win but since i can't CF it i use 7850 for linux instead. Please do get and extra soundcard. No point setting up xen and end up using windows 99% of the time coz linux go no audio, can't listen to music or watch a movie.
My reason for Xen is simple, windows is pure gaming and app where linux don't have like my sony app for my HP. Other than that i watch all my movies, googling, play song, my ZFS backup storage, file streaming, video streaming and tec.. all on linux.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Wed Nov 27, 2013 1:32 pm

Mmmhhh

I have already installed LM16 (6th time ...) I have no problem to do it one more time :lol:

Question: What is the benefits (real, for final user) to have LM16 vs LM14?
kernel features, packages updates, etc will not be available on LM14 since isnot a rolling release neither the latest one, am I right?
Question II: in LM14 can I install kde 4.11.2?

I finally have this configuration:
Samsung 840 EVO SSD 240 GB --> LM16 /boot (250 Mb) EXT2 & / (235Gb) JFS
Barracuda 2 TB --> LVM old version of LM16 (need to understand bit more of LVM :shock: :idea: ?

VGA 1st: HIS Radeon HD 7970 IceQ X2 Ghz Edition
VGA 2nd: HIS Radeon HD 7770 iCooler Ghz Edition

I thought that I can have sound in the VM without the needs for another sound card? :cry:
Last edited by mbalino on Wed Nov 27, 2013 3:30 pm, edited 1 time in total.

FastRealm
Level 1
Level 1
Posts: 22
Joined: Fri May 24, 2013 2:22 am

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

Post by FastRealm » Wed Nov 27, 2013 2:30 pm

Question: What is the benefits (real, for final user) to have LM16 vs LM14?
kernel features, packages updates, etc will not be available on LM14 since isnot a rolling release neither the latest one, am I right?
My Ans: LM16 have newer stuff, newer kernel, fix up bugs compare to LM14. But LM14 is out for sometime. Many bugs fixed and stable, where else LM16 just got an RC, still in testing phase and not very stable until final version. No doubt LM 16 is better but that doesn't mean new stuff are better than old stuff. Eg: Win 8 and Win 7.

Question II: in LM14 can I install kde 4.11.2?
My Ans: I am not a KDE user but as far as i know you can. Just ask big brother google, i'm he has answer for you.

Well i don't have Samsung EVO, but if i were you i would convert all to LVM partition, both SSD And HDD and keep one NTFS HDD to backup the LVM partition using Acronis True Image 2013. That way i don't need to reinstall every time i mess something up. i just recover the image and it is only 10 with all updates or apps that you have at that time during backup.

If you want to passthrough 7970, use it on the 2nd slot, save the 1st slot for your linux, it is much easier and hassel free. I know the 1st slot got PCI Gen 3.0 and 2nd slot got PCI Gen 2.0 but the difference is very minor unless you crossfire.

In VMware or virtual box they can emulate sound, but on xen i have never got it working so i always passthrough my soundcard. Why do you want to game on emulated sound which is slow and not so accurate when you can have the real thing which is clear and crisp?

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Thu Nov 28, 2013 11:18 am

1. Install Linux Mint Petra 16 RC partitions
Done, but since I have problem with grub installed on sda, where sda was formatted using LVM, I have to deleted all partitions & create MBR/DOS partition table (not GPT), one small 100 MB called "bootea" and one extended 1.8 TB with two Logical : 350 GB for windows guest and the rest for Data (both are not formatted)
My config:
SSD dev/sdb --> /boot (sdb1, etx2, 250MB) + / (sdb2, jfs, 240GB) + /swap (sdb3, 3GB)
HDD dev/sda --> /Bootea (sda1, ext2, 100MB), Extended Partition [ sda5, 350GB] + [sda6, 1.5TB]
I did want to give a try before install OLIVIA ...

2. Enable VT-d / IOMMU in BIOS
Done by default was activated

3. Install Xen hypervisor and utilities
Done, xen-system-amd64 version 4.3
It also installed few more packager v4.3

4. Add boot options to grub
Done --> GRUB_CMDLINE_XEN="iommu=1 dom0_mem=16384M"
sudo update-grub --> Done without any error. (in sda)

5. Reboot into the Xen hypervisor
Done. Reboot and selected "Ubuntu/GNU Linux with Xen Hypervisor activated"
Weird screen, some errors in the back like udev did not find/access or something like that, font color is green, like old 80x25 fonts. ON top of that "Linux Mint 16" and 5 dots below changing color (moving)
few seconds after I am logging in my KDE 4.11.2 with Xen activated.

6. Adjust the network settings to use a bridge
NOT DONE, followed all steps but, when I reboot it did not work, I get stuck on that screen "Linux Mint 16", and then shows a message that it could not do it, SKIP - RETRY - MANUAL were my options
I try SKIP and network did not work at all, therefore I undo the changes in /etc/network/interfaces , reboot and it was working again.

7. Create missing links
Done:
ln -s /usr/lib /usr/lib64
ln -s /usr/lib/xen-4.3 /usr/lib/xen-default
ln -s /usr/share/qemu-linaro/qemu/ /usr/share/qemu

8. Determine the PCI IDs of the devices you want to pass through to the domU (guest)
lspci | grep VGA -->
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] TAHITI [Radeon HD 7970]
02:00.0 VGA compatible controller: Advanced Micro Devices [AMD] CAPE VERDE [Radeon HD 7770]

I did first: update-usbids & update-pciids
lspci | grep USB --> Done, shows me all my USB INTEL and ASMEDIA
usb-devices --> Done, I could see my keyboard Genius GX-IMPERATOR PRO and my mouse AIVIA KRYPTON (KYE)

First ISSUE --> I could not identify them using KDE Control Center, since it did not tell me where is conected, also with lsub I can not identify them, therefore I did not include them (for now) in the pciback file

9. Create pciback.conf file
My file has:
0000:02:00.0
0000:02:00.1

10. Install and activate pciback script
Done --> Copy & Paste script named pciback to /etc/init.d, then changed chmod +x

Ran: update-rc.d pciback defaults 21 19
Second ISSUE --> It gave me some warning with regards to 21 & 19 but it added to all init.

11. Make xen-pciback module load at boot
Done, edit the /etc/modules and added xen-pciback passthrough=1
ADDITIONAL CHANGE: edit file /etc/default/xen and change TOOLSTACK=xl

12. Create the Windows 7 guest configuration file
Done --> Copy & Paste to /etc/xen/win7.cfg
ADDITIONAL CHANGE:
memory = 8196
kernel_override = "/usr/lib/xen-default/boot/hvmloader"
disk = ['/dev/mapper/os-Windows,raw,hda,rw']
device_model_override = '/usr/lib/xen-default/bin/qemu-dm'
tsc_mode = "default"


13. Create a logical volume to install Windows
Since I have issues with sda, grub & GPT that I could not resolve yet, I decided to stick with Logical Partion (for now, if I can understand LVM and grub I will try it again, I am a newbie...), therefore I have my 350GB unformatted Logical Partition /dev/sda5 for Windows Guest.

14. Copy the Windows installation DVD to disk
Not Done yet.

15. Reboot the computer into Xen
Done, reboot without problem in Xen

16. Install vncviewer and adjust xend config file
Done sudo apt-get install vncviewer & sudo apt-get install virt-manager
I installed both without a problem.

modify the /etc/xen/xend-config.sxp --> Only change that I have to make (xend-unix-server yes).

17. Verify that pciback works

I am STUCK here ...
xl pci-assignable-list --> EMPTY

I was too tired yesterday night to continue, therefore I stop here.
Following the guide, I found this (I use nano...)
sudo nano /etc/default/grub
ADD: GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(02:00.0)(02:00.1)"
sudo nano /etc/initramfs-tools/modules --> ADD xen-pciback
sudo update-initramfs -u -k all
sudo update-grub

Therefore, tonight I will continue with this Xen adventure...
By the way, few QUESTION if you can answer:
1. Why the booting screen looks so ugly (like old VGA model?)
2. Can I use LVM in the sda and grub?
My config:
SSD dev/sdb --> /boot (sdb1, etx2, 250MB) + / (sdb2, jfs, 240GB) + /swap (sdb3, 3GB)
HDD dev/sda --> /Bootea (sda1, ext2, 100MB), Extended Partition [ sda5, 350GB] + [sda6, 1.5TB]
I can deleted all sda and do it LVM but I need to install grub in /sda, if I can not I have to manually selecy the booting order everytime (it works, grub installed in sdb, but I can not choose that order in the bios, it always get back to sda first)

Thanks!!
Marcel

tigerdyr
Level 1
Level 1
Posts: 9
Joined: Fri Nov 22, 2013 6:22 am

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

Post by tigerdyr » Thu Nov 28, 2013 11:59 am

mbalino wrote: 17. Verify that pciback works[/size]
I am STUCK here ...
xl pci-assignable-list --> EMPTY

I was too tired yesterday night to continue, therefore I stop here.
Following the guide, I found this (I use nano...)
sudo nano /etc/default/grub
ADD: GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(02:00.0)(02:00.1)"
sudo nano /etc/initramfs-tools/modules --> ADD xen-pciback
sudo update-initramfs -u -k all
sudo update-grub
Have you verified that no other module has taken control of it or if pciback controls it? Check lspci -v and also check dmesg | grep pciback as that should some lines saying it grabbed hold of the two devices. Oh btw, I think one of your arguments to initramfs differs from what I did, not sure if that matters, but you could try that.

FastRealm
Level 1
Level 1
Posts: 22
Joined: Fri May 24, 2013 2:22 am

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

Post by FastRealm » Thu Nov 28, 2013 1:06 pm

Following the guide, I found this (I use nano...)
sudo nano /etc/default/grub
ADD: GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="xen-pciback.hide=(02:00.0)(02:00.1)"
sudo nano /etc/initramfs-tools/modules --> ADD xen-pciback
sudo update-initramfs -u -k all
sudo update-grub


This only works if you build your own kerner with pci-back build in, not module mode. I might be wrong but so far the custom kernel i build comes with pci-back build in.

1. Why the booting screen looks so ugly (like old VGA model?)
I notice on my machine, this happens when i use my ATI card rather than my onboard intel GFX. Something to do with the ATI driver and Linux.
If i use my ATI as the default on ubuntu, the screen will have no icons and opengl will fail, where else is i use intel GFX there is no such issue.

2. Can I use LVM in the sda and grub?
If what you mean is put /boot in LVM, the ans is no. Boot has to be in a partition outside of LVM. You only need one /boot on the main hdd where linux reside. The rest you don't need boot.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Thu Nov 28, 2013 1:52 pm

FastRealm wrote: 2. Can I use LVM in the sda and grub?
If what you mean is put /boot in LVM, the ans is no. Boot has to be in a partition outside of LVM. You only need one /boot on the main hdd where linux reside. The rest you don't need boot.
But the problem that I found is the GPT and Grub.
I had the entire sda as GPT with LVM, the sdb with LM16 (/sdb1 -> /boot & /sdb2 -> /)
Trying to install grub -> /dev/sda
gave me error el grub-bios (don't remember properly) and I could not install there.
No problem at all if I install on sdb or if I delete the P.T. and create a new one MBR/DOS
then I can install grub in sda

I am trying to understand how LVM works. The disk has to be GPT?
if yes, then I can't install on sda
Am I correct?


UPDATE:

Please correct me if I am doing something wrong:
a) gparted --> Delete the P.T. and all partitions (sda where the grub is installed)
a1) create partitions --> sda1 256MB [EFI partition], sda2 500GB, sda3 1.3TB
b) create physical volume --> pvcreate /dev/sda2 /dev/sda3
b1) to check use pvdisplay
c) create volume group "VHDG" --> vgcreate VHDG /dev/sda2 /dev/sda3
c1) to check use vgdisplay
d1) create logical volume "WinVHD" in volume group "VHDG" --> lvcreate -L 500G VHDG -n WinVHD
d2) create logical volume "LV2" in volume group "VHDG" --> lvcreate -L 100%FREE VHDG -n LV2
d3) to check lvdisplay
e) format "LV2" with btrfs --> mkfs.btrfs -L Data /dev/VHDG/LV2
e1) mkdir /mnt/DD2 & mount /dev/VHDG/LV2 /mnt/DD2

Therefore
* I have the Logical Volume LV2 in the Logical Group VHDG formatted with btrfs, named "Data" and mounted in /mnt/DD2
* I have the WinVHD, 500 GB unformated ready to be use with Xen.


UPDATE

It Totally Works !!!
Please follow my steps if someone have problems!!!
Last edited by mbalino on Fri Nov 29, 2013 1:41 pm, edited 1 time in total.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Fri Nov 29, 2013 1:03 am

Update
1. The mistake that I made --> The pciback file WAS INCOMPLETE :roll:
After C&P ALL the file, i got exactly what I have to get

2. I have to do:
sudo sed -i 's/TOOLSTACK=.*\+/TOOLSTACK="xm"/' /etc/default/xen
since running xl gave error in several lines when ran
sudo xl create /etc/xen/win7.cfg

Running xm create /etc/xen/win7.cfg worked charming
By the way I had to install qemu and libvirt (don't know why it did not install them)

NOW, I AM STUCK WITH THE FOLLOWING PROBLEM:

Whe booting my Win7 Machine after "Windows 7 is loading files" --> Error BSOD --> 0x0000005D (0x00000000FCBFBF9, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000) and I have to shut down (FORCE)

I googled the error and it is due to EXECUTION DISABLE BIT (Enable by deault and it should be enabled!!!!), so I don't know what to do.

Other isse, the X did not close (nor reboot or shut-down)
I have to do by reset button since i got the dark screen ....

Will keep trying tomorrow

UPDATE:

I found : http://xen.1045712.n5.nabble.com/64bit-Windows-Guest-Blue-Screens-on-install-td4505715.html
"Its 0x0000005D Which I think it the standard Windows Error when you try and run a 64bit OS on a 32bit CPU"
I must check that ALL the instruction set are activated in XEN, NX & PAE are critical.
Regards
Marcel

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Sat Nov 30, 2013 8:54 pm

News
Pay attention to the new system:
System: Host bolso Kernel 3.10-2-amd64 x86_64 (64 bit) Distro LinuxMint 1 debian
CPU: Single core Intel Core i7-4820K (-HT-) cache 10240 KB flags (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) bmips 7404.81
Clock Speeds: (1) 3702.406 MHz (2) 3702.406 MHz
Graphics: Card-1 Advanced Micro Devices [AMD/ATI] Tahiti XT [Radeon HD 7970]
Card-2 Advanced Micro Devices [AMD/ATI] Cape Verde XT [Radeon HD 7770 GHz Edition]
X.org 1.12.4 Res: 183x37 Gfx Data: N/A for root
Audio: Card-1 Intel C600/X79 series chipset High Definition Audio Controller driver snd_hda_intel BusID: 00:1b.0
Card-2 Advanced Micro Devices [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series] driver snd_hda_intel BusID: 01:00.1
Card-3 Advanced Micro Devices [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] driver pciback BusID: 02:00.1
Card-4 KYE Systems Corp. (Mouse Systems) driver snd-usb-audio
Sound: Advanced Linux Sound Architecture Version k3.10-2-amd64
Network: Card-1 Intel 82579V Gigabit Network Connection driver e1000e v: 2.3.2-k at port f040 BusID: 00:19.0
Card-2 Ralink corp. Device 5592 BusID: 05:00.0
Disks: HDD Total Size: 2250.5GB (0.6% used) 1: /dev/sda ST2000DM001 2000.4GB 30C
2: /dev/sdb Samsung_SSD_840 250.1GB 0C

YES, I am running LINUX MINT DEBIAN.

So far with your steps + https://wiki.debian.org/Xen + http://wiki.xen.org/wiki/Comprehensive_Xen_Debian_Wheezy_PCI_Passthrough_Tutorial

I managed to to have Windows 7 running!!!! YESS!!

BUT I CAN NOT INSTALL THE GRAPHIC DRIVER
I can see in Devices the PCI Card but AMD gave me error " Can't determine your card or OS"
when using the autodetect or and error after "Detecting System Components" when using the radeon driver

I have installed the latest GLPLV drivers

Anybody can give me your opinion/idea?
Attachments
DAM ERROR
DAM ERROR
AMD error
AMD error
updating windows 7
updating windows 7

tigerdyr
Level 1
Level 1
Posts: 9
Joined: Fri Nov 22, 2013 6:22 am

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

Post by tigerdyr » Sat Nov 30, 2013 9:22 pm

mbalino wrote:BUT I CAN NOT INSTALL THE GRAPHIC DRIVER
I can see in Devices the PCI Card but AMD gave me error " Can't determine your card or OS"
when using the autodetect or and error after "Detecting System Components" when using the radeon driver
What's that AMD autodetect stuff? I just downloaded the correct catalyst drivers for my card, installed with no problems at all.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Sun Dec 01, 2013 3:37 am

tigerdyr wrote:
mbalino wrote:BUT I CAN NOT INSTALL THE GRAPHIC DRIVER
I can see in Devices the PCI Card but AMD gave me error " Can't determine your card or OS"
when using the autodetect or and error after "Detecting System Components" when using the radeon driver
What's that AMD autodetect stuff? I just downloaded the correct catalyst drivers for my card, installed with no problems at all.

From AMD Driver page --> Catalyst software suite V13.9, 9/18/2013, 198 Mb --> Downloaded 6 times with Firefox --> This is error (attached)
BETA Version gave me the same error
Attachments
Error
Error
Starting the program
Starting the program
Running CSS 13.9
Running CSS 13.9

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Sun Dec 01, 2013 3:45 am

PCI Detected but I Can not see it anymore in the DEVICE DRIVERS
:cry: :oops:
Attachments
Device Driver
Device Driver
Untitled VIII.jpg

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Sun Dec 01, 2013 4:00 am

booting form Xen Kernel

Code: Select all

mbalino@bolso ~ $ cat /var/log/boot.log 
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Starting the hotplug events dispatcher: udevd.
[ ok ] Synthesizing the initial hotplug events...done.
[ ok ] Waiting for /dev to be fully populated...done.

[FAIL] Your system does not have the CPU extensions required to use KVM. Not doing anything. ... failed! 

[warn] btrfs root detected, so skipping root file system check. ... (warning).
[b] [info] Loading kernel module xen-pciback. [/b]
[ ok ] Setting up LVM Volume Groups...done.
INIT: Entering runlevel: 2
[ ok ] Starting Adaptive readahead daemon: preload.
[ ok ] Starting libvirt management daemon: libvirtd.
[....] Loading cpufreq kernel modules...ERROR: could not insert 'cpufreq_stats': Invalid argument
ERROR: could not insert 'cpufreq_conservative': No such device
ERROR: could not insert 'cpufreq_powersave': No such device
ERROR: could not insert 'cpufreq_userspace': No such device
done (none).
[ ok ] CPUFreq Utilities: Setting ondemand CPUFreq governor...disabled, governor not available...done.
libvirt-guests is configured not to start any guests on boot
[ ok ] Starting MDM Display Manager: mdm
mbalino@bolso ~ $ 
cat /proc/cpuinfo
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Core(TM) i7-4820K CPU @ 3.70GHz
stepping : 4
microcode : 0x416
cpu MHz : 3702.406
cache size : 10240 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm ida arat epb pln pts dtherm fsgsbase erms
bogomips : 7404.81
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
mbalino@bolso ~ $
In the Xen Kernel, there is no VMX

Booting from GENERIC KERNEL -- no FAIL in the log
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Core(TM) i7-4820K CPU @ 3.70GHz
stepping : 4
microcode : 0x416
cpu MHz : 1200.000
cache size : 10240 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips : 7404.71
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
Note that in GENERIC KERNEL, vmx presents

In Xen Kernel

Code: Select all

mbalino@bolso ~ $ sudo xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  8192     2     r-----   3821.7
W7                                           6  8192     2     -b----    297.5

Code: Select all

mbalino@bolso ~ $ sudo xm pci-list-assignable-devices
0000:02:00.0
0000:02:00.1

Code: Select all

mbalino@bolso ~ $ sudo xm info
host                   : bolso
release                : 3.10-2-amd64
version                : #1 SMP Debian 3.10.5-1 (2013-08-07)
machine                : x86_64
nr_cpus                : 8
nr_nodes               : 1
cores_per_socket       : 4
threads_per_core       : 2
cpu_mhz                : 3702
hw_caps                : bfebfbff:2c100800:00000000:00007f40:73bee3bf:00000000:00000001:00000281
virt_caps              : hvm
total_memory           : 32708
free_memory            : 15897
free_cpus              : 0
xen_major              : 4
xen_minor              : 1
xen_extra              : .4
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : unavailable
xen_commandline        : placeholder dom0_mem=8192M Something xen-pciback.hide=(02:00.0)(02:00.1) com1=9600,8n1 console=com1,vga dom0_max_vcpus=2 dom0_vcpus_pin something else
cc_compiler            : gcc version 4.7.2 (Debian 4.7.2-5) 
cc_compile_by          : waldi
cc_compile_domain      : debian.org
cc_compile_date        : Thu May  2 12:32:07 UTC 2013
xend_config_format     : 4

Code: Select all

mbalino@bolso ~ $ sudo brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.feffffffffff       yes             vif6.0
xenbr0          8000.74d02b2800ca       no              eth1

Code: Select all

lspci -v | grep -A 10 VGA
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT [Radeon HD 7970] (prog-if 00 [VGA controller])
        Subsystem: Hightech Information System Ltd. HD 7970 IceQ X²
        Flags: bus master, fast devsel, latency 0, IRQ 98
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at fbe00000 (64-bit, non-prefetchable) [size=256K]
        I/O ports at e000 [size=256]
        Expansion ROM at fbe40000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: fglrx_pci

01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series]
--
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde XT [Radeon HD 7770 GHz Edition] (prog-if 00 [VGA controller])
        Subsystem: Hightech Information System Ltd. Device 201c
        Flags: bus master, fast devsel, latency 0, IRQ 97
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Memory at fbd00000 (64-bit, non-prefetchable) [size=256K]
        I/O ports at d000 [size=256]
        Expansion ROM at fbd40000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: pciback

02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
mbalino@bolso ~ $ 

Code: Select all

 sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback

iface eth1 inet manual
auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth1

Code: Select all

mbalino@bolso ~ $ grep -v ^# /etc/xen/pciback.conf 
0000:02:00.0
0000:02:00.1
mbalino@bolso ~ $ 
Last edited by mbalino on Sun Dec 01, 2013 10:49 pm, edited 4 times in total.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Sun Dec 01, 2013 3:02 pm

I am one of the lucky M.F.S.OF.B. that have Sabertooth XT79 South Bridge E Stepping C1 !!!!
Therefore, Xen CAN NOT see properly Vt-d that is why KVM gives error at boot and Xen can not use PCI even if i updated to the lates BIOS 4502 10/25/2013 !!!!
I am trying to find HOW TO RESOLVE this hardware issue since the PC I bought a month ago and I can not change components !!!!
rainbows! :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil:

Look at this;

Booting with Normal Kernel:
System: Host: bolso Kernel 3.10-2-amd64 x86_64 (64 bit) x86_64 (64 bit) Distro LinuxMint 1 debian
Machine: Mobo: ASUSTeK model: SABERTOOTH X79 version: Rev 1.xx Bios: American Megatrends version: 4502 date: 10/25/2013
CPU: Quad core Intel Core i7-4820K CPU (-HT-MCP-) cache: 10240 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 29616.8
Clock Speeds: 1: 3700 MHz

Booting with Xen Kernel:
System: Host bolso Kernel 3.10-2-amd64 x86_64 (64 bit) Distro LinuxMint 1 debian
CPU: Single core Intel Core i7-4820K (-HT-) cache 10240 KB flags (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) bmips 7404.81 NO VMX
Clock SGraphics: Card-1 Advanced Micro Devices [AMD/ATI] Tahiti XT [Radeon HD 7970]
Card-2 Advanced Micro Devices [AMD/ATI] Cape Verde XT [Radeon HD 7770 GHz Edition]
X.org 1.12.4 Res: 183x37 Gfx Data: N/A for root peeds: (1) 3702.406 MHz (2) 3702.406 MHz

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Mon Dec 02, 2013 1:25 am

Please help ..
Last edited by mbalino on Mon Dec 02, 2013 1:39 am, edited 1 time in total.

mbalino
Level 2
Level 2
Posts: 52
Joined: Sat Nov 23, 2013 11:02 pm

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

Post by mbalino » Mon Dec 02, 2013 1:38 am

Well people, I am in a road-block .

If I boot in Xen-4.3:

Code: Select all

mbalino@bolso /etc/xen $ cat /sys/hypervisor/properties/capabilities
xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
mbalino@bolso /etc/xen $ egrep -c '(vmx|svm)' /proc/cpuinfo
0

Code: Select all

 mbalino@bolso /etc/xen $ sudo inxi -Fx
System:    Host: bolso Kernel: 3.11-2-amd64 x86_64 (64 bit, gcc: 4.8.1) Desktop: N/A Distro: LinuxMint 1 debian
Machine:   Mobo: ASUSTeK model: SABERTOOTH X79 version: Rev 1.xx serial: 130309290900345
           Bios: American Megatrends version: 4502 date: 10/15/2013
CPU:       Quad core Intel Core i7-4820K CPU (-HT-MCP-) cache: 10240 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) bmips: 29619.2 
           Clock Speeds: 1: 3702.402 MHz 2: 3702.402 MHz 3: 3702.402 MHz 4: 3702.402 MHz 5: 3702.402 MHz 6: 3702.402 MHz 7: 3702.402 MHz 8: 3702.402 MHz
Graphics:  Card-1: Advanced Micro Devices [AMD/ATI] Tahiti XT [Radeon HD 7970] bus-ID: 01:00.0 
           Card-2: Advanced Micro Devices [AMD/ATI] Cape Verde XT [Radeon HD 7770 GHz Edition] bus-ID: 02:00.0 
           X.org: 1.14.3 driver: fglrx tty size: 194x47 Advanced Data: N/A for root 
Info:      Processes: 278 Uptime: 4 min Memory: 1179.5/31571.7MB Runlevel: 2 Gcc sys: 4.8.2 Client: Shell (sudo) inxi: 1.9.14 

PLEASE NOTE THAT VMX IS NOT SHOWED !!!

mbalino@bolso /etc/xen $ sudo xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 32221     8     r-----    440.5
mbalino@bolso /etc/xen $ 

Code: Select all

mbalino@bolso /etc/xen $ sudo xm info
host                   : bolso                                                                                                                                                                    
release                : 3.11-2-amd64                                                                                                                                                             
version                : #1 SMP Debian 3.11.8-1 (2013-11-13)                                                                                                                                      
machine                : x86_64                                                                                                                                                                   
nr_cpus                : 8                                                                                                                                                                        
nr_nodes               : 1                                                                                                                                                                        
cores_per_socket       : 4                                                                                                                                                                        
threads_per_core       : 2
cpu_mhz                : 3702
hw_caps                : bfebfbff:2c100800:00000000:00007f00:77bee3bf:00000000:00000001:00000281
virt_caps              : hvm
total_memory           : 32707
free_memory            : 128
free_cpus              : 0
xen_major              : 4
xen_minor              : 3
xen_extra              : .0
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : 
xen_commandline        : placeholder
cc_compiler            : gcc (Debian 4.8.2-1) 4.8.2
cc_compile_by          : waldi
cc_compile_domain      : debian.org
cc_compile_date        : Thu Oct 17 22:59:27 UTC 2013
xend_config_format     : 4

If I boot in Generic Kernel:

Code: Select all

mbalino@bolso /etc/xen $ sudo cat /sys/hypervisor/properties/capabilities
cat: /sys/hypervisor/properties/capabilities: No such file or directory
mbalino@bolso /etc/xen $ 
mbalino@bolso /etc/xen $ egrep -c '(vmx|svm)' /proc/cpuinfo
8                                                                                                                                                                                                 

NOTE THAT NOW, THERE ARE 8 CPUs VMX CAPABLE

Code: Select all

mbalino@bolso /etc/xen $ sudo inxi -Fx
System:    Host: bolso Kernel: 3.11-2-amd64 x86_64 (64 bit, gcc: 4.8.1) Desktop: N/A Distro: LinuxMint 1 debian
CPU:       Quad core Intel Core i7-4820K CPU (-HT-MCP-) cache: 10240 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 29618.6 
           Clock Speeds: 1: 1200.00 MHz 2: 3701.00 MHz 3: 1200.00 MHz 4: 1200.00 MHz 5: 1200.00 MHz 6: 1200.00 MHz 7: 1200.00 MHz 8: 1200.00 MHz
...
mbalino@bolso /etc/xen $ 

NOTE THAT VMX SHOWS UP & THE CLOCK OF CPUs !!!

Code: Select all

mbalino@bolso /etc/xen $ sudo xm list
ERROR:  Can't find hypervisor information in sysfs!
mbalino@bolso /etc/xen $ 

Code: Select all

mbalino@bolso /etc/xen $ sudo xm info
ERROR:  Can't find hypervisor information in sysfs!
mbalino@bolso /etc/xen $
I don't know what the hell is happening !!!

BIOS: LATEST .... should not be problems with Vt-d/x

FastRealm
Level 1
Level 1
Posts: 22
Joined: Fri May 24, 2013 2:22 am

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

Post by FastRealm » Mon Dec 02, 2013 11:23 am

Relax buddy,
Let's go back to the basic.
1) You are using X79 chipset with Intel Core i7-4820K. Both VTd and VTx capable.
2) 2 graphic cards. ATI 7970 and ATI 7770. You want to passthrough ATI 7770.
3) Using Linux Mint Debian and not Linux Mint or any of the Ubuntu variant
4) I assume you got Xen4.3 installl with all PCI passthrough working.
5) Now can you boot into Xen 4.3 without problem?

Locked

Return to “Virtualization”