Xen hvm Notes

Xen hvm Notes


Using HVM under Xen gives you a lot more power, but is somewhat more complicated. The following notes are for that.


http://mediakey.dk/~cc/howto-install-windows-xp-vista-on-xen/ and http://www.xensource.com/files/xen_install_windows.pdf are good sources.

Note, bug in my copy of Xen for Debian (etch). Running an hvm for the first time returns the message:

Error: Kernel image does not exist: /usr/lib/xen/boot/hvmloader

While xen-default points to /etc/alternatives/xen, there is no /usr/lib/xen in place. In order to make it as easy as possible for me to do future work, I simply create a symbolic link with the following command (as root)

ln -s /usr/lib/xen-default /usr/lib/xen

I had problems getting it to install. This note helped a lot (from http://lists.xensource.com/archives/html/xen-users/2006-06/msg00970.html):

After passing the 1st screen of windows setup of install XP, the first thing you'll see at the bottom of the screen is the option to press F6 if you need to install a SCSI or RAID controller. Don't press F6. Press F5 instead. This will take you to a separate menu of Hardware Abstraction Layer's where you can choose an appropriate HAL.The choices are:

ACPI Multiprocessor PC
ACPI Uniprocessor PC
Advanced Configuration and Power Interface (ACPI) PC
Compaq SystemPro Multiprocessor or 100% Compatible PC
MPS Uniprocessor PC
MPS Multiprocessor PC
Standard PC
Standard PC with C-Step i486

Select "Standard PC". This will allow the installation to complete in about 20 minutes.

Note I had a lot of problems passing F5 through to the running installation using krdc. I finally realized (duh) that I had to do a special keys to get it in. Also, I did not see all of the choices above, so I'm trying the Standard PC with C-Step i486.

Note VNC has some issues with screen size on this. When you get to a screen where you can't see everything, close the VNC window and re-open it. I found this out by accidentally doing it, but it seems to work consistently!

Also, I noted that the F7 key appears to bypass all acpi checks, which is likely a good thing. The following is excerpted from http://www.theeldergeek.com/clean_installation_of_windows_xp.htm: There are situations where it is definitely not desirable to use an ACPI HAL even if it is supported by the BIOS. This predominately applies to servers, but to ensure that an ACPI HAL will not be used or automatically detected and used, press F7 instead of F5 as discussed previously.

Following are some brief instructions. I'll try to flesh them out later.

# log into the server with port forwarding
ssh -L localhost:5902:localhost:5901 myserver
# Copy the winxp disk to server
dd if=/dev/cdrom of=/home/xen-store/winxpsp2.iso
# Create a partion for the root drive
lvcreate -L 10G -n winxp virtuals
# install qemu and xen-ioemu-3.0.3-1 (check the version number on the latter).
apt-get install qemu xen-ioemu-3.0.3-1
# start the install with the virtual and the cd image, putting VNC port 1 (5901) as the output
# Note: the -usbdevice tablet helps with the "drunken cursor" problem
qemu  -vnc 1 -std-vga  -usbdevice tablet -hda /dev/virtuals/kessie.loribryantcpa.local-cdrive -cdrom /home/xen-store/winxpsp3.img -boot d -m 512
# open krdc (or whatever) and connect to localhost:5902
# do install
# when asked to reboot, if it does not do it, simply kill the process



Disk Issues

When running an HVM, the "disk images" are normally just that, a device image with partitions inside it. These are more difficult to manipulate than a standard file backed device or LVM partition, so there is a separate article about that. The article is titled HVM Disk Tricks.

Running out of memory

I've always experienced that starting and stopping several virtual hosts in a xen environment, memory is not always given back entirely to the dom0 domain. In the long run, this can lead to your dom0 bailing out of memory. Luckily, there's a trick

   xm mem-set 0 256

Sets back your dom0 memory to 256M.


Windows 2000 Problems

Under qemu, during install of a Windows 2000 virtual, you can run into all sorts of problems. These problems appear to include hanging during hardware detection and "running out of disk space" errors during install. You should add the


flag to the qemu command line.


Partition Sizes

For older windows installs (ie, Win2k, WinXP+SP1), 1.5G is sufficient. However, WinXP+SP2 should have a minimum of 2-4G, and XP+SP3 will not run well with under 7G. Bottom line is, I suggest a minimum of 10G: Disk space is cheap, and resizing an NTFS partition is a royal pain.

Scripting Shutdown

The xm shutdown command does not work without the PV drivers installed, which can only be installed on Xen 3.1 or greater. To automate shutdown before then, you must tell Windows to shut itself down.

To do so:

  1. Start | All Programs | Accessories | System Tools | Scheduled Tasks
  2. Create a new task
  3. For command, enter C:\WINDOWS\system32\shutdown.exe -s -f -t 5 -c "Standard Reboot"
  4. Set the rest of the parameters as you want and save the task.

However, Windows XP will not allow unattended Shutdown. For full article, see 1

Summary is:

  1. Open Administrative Tools | "Local Security Settings"
  2. Security Settings | Local Policies | User Rights Assignment
  3. Double-click "Force shutdown from a remote system" in the right pane.
  4. Click "Add User or Group".
  5. Enter the name INTERACTIVE in the text box and click "Check names"

Xen hvm Notes

Last update:
2013-05-21 08:32
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.