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 15

post #141 of 824
Quote:
Originally Posted by ghormoon View Post

I'm deattaching the VGA in init.d script, because that i have kernel that has xen-pciback as module and i've never compiled kernel, so it would end in a disaster smile.gif
I've posted the config in this post: http://www.overclock.net/t/1205216/guide-create-a-gaming-virtual-machine/130#post_18141770 ... or do you mean different config?
Btw that version is that one, which doesn't start (that audio problem, most propably because of that vnc wants to pass audio somehow), without the vnc settings it does and shuts down in a while. Isn't there any way to use notebook display for installing?

Sorry I missed your post (config file).

Here are some comments:

disk = [ 'phy:/dev/sda2,sda,w' , 'file:/win7recovery.iso,sdc:cdrom,r' ]

I couldn't get Windows installer to start with "sda" setting. I think it complained about missing driver disk or so. Try to change your above line to read:

disk = [ 'phy:/dev/sda2,hda,w' , 'file:/win7recovery.iso,hdc:cdrom,r' ]

I think you have far too many PCIs passed through. Start with the basic ones you need:

Instead of: pci=[ '01:00.0', '01:00.1' , '00:1a.0' , '00:1b.0' , '00:1d.0' , '24:00.0' , '24:00.1' , '24:00.2' , '25:00.0' , '26:00.0' ]

Try: pci=[ '01:00.0', '01:00.1' , '00:1d.0' ] # replace 00:1d.0 with 00:1a.0 if it doesn't work

01:00.0 is for the graphics adapter, 01.00.1 is for the audio on that graphics adapter when using an HDMI link. 00.1a.0 is your Intel CPU integrated USB host #2 (the CPU has two, the other one is 00.1d.0). That's where your keyboard / mouse should be connected to. Check the dmesg output to find your mouse and keyboard - note the PCI ID(s).

You first want to try to install the Windows domU, with or without sound support. Once can run Windows in domU, shut it down and add additional PCIs you want to pass through, for sound, USB etc. devices.

Don't try to pass through your SATA controller 24:00.x !!! You may be trying to take away your hard drive from dom0, which is not a good idea. There is no need to pass through the SATA controller to Windows.

The same goes for your network controller 25:00.0. If you take it away from the Linux dom0, you have no way to access your machine during the Windows installation.

Once you changed your Win7 cfg file and perhaps rebooted, check the output of the following command when using your ssh remote session:

xm pci-list-assignable-devices

It should list the 3 PCI IDs you specified, if they have been successfully detached !!! If there is nothing displayed, check your pciback shell script or config file to make sure it contains only the three PCI IDs you listed in the win7.cfg file, but using the domain ID in front of the PCI ID like here:

0000:01:00.0

(See your pciback script for exact syntax!)

So, when you don't get any PCIs listed with the xm pci-list... command, you need to run the pciback script to detach the PCIs. If the script doesn't give you an error, check again with xm pci-list-assignable-devices. Do they show up now?

Important: The above can only be done from a remote PC via ssh or VNC, as it will disconnect your keyboard/mouse and screen from the Linux dom0 so you won't see anything nor be able to use your mouse/keyboard.

Let's start with the above suggestions and go from there.
post #142 of 824
Quote:
Originally Posted by vesslan View Post

When I used Xen 4.1.2 kernel and fedora16 do vga pass through,ATI graphics can be successful,But NVIDIA graphics card unsuccessful.I used ATI graphics card includes HD5850&HD6850,used NVIDIA graphics card includes 9400GT 9800GT GTX550TI GTX470 GTX580.
And I tested fedora17 and xen 4.1.2,ATI graphics can be successful,NVIDIA can not.
I see xen 4.2 have better support of NVIDIA graphics card.But, now if use command in Linux OS installed xen just connected 4.1.2 version.
I saw EnMing Zhang about NVIDIA graphics passthrough documents, and according to the steps tested,but unsuccessful.
Are there someone have successful NVIDIA graphics card vga passthrough on fedora16 or 17 and xen 4.1.2 ? (VM OS is win7 64bit).If there is ,can you tell me how to operate,I want to know steps.

I don't use Fedora, but Linux Mint 13 (Ubuntu / Debian based distro) with Xen hypervisor 4.1.2 and a Nvidia Quadro 2000 graphics card as secondary graphics adapter for my Win7 64 Pro domU.

Nvidia officially supports what they call "multi-OS" on some of their workstation graphics cards. With a multi-OS specified card it should be smooth sailing. They are designed for exactly that application, that is VGA passthrough. These cards aren't cheap, though.

Many/most of the Nvidia Quadro cards offer multi-os. But not all of them - I had a Quadro 600 card that didn't work and is NOT specified to support multi-OS. Check the Nvidia website. I think some Tesla or so cards also support multi-OS. I don't know how these cards fare with games, as my Quadro 2000 gives rather mediocre results for graphics under Windows (7.0 experience index, the lowest of all). They are designed for professional graphics workstations running CAD-CAM, video or photo editing software, not for games. Unless Nvidia expands the multi-OS support to "gamer" graphics cards, this business will probably go to AMD.

There are some other Nvidia cards that have been reported to support VGA passthrough using patches. But as you mentioned, it may or may not work. My Quadro 2000 gave me instant success with no patches or hypervisor or kernel compilation at all - just straight out of the box.

The only thing I had to fix was to blacklist the nouveau Nvidia driver that Linux automatically loaded.

Ah, by the way, I use a cheap AMD graphics card for my Linux dom0 using the proprietary AMD driver. Unfortunately the Nvidia proprietary driver doesn't work under Xen (at least not out-of-the-box), only nouveau. And the nouveau driver isn't that great of a performer, though it usually works well with basic applications and without 3D etc. gimmicks.
post #143 of 824
Quote:
Originally Posted by powerhouse View Post

I don't use Fedora, but Linux Mint 13 (Ubuntu / Debian based distro) with Xen hypervisor 4.1.2 and a Nvidia Quadro 2000 graphics card as secondary graphics adapter for my Win7 64 Pro domU.
Nvidia officially supports what they call "multi-OS" on some of their workstation graphics cards. With a multi-OS specified card it should be smooth sailing. They are designed for exactly that application, that is VGA passthrough. These cards aren't cheap, though.
Many/most of the Nvidia Quadro cards offer multi-os. But not all of them - I had a Quadro 600 card that didn't work and is NOT specified to support multi-OS. Check the Nvidia website. I think some Tesla or so cards also support multi-OS. I don't know how these cards fare with games, as my Quadro 2000 gives rather mediocre results for graphics under Windows (7.0 experience index, the lowest of all). They are designed for professional graphics workstations running CAD-CAM, video or photo editing software, not for games. Unless Nvidia expands the multi-OS support to "gamer" graphics cards, this business will probably go to AMD.
There are some other Nvidia cards that have been reported to support VGA passthrough using patches. But as you mentioned, it may or may not work. My Quadro 2000 gave me instant success with no patches or hypervisor or kernel compilation at all - just straight out of the box.
The only thing I had to fix was to blacklist the nouveau Nvidia driver that Linux automatically loaded.
Ah, by the way, I use a cheap AMD graphics card for my Linux dom0 using the proprietary AMD driver. Unfortunately the Nvidia proprietary driver doesn't work under Xen (at least not out-of-the-box), only nouveau. And the nouveau driver isn't that great of a performer, though it usually works well with basic applications and without 3D etc. gimmicks.

Yes, I know Tesla and Quadro maybe support pass-thou,but they need to run Xenserver (It's virtual machine system of Citrix ).
On its website wrote only Platinum Edition and Enterprise Edition supports vga pass-through,and supports Tesla&Quadro. But they are not free.
I downloaded Advanced Edition,version is 6.0,it's Xen hypervisor is 4.1.2. So,I think Xenserver maybe modified Linux kernel to support NVIDIA graphics cards.
In before I mentioned documents,EnMing Zhang also modified memory in config files and kernel files,he tested successful NVIDIA 9400GT,and he says the earlier version compatibility. I think accordance he's documents maybe 8800GT and 8600GT maybe success.
But so far, I only know that he doesn't use XenServer success.
You said I also installed patches and driving test, and the Linux built-in drivers unload, but without success。 Did you succeed whit Quadro 2000?
post #144 of 824
Quote:
Originally Posted by vesslan View Post

Yes, I know Tesla and Quadro maybe support pass-thou,but they need to run Xenserver (It's virtual machine system of Citrix ).
On its website wrote only Platinum Edition and Enterprise Edition supports vga pass-through,and supports Tesla&Quadro. But they are not free.
I downloaded Advanced Edition,version is 6.0,it's Xen hypervisor is 4.1.2. So,I think Xenserver maybe modified Linux kernel to support NVIDIA graphics cards.
In before I mentioned documents,EnMing Zhang also modified memory in config files and kernel files,he tested successful NVIDIA 9400GT,and he says the earlier version compatibility. I think accordance he's documents maybe 8800GT and 8600GT maybe success.
But so far, I only know that he doesn't use XenServer success.
You said I also installed patches and driving test, and the Linux built-in drivers unload, but without success。 Did you succeed whit Quadro 2000?

My system is up and running Xen hypervisor 4.1.2 with Linux Mint 13 Mate 64bit dom0 and Windows 7 64bit Pro as domU.

The Quadro 2000 works perfect! I did not use any patches or kernel builds. Aside from some minor fixes in Linux Mint (missing links) for some xen packages there was nothing out of the ordinary that I had to do.

I never tried the commercial Xenserver and don't see a need for it now.

By the way, I load xen-pciback as module with the passthrough=1 option (edit /etc/modules file) and run a pciback script to detach/attach the PCIs.

In Windows 7 I installed the GPLPV disk driver - works wonders.

In summary, I can confirm that the Nvidia Quadro 2000 works well with VGA passthrough.
post #145 of 824
Hello,
Is it possible to dedicate one of my GPU's to a VM and for the rest of my VM's to share a Intel HD Graphics?
post #146 of 824
Quote:
Originally Posted by cladus View Post

Hello,
Is it possible to dedicate one of my GPU's to a VM and for the rest of my VM's to share a Intel HD Graphics?

Sure you can. But your other guests will get a virtualized HD graphics adapter, that means not native performance.

You would use the Intel HD GPU without passthrough for your dom0 and other guest VMs (domUs). Then you passthrough your secondary, dedicated graphics adapter to the domU you want, for example a Windows 7 domU. That Windows domU would have exclusive and direct/native access to the secondary graphics adapter.
post #147 of 824
I do cross-platform development for very "heavy" tasks - they require maximum memory and maximum CPU resources.

I can take the hit from the extra overhead of dom0/xen, but I have a question:
Can I pass through ALL cores and ALL memory, and let Xen handle the resources efficiently? Or is that just not possible?

Also, I only have one GPU. I understand the complications, but the end result should be that the active OS has control of the GPU and hence the display - in such a manner that I can flick from VM to VM to dom0 and back in one keypress? Correct?

EDIT: I assume the same applies to passing through the USB controller so that my KB/mouse just switches over too.


Very nice guide, I look forward to trying it.

I am just about to set up my PC with an LVM partition on the SSD; and swap, a backup OS and data storage on RAID1 with my HDDs.
Edited by Killhouse - 9/15/12 at 3:15pm
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
PAROXYSM
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom x4 II 965 GA-990FXA-UD3 XFX HD 4870 1GB Corsair (12gb) 
Hard DriveHard DriveCoolingOS
2x1TB Caviar Black OCZ Vertex 60gb H50 W7 64-bit / Fedora 17 64-bit 
MonitorKeyboardPowerMouse
V7 22" Logitech Deluxe 250 Antec TruePower 750W Modular Razer Lachesis 
Mouse Pad
None 
  hide details  
Reply
post #148 of 824
Thank you for that powerhouse,
would any one mind telling me what hardware I'm going to need, I will have 2 VM's with 2 different dedicated graphics and 3VM's running normally.
I have found the i7-3770 Processor and Intel® Desktop Board DZ77GA-70K both with vt-d and vt-x support but are they powerful enough for what I'm planning, And how much ram should I get I was thinking 32GB but I don't know if its too much or too less.
Price Range: $1000-$3000
Thank You
post #149 of 824
Quote:
Originally Posted by Killhouse View Post

I do cross-platform development for very "heavy" tasks - they require maximum memory and maximum CPU resources.
I can take the hit from the extra overhead of dom0/xen, but I have a question:
Can I pass through ALL cores and ALL memory, and let Xen handle the resources efficiently? Or is that just not possible?
Also, I only have one GPU. I understand the complications, but the end result should be that the active OS has control of the GPU and hence the display - in such a manner that I can flick from VM to VM to dom0 and back in one keypress? Correct?
EDIT: I assume the same applies to passing through the USB controller so that my KB/mouse just switches over too.
Very nice guide, I look forward to trying it.
I am just about to set up my PC with an LVM partition on the SSD; and swap, a backup OS and data storage on RAID1 with my HDDs.

1. You need to leave some resources for Xen. You can't use the entire memory for your domU, nor all CPU resources. As to CPU resources, the granularity is measured in virtual CPUs. In my case with a 6-core i7 3930K CPU, I have 12 threads and ergo 12 VCPUs. I dedicated 2 VCPUs to the dom0/Linux, the rest for the Windows domU.

Xen offers lots of ways to tweak performance. And then there are the PV (para-virtualization) drivers which gave me a great performance boost for disk access under Windows 7 (look for "signed" GPLPV drivers). As for memory, I have 32GB in total and my dom0 with full-blown Linux Mint desktop works happily with 2GB, even less.

If you don't care for a graphical dom0 Linux desktop, you can also install the Xen hypervisor with a minimal dom0 Linux - there should be a readymade ISO available on the Xen website.

2. In my opinion, one GPU is a pain in the neck (but that's very subjective). You can't just switch from one domU to the other (while the first is still running), without causing havoc when switching the GPU to another system. Think about, it would be like pulling your graphics card out of a running Windows system (or Linux). I don't think that this works nicely.

If you don't have special graphics requirements for multiple guests and/or the dom0, get a cheap AMD graphics adapter (I bought a 6450, but thats really bottom line even with proprietary drivers), plug it into the first PCIe x16 slot and put your main GPU into the second slot. This way you have a dedicated graphics card for your dom0, and a dedicated one for your main guest system (e.g. Windows). Many modern boards allow you to install a third adapter, if needed.

3. USB passthrough is way easier. For one thing, USB was designed to be hot-pluggable. Combined with second GPU, you can get a USB KVM and switch your mouse / keyboard between two different USB hosts (one passed thru to the guest) and that works fine. Your screen should have two connection ports so you can run two cables, one from each GPU. Your screen should also allow you to switch between the inputs, or automatically switch over when a port becomes active.

For external USB disks use a dedicated, passed-through USB port (host actually) for your domU guest.

4. If you prefer a Ubuntu-based (or perhaps Debian) system, have a look at my how-to: http://forums.linuxmint.com/viewtopic.php?f=42&t=112013. It's a little more complicated than this how-to, though.

5. LVM is the way to go for Xen. Your setup is similar to mine, though I use LVM striped on my HDDs to get RAID0 performance and use LVM snapshots and backup (for example rsync) for backup purposes. I find LVM very flexible and I often find myself in need for more disk space. As mentioned before, use the GPLPV drivers for Windows - it boosted my SDD based Windows Experience index for disk performance from 5.8 to 7.8 (7.9 being the maximum). I can't complain.

Important: Make sure you have the right hardware - VTd in both CPU (or motherboard) and in the motherboard BIOS settings is a must. Don't even think about passing through a graphics adapter that's not been confirmed to work. AMD GPUs should be the saver road (again check your specific model), though my Nvidia Quadro 2000 "multi-OS" GPU works out of the box with Xen hypervisor 4.1.2.

Good luck!
post #150 of 824
Quote:
Originally Posted by cladus View Post

Thank you for that powerhouse,
would any one mind telling me what hardware I'm going to need, I will have 2 VM's with 2 different dedicated graphics and 3VM's running normally.
I have found the i7-3770 Processor and Intel® Desktop Board DZ77GA-70K both with vt-d and vt-x support but are they powerful enough for what I'm planning, And how much ram should I get I was thinking 32GB but I don't know if its too much or too less.
Price Range: $1000-$3000
Thank You

According to http://ark.intel.com/products/65719/Intel-Core-i7-3770-Processor-8M-Cache-up-to-3_90-GHz the Intel i7-3770 has VT-d. Here are some observations:

a) 4 cores / 8 threads - this translates into 8 virtual CPUs or vcpus in Xen. If I understand you correctly, you are planning to run 5 VMs (domU in Xen talk) plus the obligatory dom0. That doesn't leave many options. You will be able to dedicate 2 vcpus per guest for two guests, and one vcpu for the remaining domUs and dom0. It may be enough, but that depends on the applications.

Some questions:
Can you explain what you try to build?
Will all VMs run concurrently, or do you plan to run them when needed and turn them off when not in use?

b) Memory is limited to 32GB. For normal desktop tasks and even combined with games this should give you plenty of memory. dom0 (control domain = Linux) will need some 2GB, even with a full desktop system like Fedora or Ubuntu (unless you do some memory intensive tasks on it). A regular Windows 7 desktop with office applications, browser and email should need more than 4GB. A gaming desktop may need a little more, but 8GB should be enough. Only if you plan to do video or photo editing with large RAW files (uncompressed high-resolution images), CAD-CAM, software compilations, or similar memory intensive stuff will you be able to use more than 8GB of memory. But those last applications will also require a lot of CPU power to run efficient, in which case your CPU may be underpowered.

c) Memory bandwidth is "only" 25GB/s.

d) The 3770 has an internal HD 4000 graphics adapter, which can be used for the dom0. On the downside, it supports 1x PCIe x16, or 2x PCIe x8, which means if you plug in two discrete graphics adapters they will run at x8 speed instead of x16. I have no idea how that impacts graphics performance, but I guess it will.

In comparison, the i7-3930K I use has 6 cores / 12 threads, can address a total of 64GB memory, has a bigger internal cache (12MB versus 8MB), and double the memory bandwidth (50GB/s). A C2 stepping version of it supports VT-d. It supports two PCIe x16 cards. BUT, it doesn't have an internal GPU.

Depending on what you want to do, you may want to consider the i7 3930K.

Intel boards are generally considered to have good BIOS versions and support. Still, check in the forums or on the Internet to see if it's been verified to work with PCI/VGA passthrough.

32GB should be enough memory, but the best is to list the applications or VMs you want to run and add up their memory requirement. See above. One remark on memory: memory kits are matched kits. So if you buy a 16GB kit and want to add another 16GB later, it may not work even with the same exact memory kit. My 3930K and Asus X79 motherboard combo were quite tricky about memory. And it gets more tricky the more memory you have.

Last not least the graphics cards: If you want Nvidia, as of now, only the Nvidia "multi-OS" graphics cards are designed to work with VGA passthrough. There are hypervisor patches etc. for other (perhaps many) Nvidia cards, but that isn't for everyone (I tried and failed with a Quadro 600 card). AMD, on the other hand, has reportedly better VGA graphics passthrough support, but make sure to get cards that have been verified by other users.

Hope this 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