Overclock.net › Forums › Software, Programming and Coding › Operating Systems › {Guide} Create a Gaming Virtual Machine
New Posts  All Forums:Forum Nav:

{Guide} Create a Gaming Virtual Machine - Page 12

post #111 of 816
Quote:
Originally Posted by wTheOnew View Post

Once you've hidden the nVidia card with pciback from dom0 it'll be like it's not even there. No drivers will get loaded for it or anything. The Win7 domU will have direct control over it using Windows drivers. So it shouldn't be a problem.

Thanks for your reply!

The trouble is hiding the damn PCI device (VGA). My Linux Mint edition (LM13 Maya Mate 64bit) doesn't have xen-pciback compiled into the kernel. So I tried different ways of loading the nodule at boot, with no success (it's loaded, but way after the nouveaux Nvidia driver takes control).

Here is what I tried:

1. Put xen-pciback.hide=... in grub.conf as boot parameter
2. Put xen-pciback into /etc/modules.cfg to load
3. Installed xen-pciback into the initram file system
4. Tried insmod and modprobe in /boot/grub.cfg to load the module before the nouveaux driver

No matter what I do the nouveaux Nvidia driver is loaded and the VGA card is bound to dom0. I also can't remove the device from the PCI port once it's assigned to the nouveaux driver.

The PCI parameters are correct as per lspci.

Here is the /boot/grub.cfg file:
grub.cfg (Click to show)
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod lvm
insmod part_msdos
insmod ext2
set root='(lm13-root)'
search --no-floppy --fs-uuid --set=root f9e21c53-7594-4d48-a8fe-64e7912cbe6a
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
set locale_dir=($root)/grub/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 13 MATE 64-bit, 3.2.0-27-generic (/dev/sda1)' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
linux /vmlinuz-3.2.0-27-generic root=/dev/mapper/lm13-root ro quiet splash $vt_handoff
initrd /initrd.img-3.2.0-27-generic
}
menuentry 'Linux Mint 13 MATE 64-bit, 3.2.0-27-generic (/dev/sda1) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
echo 'Loading Linux 3.2.0-27-generic ...'
linux /vmlinuz-3.2.0-27-generic root=/dev/mapper/lm13-root ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.2.0-27-generic
}
submenu "Previous Linux versions" {
menuentry 'Linux Mint 13 MATE 64-bit, 3.2.0-23-generic (/dev/sda1)' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
linux /vmlinuz-3.2.0-23-generic root=/dev/mapper/lm13-root ro quiet splash $vt_handoff
initrd /initrd.img-3.2.0-23-generic
}
menuentry 'Linux Mint 13 MATE 64-bit, 3.2.0-23-generic (/dev/sda1) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
echo 'Loading Linux 3.2.0-23-generic ...'
linux /vmlinuz-3.2.0-23-generic root=/dev/mapper/lm13-root ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.2.0-23-generic
}
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_linux_xen ###
submenu "Xen 4.1-amd64" {
menuentry 'LinuxMint GNU/Linux, with Xen 4.1-amd64 and Linux 3.2.0-27-generic' --class linuxmint --class gnu-linux --class gnu --class os --class xen {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
echo 'Loading Xen 4.1-amd64 ...'
multiboot /xen-4.1-amd64.gz placeholder iommu=1 iommu=pass-through dom0_mem=2048M xen-pciback.hide=(01:00.0)(01:00.1)
echo 'Loading Linux 3.2.0-27-generic ...'
module /vmlinuz-3.2.0-27-generic placeholder root=/dev/mapper/lm13-root ro quiet splash
echo 'Loading initial ramdisk ...'
module /initrd.img-3.2.0-27-generic
}
menuentry 'LinuxMint GNU/Linux, with Xen 4.1-amd64 and Linux 3.2.0-27-generic (recovery mode)' --class linuxmint --class gnu-linux --class gnu --class os --class xen {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
echo 'Loading Xen 4.1-amd64 ...'
multiboot /xen-4.1-amd64.gz placeholder iommu=1 iommu=pass-through dom0_mem=2048M xen-pciback.hide=(01:00.0)(01:00.1)
echo 'Loading Linux 3.2.0-27-generic ...'
module /vmlinuz-3.2.0-27-generic placeholder root=/dev/mapper/lm13-root ro single
echo 'Loading initial ramdisk ...'
module /initrd.img-3.2.0-27-generic
}
menuentry 'LinuxMint GNU/Linux, with Xen 4.1-amd64 and Linux 3.2.0-23-generic' --class linuxmint --class gnu-linux --class gnu --class os --class xen {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
echo 'Loading Xen 4.1-amd64 ...'
multiboot /xen-4.1-amd64.gz placeholder iommu=1 iommu=pass-through dom0_mem=2048M xen-pciback.hide=(01:00.0)(01:00.1)
echo 'Loading Linux 3.2.0-23-generic ...'
module /vmlinuz-3.2.0-23-generic placeholder root=/dev/mapper/lm13-root ro quiet splash
echo 'Loading initial ramdisk ...'
module /initrd.img-3.2.0-23-generic
}
menuentry 'LinuxMint GNU/Linux, with Xen 4.1-amd64 and Linux 3.2.0-23-generic (recovery mode)' --class linuxmint --class gnu-linux --class gnu --class os --class xen {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
echo 'Loading Xen 4.1-amd64 ...'
multiboot /xen-4.1-amd64.gz placeholder iommu=1 iommu=pass-through dom0_mem=2048M xen-pciback.hide=(01:00.0)(01:00.1)
echo 'Loading Linux 3.2.0-23-generic ...'
module /vmlinuz-3.2.0-23-generic placeholder root=/dev/mapper/lm13-root ro single
echo 'Loading initial ramdisk ...'
module /initrd.img-3.2.0-23-generic
}
}
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 6e90997b-fe9a-4bd9-b34d-ae5bf1e1792b
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Edited by powerhouse - 8/29/12 at 11:45pm
post #112 of 816
Hi powerhouse,

i had to compile the kernel to get pciback running (fedora 16/17). It didnt work for me at all as module, but after i compiled it into the kernel all is fine.
running a win7, xp and even a 98SE as hvm nearly without a problem. only radeon drivers glitch on my 2nd monitor sometimes.
post #113 of 816
I made it ! (Well, almost - I need a second DVI cable.)

Bought a cheapo AMD 6450 graphics card, installed it in the first VGA slot and moved my Nvidia Quadro 600 into the second slot.

Now I can use Linux Mint on dom0 and Windows 7 on domU each using its own graphics card.

Will write more once everything is cleaned up.

Thanks for all your help and encouragement!
post #114 of 816
I was celebrating too soon :-(

I bought a cheap AMD 6450 to be used for dom0, in the hope I can get my Nvidia Quadro 600 card to work with passthrough.

Boot dom0, able to detach the Nvidia card and attach it to pciback. Start the domU via virt-manager, installation of Win7 went fine.

Win7 recognizes the Nvidia card and shows it in the device manager. I installed the latest Nvidia driver (305.93), but no matter what I did to the win7.cfg file under /etc/xen, it wouldn't activate the card (error 43 in Windows - yellow triangle in device manager).

Next I replaced the Windows Nvidia driver to version 275.89 (latest 275.x driver) but it's just the same.

Then I added the "passthrough=1" option to the /etc/module "xen-pciback" line to use passthrough instead of vpci (see http://wiki.xen.org/wiki/Xen_PCI_Passthrough). After rebooting my PC I got to the graphical user login, entered credentials and the computer froze with a black screen and the cursor in the middle - only hard reset helped (ssh didn't work as well).

So right now the domU gets a different (virtual) PCI ID, as I'm using vpci.

Can anyone who made this VGA/PCI passthrough work let me know if vpci works too? Run
Code:
dmesg | grep pciback

Look at the first line of the output and let me know if you see vpci or pass.

Any suggestions? Do I need to compile Xen with patches to make it work, or even compile a new kernel?

Can anyone with an Nvidia card share his/her /etc/xen/win7.sxp or .cfg config file? Or is it pointless in trying to make the Nvidia work?
Edited by powerhouse - 9/2/12 at 5:20am
post #115 of 816
This thread...
I've been thinking about doing this for 2 months now and never found any info on it. And here it is, all neatly bundled into 1 handy thread.
I've even been planning a new rig to use as VMhost with workstation and gaming VMs.

Small question though, and I'm not sure if it has been brought up before. I was thinking of ArchLinux to use as dom0 as it's so very lightweight. What are your ideas on that? (I also have way more hands on experience with Arch than with Fedora, I made the switch aeons ago)
Elysium [WIP]
(1 item)
 
MSI ex623
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Pentium T3400 MSI MS-1674 Nvidia GeForce 9500MGS Transcent Information 4096MB DDR2-SDRAM 
Hard DriveOptical DriveOSMonitor
Western Digital WD2500BEVT-22ZCT0 Optiarc DVD RW AS-7560S Windows 7 Home Premium 32-bit Samsung 
Audio
Realtek ALC888 
  hide details  
Reply
Elysium [WIP]
(1 item)
 
MSI ex623
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Pentium T3400 MSI MS-1674 Nvidia GeForce 9500MGS Transcent Information 4096MB DDR2-SDRAM 
Hard DriveOptical DriveOSMonitor
Western Digital WD2500BEVT-22ZCT0 Optiarc DVD RW AS-7560S Windows 7 Home Premium 32-bit Samsung 
Audio
Realtek ALC888 
  hide details  
Reply
post #116 of 816
Quote:
Originally Posted by SCAndroid View Post

This thread...
I've been thinking about doing this for 2 months now and never found any info on it. And here it is, all neatly bundled into 1 handy thread.
I've even been planning a new rig to use as VMhost with workstation and gaming VMs.
Small question though, and I'm not sure if it has been brought up before. I was thinking of ArchLinux to use as dom0 as it's so very lightweight. What are your ideas on that? (I also have way more hands on experience with Arch than with Fedora, I made the switch aeons ago)

I'm not an ArchLinux guy, but their wikis and help docs are among the best. Isn't ArchLinux based on Fedora? If my memory doesn't fail me, it should be. So most of what's been said here should work.

One warning though: Make sure your hardware supports VGA passthrough. I am still trying to passthrough a Nvidia Quadro 600 card and it's a pain in the neck. You need to check the following hardware components for compatibility:

CPU - as for Intel CPUs, they MUST support VT-d !!! i7 non-K processors are supported, as well as the 3930K (which I have) with C2 stepping. Same for i5 processors. The newest Ivybridge processors are also supposed to support VT-d, but check before you buy! AMD has a different name for it (can't remember), again not all CPUs support it.

Motherboard - must have a VT-d or equivalent option for AMD (IOMMU ?) in the BIOS setup. Even with VT-d or IOMMU support in BIOS, some are more buggy than others. Check this thread or others for proven support / VGA passthrough success. A good place to start is looking at http://wiki.xen.org/wiki/VTdHowTo, but it's not up-to-date and the CPU stuff (see Intel CPUs) is misleading (for example, an i7 2600K CPU won't have VT-d - see above). But the best is to read through this thread for proven solutions!

Graphics adapter: On-chip graphics adapters on Intel i7 CPUs such as a i7 2600 (non-K !!!) should be supported. For discrete graphics cards, AMD looks like the better choice for out-of-the-box support, but again, go for proven solutions (=cards). Nvidia-based graphics cards are difficult. AFAIK only the Nvidia Quadro 4000 and 3000 are officially supported. Also, Nvidia doesn't support Linux and open source, though their Linux proprietary drivers are often better than the AMD counterpart and they don't drop support so fast (I've had Nvidia cards working with proprietary drivers for many years, different cards too, and they are still supported). With regard to VGA passthrough, AMD seems the better choice right now. Important: Search the Internet or this thread for proven hardware that works !!!

A last note: There are a lot of hardware pieces that need to fit together to make it work. As for VT-d (Intel slang) or IOMMU, this is essential. VT-d or better IOMMU is a memory controller function which is either handled in the motherboard chipset (usually older systems) or nowadays with the Intel Sandybridge, Sandybridge-E, or Ivybridge in the CPU itself. So before you buy anything, make absolutely sure it will work with VGA passthrough.
post #117 of 816
I made it !!!

The Nvidia Quadro 600 card didn't work with VGA passthrough, at least not without patching/compiling a new kernel / xen.

I replaced the Quadro 600 for a Quadro 2000, reinstalled everything, made some adjustments, and re-installed Windows 7 Ultimate. Within Windows I installed the Nvidia Quadro 2000 driver (had Windows search for it) and rebooted. Voila - it worked without a problem.

Windows performance index is 5.8 (lowest value = storage). I will prepare a detailed how-to for other Linux Mint 13 Mate users (should work on other Linux Mint 13 versions as well as Ubuntu 12.04 as well).

The critical part is the hardware !!! Here my current list:

i7 3930K CPU with C2 stepping
Asus Sabertooth X79 with 1203 BIOS
PNY Quadro 2000 (Nvidia) graphics adapter with "multi-OS" support used with Windows
AMD 6450 graphics card used with Linux / dom0
KVM USB switch to switch keyboard and mouse between two USB host adapters
120 GB SSD drive for /, /boot, /home, and /win7, where /, /home, and /win7 reside on LVM2 formatted LVs
Several regular hard drives

I will prepare a detailled how-to and post it here or elsewhere with a link from here.

Thanks for all your support and encouragement!

EDIT: I was exaggerating with the Windows Experience Index - it was only 5.8 (not 6.8) using the HVM qemu-dm that comes as standard (fixed it in the text as well). But watch for my next post!
Edited by powerhouse - 9/10/12 at 9:48am
post #118 of 816
I didn't like the low storage performance index I got from Windows - only 5.8 for an SSD based storage (phy:/path/to/lvm/device...).

So today I installed the GPLPV driver from here: http://wiki.univention.de/index.php?title=Installing-signed-GPLPV-drivers

This is the result:



That was worth it smile.gif . Use the "signed" drivers for anything newer than Windows XP (e.g. Vista, Win 7 or Win 2008).
post #119 of 816
Hi,

I'm just trying to install this on my laptop and I've got a problem.
I don't know why, but when I start the VM, it "runs" for about 40s and poweroffs. Nothing is displayed anytime. Am I doing something wrong? Iso of the bootcd is set ...

another problem is that I had to comment out ethernet, I'm not able to set up the virtual bridge correctly, it dodn't set up automatically (I'm using Debian stable), but that would make sense to solve only when I'm able to boot at least something ...

If you have any ideas, let me know smile.gif

Thanks in advance,
Ghor
post #120 of 816
Quote:
Originally Posted by ghormoon View Post

Hi,
I'm just trying to install this on my laptop and I've got a problem.
I don't know why, but when I start the VM, it "runs" for about 40s and poweroffs. Nothing is displayed anytime. Am I doing something wrong? Iso of the bootcd is set ...
another problem is that I had to comment out ethernet, I'm not able to set up the virtual bridge correctly, it dodn't set up automatically (I'm using Debian stable), but that would make sense to solve only when I'm able to boot at least something ...
If you have any ideas, let me know smile.gif
Thanks in advance,
Ghor

You have to give a little more information. What laptop? Which processor (exactly)? Which graphic chip(s)?

But before you go any further, the following is a minimum requirement for VGA and/or PCI passthrough to work:

1. CPU with VT-d support !!! For example, a i7 2600 CPU will work, but NOT the i7 2600K. If you have an Intel CPU, you can check it here: http://ark.intel.com/. For example an Intel i5 2500T should work (if the rest of the points here are met). My kids have a Dell 15R (n5110) with a i5 2450M CPU which doesn't support VT-d mad.gif.

2. A motherboard with VT-d option in the BIOS. That will be even harder to find, especially on many lousy laptop BIOSes. It also depends on the BIOS release - often manufacturers add VT-d support only at a later stage in their BIOS. Last not least, some BIOSes with VT-d option are buggy. For a laptop user this will be a real challenge (if #1 above is met).

3. A graphics adapter that supports VGA passthrough. If the above two seem like obstacles, be prepared. This is the most tricky of all. But, there are also good news: The new on-chip Intel graphics adapters are supported as of Xen hypervisor 4.1.2 (or 4.2, I can't remember), as well as many AMD graphics adapters. If you have an Nvidia graphics adapter (as I have), there are three options/possibilities:

a) You got a "multi-OS" (Nvidia terminology) graphics adapter (unlikely in a laptop) and it's smooth rolling! The Quadro series of professional graphics workstation graphics adapters from Quadro 2000 on upwards (not the Quadro 600 which I tried) will work, as well as some other (usually high-end) "multi-os" adapters from Nvidia.

b) You got another Nvidia graphics chip or adapter where you can use the David Techer web site: http://www.davidgis.fr/blog/index.php?Xen and http://www.davidgis.fr/blog/index.php?2011/12/07/860-xen-42unstable-patches-for-vga-pass-through, the latter with instructions on how to compile the patches into the Xen hypervisor.

c) If a) and b) don't work, you're probably out of luck. Some explanations for that, or help for choosing the right hardware, can be found here: http://wiki.xen.org/wiki/XenVGAPassthrough.

4. If you're looking for better Linux graphics acceleration on laptops with two graphics chips using Nvidia "Optima" technology, try bumblebee for Nvidia chips. But that doesn't give you any Windows games or other, only native Linux apps that you want to use with accelerated Nvidia graphics (instead of the Intel CPU built-in GPU that's usually no good for more demanding graphics tasks). I tried it on my kids laptop and it works great. I also love the technology behind bumblebee - this is the future: using VDI technology for remote desktop to the actual CPU/GPU on the computer (I wish there were host providers that did that, like Stephen Perlman's onlive http://www.onlive.com/).

I should meet with Steve, I have some nice ideas on how to develop his technology to make it THE (r)evolution!

Hope the above helps.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Operating Systems
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › {Guide} Create a Gaming Virtual Machine