Friday, March 1, 2013

gentoo/xen gaming part three

xl info

Continue on experimenting with xen i though about to share my latest experiences. Right now i'm on kernel 3.8 which brings clearly some improvements over last versions. Especially shutting down windows 7 seems to be faster then before. I'm also using the official +Gentoo xen-4.2.1 ebuilds now.

Finally i could solve my udev problem.
However it wasn't really a problem with udev nor with xen. Basically the problem was that i didn't load the tap module before starting the vm. Xen aborted the start because it couldn't create a tap device (for the network). It seems that in earlier version of udev some configurations files caused the load of the module.
However, adding the tap module to /etc/conf.d/modules did solve the problem:

 modules="nfs tun"  

Boot parameters:
Since my last posts i also got some feedback from other users.
Sandy McArthur showed me a typo in the boot parameters at my first post, which made the "pci=resource_alignmet" useless. I was surprised that xen/passthru still worked, because i though those parameters where important.
However, after fixing it, the kernel couldn't boot anymore and hang at "already setup the gsi". A quick search at google didn't show up any useful information so i just removed it. You'll see my actual boot parameters below.

Sandy McArthur also told me that RIFT may need a constant mac address in order to not have to activate it every time. Anyway, i can't say it for sure since i didn't play RIFT for a long time but his objection sound logical and so i've added a fixed mac address. +Václav Hájek also pointed out that Xen even has his own OUI (Organizational Unique Identifier) from the IEEE, thus using a mac address beginning with 00:16:3e is recommended.

Fixed mac address:

Another bug which seems to be fixed recently was a problem where xen breaks badly if you don't set xsave=1 at the boot parameters. I still don't know what exactly "xsave" does, but it's not needed anymore.

My actual boot parameters are:
 title Gentoo Linux XEN  
 root (hd0,0)  
 kernel /boot/xen.gz dom0_mem=8192M,max:8192M iommu=1 dom0_max_vcpus=4 dom0_vcpus_pin   
 module /boot/gentoo-3.8.0 root=/dev/md3 radeon.pcie_gen2=1 softlevel=xen xen-pciback.permissive xen-pciback.hide=(01:00.0)(01:00.1)(00:12.0)(00:12.2)  

There is also an ongoing work to make it possible using xen with an no-multilib profile. At my initial xen post i said xen with hvm enabled needs a multilib profile. However, +Gentoo Dev's are working to remove this dependency. You can follow the progress at bug #351648.

Right now my systems are up-to-date. (~amd64)
For the moment i don't even use any git ebuilds. It's much easier to go with the usual update flow. Windows still works flawless and very snappy, using it on a nearly daily base. Actually i'm quite addicted to Borderlands 2 and L4D2 (still the windows version). Maybe someone wants to join me in a game, my steam id is: mmike.

Below you see another screenshot of my system, running Far Cry 3 in Xen and Defcon (from +Steam) on the host over all 3 screens. With the picture in picture feature of my screen you see both games running in parallel. I should also mention that Defcon runs on VT8 while kde still runs at VT7 (whitout effects) so i can easily switch between gaming and kde - video is following the next days ;)


  1. Hi!

    Very cool!

    I was wondering - is VGA (which is used for passthrough) turned on when you boot just dom0 (no guest VM's)? I mean does the fan work, is it actually turned on or off?

    Which way did you decide to go for accessing data on hosts' hdd from domU?

    1. The VGA is turned on, you hear the fan spinning. Also lspci shows up the Graphic card, so it's not completely gone.
      About accessing data on the host: Well that's pretty simple. I have running an nfs server (well, actually not on the host). Windows (at least up from xp) supports nfs shares, you just have to enable it in windows. That's an really easy solution to share files between host and guest (especially if you already have an nfs server up ;). I hope that's what you mean?

    2. Yes, that was what I meant. But isn't network-based sharing too slow/isn't there any other possibility to create some shared folders (like Oracle's VirtualBox provides for example). This could mean no special service involved - just a driver in the VM's OS and some support in the underlying dom0.

    3. Well, as far as i know there is nfs and iscsi (in which i don't know anything about iscsi). Both you can set up directly in the xen config, so you usually don't need any additional software.
      On the performance side i would say you get what you emulate. In my setup i have an 100mbit emulated network card. Even though the real connection is 1gb (in my case - since the nfs server is on a different sys and not on the host) it would be never faster than those 100mb.
      However, 1) xen might have faster network cards to emulate which i just don't use, but i never looked at it and 2) there is the virtio driver. I actually don't know the support status within xen, but since xen use qemu to create the guests, support for virtio should be there (note: actual xen use a quite old version of qemu, that should change with xen-4.3).
      Futhermore there are drivers for windows too [1]. However i didn't test such configuration, but if it works nearly as good as on linux (i use such settings - qemu and linux guests with virtio net devices - on a different server) the performance boost would be incredibly.


  2. Though this post i get lot's of information about gentoo/xen gaming part. Thanks for it Thin Client Software & Citrix Thin Client