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 17

post #161 of 815
I've beem trying only 01:00.0 and 01:00.1 and got that ... and yes, I DDed the dvd into iso ...

is there any way to force xen to ignore the error and start the VM?
post #162 of 815
Quote:
Originally Posted by ghormoon View Post

did not help at all ...
sata is 00:1f.2, 24:... is for firewire and such, 25:... is wifi (i'm using ethernet for management, 00:19.0)
I have init.d script to deattach the devices, it doesn't start automatically, dunno why, but when I run it manually, I see the devices as assignable
I'm logging through putty and xming all the time ...
When I allow vnc in the config file, it gives me errors, I got rid of some by diabling sound, anyway, now I'm stuck on
xs_read(/local/domain/0/device-model/4/xen_extended_power_mgmt): read error
bind() failed
(in /var/log/xen/qemu-dm-win7.log)

Can you post your new win7.cfg file?
post #163 of 815
kernel = "hvmloader"
builder='hvm'
memory = 3072
name = "win7"
vcpus=3
pae=1
acpi=1
apic=1
#vif = [ 'type=ioemu, bridge=xenbr0' ]
disk = [ 'phy:/dev/sda2,hda,w' , 'file:/win7recovery.iso,hdc:cdrom,r' ]
device_model = 'qemu-dm'
boot="dc"
sdl=0
opengl=1
vnc=1
vncdisplay="10"
vnclisten="192.168.1.42"
vncpasswd='42'
stdvga=0
#nographic=1 #!!! only uncomment this if you are using win8 or are trying to get a nvidia card to work
serial='pty'
tsc_mode=0
soundhw=''
usb=1
usbdevice='mouse'
gfx_passthru=0
pci=[ '01:00.0', '01:00.1' ]
#pci=[ '01:00.0', '01:00.1' , '00:1a.0' , '00:1d.0' , '24:00.0' , '24:00.1' , '24:00.2' , '25:00.0' , '26:00.0' ]
post #164 of 815
Quote:
Originally Posted by ghormoon View Post

I've beem trying only 01:00.0 and 01:00.1 and got that ... and yes, I DDed the dvd into iso ...
is there any way to force xen to ignore the error and start the VM?

Ok.

Can you post the output of xm dmesg ? Try this command after you have detached the PCI devices, as well as after running xm create or xm new (see below).

Let's have another look at the win7.cfg file. If I remember correctly, the preferred way is to use VNC.

1. Check that you have vncviewer installed on your Linux system and on the remote system.
2. Use only these three lines for VNC in your win7.cfg file:
vnc=1
vncpasswd=''
stdvga=0

3. See if VNC works from your remote computer. If not, connect to your laptop using ssh -X ... You may have to reboot your laptop before running the following commands:
a) As root, run xm pci-list-assignable-devices
b) If they don't show up, run the pciback script as you did before. Check again with xm pci-list...
c) xm new /etc/xen/win7.cfg
d) virt-manager (you may have to install virt-manager and its dependancies AND edit your /etc/xen/xend-config.sxp file to uncomment (xend-unix-server yes))
e) Switch to the X window and you should see the virt-manager GUI. Double-click your win7 domU, click the Terminal button and then > (run).
f) Does it start? Wait a little as the boot process takes some time, ~ 15-30 sec.

4. If nothing of the above works, particularly if VNC doesn't work, comment out the above lines in your win7.cfg file, except stdvga=0, and change that to stdvga=1. Check for the stdvga option on the Xen.org page for more explanations. I haven't used stdvga as VNC works for me. IIRC stdvga=1 tells Xen to use the standard X window output so you will need to use ssh -X to get to the screen. However, I remember seeing comments that discourage the use of stdvga=1.

In any of the above attempts, check if you still have access to your laptop via VNC or ssh (command line access) after booting or when running the xm ... commands.

See my next post for additional thoughts!
post #165 of 815
I've tried most of that before, now I'm installing win7 on the partition traditionally and I'll try if it loads in xen then biggrin.gif (also in half an hour, my first lab starts at school and i need at least some working OS ...)
I'll experiment more in the evening smile.gif
post #166 of 815
Quote:
Originally Posted by ghormoon View Post

kernel = "hvmloader"
builder='hvm'
memory = 3072
name = "win7"
vcpus=3
pae=1
acpi=1
apic=1
#vif = [ 'type=ioemu, bridge=xenbr0' ]
disk = [ 'phy:/dev/sda2,hda,w' , 'file:/win7recovery.iso,hdc:cdrom,r' ]
device_model = 'qemu-dm'
boot="dc"
sdl=0
opengl=1
vnc=1
vncdisplay="10"
vnclisten="192.168.1.42"
vncpasswd='42'
stdvga=0
#nographic=1 #!!! only uncomment this if you are using win8 or are trying to get a nvidia card to work
serial='pty'
tsc_mode=0
soundhw=''
usb=1
usbdevice='mouse'
gfx_passthru=0
pci=[ '01:00.0', '01:00.1' ]
#pci=[ '01:00.0', '01:00.1' , '00:1a.0' , '00:1d.0' , '24:00.0' , '24:00.1' , '24:00.2' , '25:00.0' , '26:00.0' ]

Looks good, except that I would comment out soundhw='' (# soundhw='') for now, and change the vnc options as mentioned in my above post. With regard to VNC, have a look at the /etc/xen/xend-config.sxp file and check if there are any VNC related settings that could overwrite your win7.cfg file settings, for example I uncommented (vncpasswd '').

Now my afterthoughts on my above comments:

You are trying to pass through your primary display adapter. (I've had success only with the secondary display adapter, though I believe my problems were with my previous graphics card that didn't support VGA passthrough.)

When you boot your display adapter will be bound to the display driver you use for your graphics card, unless you detach the PCI ID before the driver gets loaded. This may complicate things. In my setup I had to blacklist the nouveau driver for my secondary display adapter since it interfered. My PC would get stuck right after login, with error messages pointing to the nouveau driver. In my case I didn't need the driver, as I'm using my primary display adapter (AMD) for the dom0 Linux, and the secondary (Nvidia) display adapter is only used by Windows.

To pass through a primary display adapter, you might need to prevent the graphics driver to be loaded under Linux. Your access to the Linux dom0 would then be via Windows and VNC or similar, which doesn't require the graphics driver for your card.

Check the output of dmesg to see if and when your graphics driver is run. To avoid loading the graphics driver, try booting into runlevel 3 (init 3) or once booted, run init 3 to switch to that run level (i.e. command line only). I'm not sure if that disables the graphics driver (when switching from runlevel 5 to 3), but it's worth a try.

After that run the pciback script etc.
post #167 of 815
Quote:
Originally Posted by ghormoon View Post

I've tried most of that before, now I'm installing win7 on the partition traditionally and I'll try if it loads in xen then biggrin.gif (also in half an hour, my first lab starts at school and i need at least some working OS ...)
I'll experiment more in the evening smile.gif

You won't be able to boot Windows into Xen from a traditional installation. Even if you get something started under Xen, Windows will discover a totally new system and will probably fail to boot.

Yep, it's hard to work with a PC without functioning OS.

You mentioned that you are using a recovery disk for Windows? Is that a fully installable Windows version, or the disk that came with your pre-installed Windows laptop?

To make sure that your Windows disk is in fact installable under Xen, I would first try to install it as a normal HVM guest without passthrough at all. If it installs and runs, then you can try the passthrough part.

Good luck!
post #168 of 815
Quote:
Originally Posted by powerhouse View Post

1. With a multi-threaded CPU a 4-core processor would give you 8 threads. You could assign 7 vcpus to the guest and leave 1 vcpu for the host, but that may be borderline. In a 7:1 setup you could increase the dom0 queue priority, giving it precedence over CPU time when needed.
2. If RAID1 doesn't work, use LVM with mirror (similar to RAID1). Well, I'm actually a little confused now. It seems you are trying to access a Linux software RAID via Windows? I doubt this works, neither will a natively installed Windows be able to read LVM volumes.
Here is what I would consider:
a. Run your SSD (/dev/sda) with LVM for everything except /boot (and /efi if you got it - though I discourage using UEFI unless really needed). Once everything works, boot your PC with a Linux live USB stick and backup the entire SSD to disk of the same or larger size using dd if=/dev/sda of=/dev/backup_disk or into an image file with dd if=/dev/sda of=backup.img which must reside on another disk. That will take quite some time, but with the first option you would have a bootable, fully installed disk that you can just swap for your SSD; with the second option you would need to replace the SSD for a new one of the same or larger size and install the disk image via dd command (Linux live USB stick).
b. To use Windows with Linux software RAID or LVM, Windows must be installed as domU. In this case it runs on top of the hypervisor / Linux and they will take care of it. Xen will create some storage container (I don't know how it's called) that will reside on your LVM volume(s). I've tried to format an LVM striped volume (similar to RAID0) with NTFS and specified it using the phy:/dev... option in the domU configuration file, but this gave me some strange results. Windows would see it as a drive, but with multiple partitions, some formatted, some not. I abandoned this attempt.
To access the Windows file system under Linux (dom0) you need to use the kpartx command.
c. As to the data drives: You could run software RAID1 combined with LVM, or just LVM with mirror. I think hardware RAID is generally discouraged. For example, if your computer or specifically the hardware RAID controller fails on you, you would have to get the exact same computer/controller to restore your information, as each manufacturer may implement RAID in a different way. With Linux software RAID or LVM you won't have this issue, as it's either backwards compatible (if you use a newer version) or you can just keep one or two USB sticks with the Linux live system in case you need it.
As mentioned under b., if you use these data drives from within a Windows domU, you can mount/access them under Linux via kpartx.
Other backup possibilities with LVM are snapshots, which can be done on a live system. You need a snapshot volume that must be as big or bigger as the amount of data you expect to be written/changed during the live backup. Just for clarity: a snapshot by itself doesn't provide a backup!!! Once the snapshot is created, you need to back it up to another drive/media or remote location (rsync ?, which of course works locally as well). To do the actual backup use dd or better perhaps rsync, or a backup utility under Linux. At the end you must remove the snapshot. It's best to read up on LVM and snapshots to get a better understanding.
To sum up the backup strategy:
- RAID1 or LVM mirror will give you online backup of your data. The caveat is that when you accidentally delete some file(s) they are gone.
- With LVM snapshot and backup you can create copies of your data manually or at given times (via a cron job). Some backup utilities like rsync don't need to copy the whole data each time, but will backup only the files that have changed. There are also backup utilities that keep copies of the original files so in case you deleted some files you can recover them even after you did a backup.
I would go with a combination of both RAID1 or LVM mirror and some snapshot/backup scheme with history, with the backup preferably on external media.
3. Yeah, pciback takes some time to figure out. Let's start with this command:
xm pci-list-assignable-devices
If you don't get a list of devices that can be assigned, then they haven't been detached yet. A short how-to on this and VGA passthrough (for Ubuntu-based systems) is http://gro.solexiv.de/2012/08/pci-passthrough-howto/, a longer one with more details (again for Ubuntu-based systems) is mine here: http://forums.linuxmint.com/viewtopic.php?f=42&t=112013&p=629268#p629268. In my how-to see part 3 steps 3-6.
Be aware that if you use Fedora, you may need to make some changes or use different commands (to update your init.d). But the idea is the same.
Here in essence:
a) If xen-pciback isn't compiled into the kernel, you need to load it. Under Ubuntu/Debian systems you can use the /etc/modules file and add "xen-pciback passthrough=1" (without quotes) to load the pciback module during boot.
b) You need to detach the PCI devices from their drivers to make them assignable later on. In both how-tos this is done by the pciback script. It unbinds the driver from it's PCI device, adds a new slot to the PCI backend list, and binds it to the new slot. Note the long PCI IDs with domain, e.g. 0000:01:00.0.
c) Once the PCI device has been bound to pciback, it becomes assignable. You can use the command above (xm pci-list...) to see the assignable devices and check that all is OK.
From there on you should be able to execute xm create /etc/xen/your_domU.cfg, or xm new /etc/xen/your_domU.cfg followed by virt-manager (in both cases pointing to your domU configuration file).
Good luck!

1. I'm using an AMD chip with 4 cores, so I would only have 4 threads I believe. I think what I would want to do is impossible: assign all 4 threads to both dom0 and domU and have the clock cycles shared such that a heavy application could run on dom0 constantly, but allow gaming on domU temporarily by sharing CPU time with dom0.

2. The SSD is moot really, its just an LVM for the different doms, no problem there. The issue was my "data" drives which I could only manage to do a software RAID on. Its not an issue, I just unRAIDed them and I'll use them as regular drives. I'll run some sort of automatic backup software on them from dom0. I also install a backup OS on one of the mechanical drives in case of SSD failure - I don't need full usage then, just a simple OS I can log in to to trouble-shoot (it'll probably be Fedora or Windows).

I just wanted to make sure that data was safe. And I'd rather do it in a transparent copy+paste into a file system that I *know* can be opened by Windows, Linux... or any other OS that I can use to retrieve the data in case of my original installs breaking smile.gif

3. I've been trying a few random things with pciback, I will try your links in the next day or so when I'm back home. I ran a script that was meant to detach the graphics driver, make a slot in pciback for it, then attach it to pciback. I don't know if it works, because my screen obviously shuts off after the first line wink.gif I have a feeling that is the script I should be forcing at init, but I'll do some more investigation!

Quote:
Originally Posted by powerhouse View Post

...
To pass through a primary display adapter, you might need to prevent the graphics driver to be loaded under Linux. Your access to the Linux dom0 would then be via Windows and VNC or similar, which doesn't require the graphics driver for your card...

I'm going to try very hard to get around this and end up with a system that switches (full screen) between dom0 and domU, each having total control of the graphics card and therefore the monitor tongue.gif

Thanks for your tremendous help again. +rep!
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 #169 of 815
VM2-5 will be using remote desktop's on my families computers/laptops and I will use VM1 on the main computer.
post #170 of 815
Has anyone tried using ZFS as the data store with xen or even just having ZFS alongside xen (used for separate storage)? I am very interested in migrating my FreeBSD server using ZFS to Fedora/Xen but do not want to ditch ZFS.
Edited by TheDave - 9/18/12 at 10:54am
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