Fedora-T61-Xen
From skinetwork
[edit] Installing Windows XP on xen using HVM : Fedora 7 - T61 - T7300
This article does not xen kernel installation, see this link for xen-setup quick steps.
See how it looks quickly at the end of this page.
I will be trying this tonight and will update the wiki. Here is my xm info.
host : mobile release : 2.6.20-2925.9.fc7xen version : #1 SMP Tue May 22 08:53:03 EDT 2007 machine : i686 nr_cpus : 2 nr_nodes : 1 sockets_per_node : 1 cores_per_socket : 2 threads_per_core : 1 cpu_mhz : 1995 hw_caps : bfebfbff:20100000:00000000:00000140:0000e3bd:00000000:00000001 total_memory : 1006 free_memory : 61 xen_major : 3 xen_minor : 1 xen_extra : .0-rc7-2925.9.f xen_caps : xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xf5800000 xen_changeset : unavailable cc_compiler : gcc version 4.1.2 20070502 (Red Hat 4.1.2-12) cc_compile_by : kojibuilder cc_compile_domain : (none) cc_compile_date : Tue May 22 08:51:22 EDT 2007 xend_config_format : 4
Update: It was easier than I thought ;-) . Using the fully virtualized config to run windows. Used the Virtual Machine Manager, that came with fedora and was just an easy setup. Works awesome!!
Here is the summary of running windows hvm on xen: - Initially I started with virsh and Virtual Machine Manager. Using this is little bit different with configuration files as it write configuration in XML and stores in the database. We have to retrieve xml using virsh dumpfile, do changes and then do virsh define xmlfile. Well, using the virt-manager, while installing windows, it reports of the problem "File not found - asam" or something, insert Windows XP Professional disk. I got around this problem as follows:
virsh dumpfile xen-winxp > xen-winxp.xml
vim xen-winxp.xml
then added the entry for the disk cdrom as below
<disk type='block' device='cdrom'>
<driver name='phy' />
<source dev='/dev/cdrom' />
<target dev='hdc' />
<readonly />
</disk>
and as the default boot device
<boot dev='cdrom'/>
After changes, define the xml to db.
virsh define xen-winxp.xml
Later the windows went smooth.
- Windows installed fine, however, I had this problem with mouse in the console and pointer sync. There are work around for this problem, see this link
Well, since my vm is defined in xml, it was problematic to find any documents on xen xml rpc bindings and I couldn't find examples for all the xml tags. So I switched back to the xen original configuration. The mouse problem was solved with defining usbdevice='tablet'. Here is my winxp.hvm configuration file with original and xml formats.
winxp.hvm configuration file (non xml-rpc xen config file)
# -*- mode: python; -*-
#============================================================================
# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using 'xm create'.
# You use a separate script for each domain you want to create, or
# you can set the parameters for the domain on the xm command line.
#============================================================================
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
#----------------------------------------------------------------------------
# Kernel image file.
kernel = "/usr/lib/xen/boot/hvmloader"
# The domain build function. HVM domain uses 'hvm'.
builder='hvm'
# Initial memory allocation (in megabytes) for the new domain.
#
# WARNING: Creating a domain with insufficient memory may cause out of
# memory errors. The domain needs enough memory to boot kernel
# and modules. Allocating less than 32MBs is not recommended.
memory = 128
# Shadow pagetable memory for the domain, in MB.
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
# shadow_memory = 8
# A name for your domain. All domains must have different names.
name = "winxp_hvm"
# 128-bit UUID for the domain. The default behavior is to generate a new UUID
# on each call to 'xm create'.
#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"
#-----------------------------------------------------------------------------
# The number of cpus guest platform has, default=1
#vcpus=1
# Enable/disable HVM guest PAE, default=1 (enabled)
#pae=1
# Enable/disable HVM guest ACPI, default=1 (enabled)
#acpi=1
# Enable/disable HVM APIC mode, default=1 (enabled)
# Note that this option is ignored if vcpus > 1
#apic=1
# List of which CPUS this domain is allowed to use, default Xen picks
#cpus = "" # leave to Xen to pick
#cpus = "0" # all vcpus run on CPU0
#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
# Optionally define mac and/or bridge for the network interfaces.
# Random MACs are assigned if not given.
vif = [ 'type=ioemu, mac=00:16:3e:00:00:14, bridge=xenbr0, model=ne2k_pci' ]
# type=ioemu specify the NIC is an ioemu device not netfront
# vif = [ 'type=ioemu, bridge=virbr0' ]
# vif = [ 'type=ioemu, bridge=xenbr0' ]
#----------------------------------------------------------------------------
# Define the disk devices you want the domain to have access to, and
# what you want them accessible as.
# Each disk entry is of the form phy:UNAME,DEV,MODE
# where UNAME is the device, DEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.
#disk = [ 'phy:hda1,hda1,r' ]
#disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
# disk = [ 'phy:/dev/VMGuests/winxp_xen1,ioemu:hda,w' ]
disk = [ 'phy:/dev/VMGuests/example,ioemu:hda,w' ]
#----------------------------------------------------------------------------
# Configure the behaviour when a domain exits. There are three 'reasons'
# for a domain to stop: poweroff, reboot, and crash. For each of these you
# may specify:
#
# "destroy", meaning that the domain is cleaned up as normal;
# "restart", meaning that a new domain is started in place of the old
# one;
# "preserve", meaning that no clean-up is done until the domain is
# manually destroyed (using xm destroy, for example); or
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
# The default is
#
# on_poweroff = 'destroy'
# on_reboot = 'restart'
# on_crash = 'restart'
#
# For backwards compatibility we also support the deprecated option restart
#
# restart = 'onreboot' means on_poweroff = 'destroy'
# on_reboot = 'restart'
# on_crash = 'destroy'
#
# restart = 'always' means on_poweroff = 'restart'
# on_reboot = 'restart'
# on_crash = 'restart'
#
# restart = 'never' means on_poweroff = 'destroy'
# on_reboot = 'destroy'
# on_crash = 'destroy'
#on_poweroff = 'destroy'
#on_reboot = 'restart'
#on_crash = 'restart'
#============================================================================
# New stuff
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
#boot="cda"
# cdrom="/network/windows/data/software/microsoft/Windows_XP_Pro.iso"
boot="c"
#-----------------------------------------------------------------------------
# write to temporary files instead of disk image files
#snapshot=1
#----------------------------------------------------------------------------
# enable SDL library for graphics, default = 0
sdl=0
#----------------------------------------------------------------------------
# enable VNC library for graphics, default = 1
vnc=1
#----------------------------------------------------------------------------
# address that should be listened on for the VNC server if vnc is set.
# default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp
#vnclisten="127.0.0.1"
#----------------------------------------------------------------------------
# set VNC display number, default = domid
# vncdisplay=1
#----------------------------------------------------------------------------
# try to find an unused port for the VNC server, default = 1
#vncunused=1
#----------------------------------------------------------------------------
# enable spawning vncviewer for domain's console
# (only valid when vnc=1), default = 0
#vncconsole=0
#----------------------------------------------------------------------------
# set password for domain's VNC console
# default is depents on vncpasswd in xend-config.sxp
vncpasswd=''
#----------------------------------------------------------------------------
# no graphics, use serial port
#nographic=0
#----------------------------------------------------------------------------
# enable stdvga, default = 0 (use cirrus logic device model)
stdvga=0
#-----------------------------------------------------------------------------
# serial port re-direct to pty deivce, /dev/pts/n
# then xm console or minicom can connect
serial='pty'
#-----------------------------------------------------------------------------
# Qemu Monitor, default is disable
# Use ctrl-alt-2 to connect
#monitor=1
#-----------------------------------------------------------------------------
# enable sound card support, [sb16|es1370|all|..,..], default none
#soundhw='sb16'
#-----------------------------------------------------------------------------
# set the real time clock to local time [default=0 i.e. set to utc]
#localtime=1
#-----------------------------------------------------------------------------
# set the real time clock offset in seconds [default=0 i.e. same as dom0]
#rtc_timeoffset=3600
#-----------------------------------------------------------------------------
# start in full screen
#full-screen=1
#-----------------------------------------------------------------------------
# Enable USB support (specific devices specified at runtime through the
# monitor window)
usb=1
# Enable USB mouse support (only enable one of the following, `mouse' for
# PS/2 protocol relative mouse, `tablet' for
# absolute mouse)
# usbdevice='mouse'
usbdevice='tablet'
#-----------------------------------------------------------------------------
# Set keyboard layout, default is en-us keyboard.
#keymap='ja'
Note that I enabled vnc above for guest OS and usbdevice='tablet' to resolve the mouse issues. Windows configures this usb tablet device automatically and you should your vnc mouse sync with no problems.
winxp.xml configuration file using xen xml-rpc config file
<domain type='xen' id='22'>
<name>example_xen1</name>
<uuid>e00e011588b9bc63d27225f0285d71d4</uuid>
<os>
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
</os>
<memory>131072</memory>
<vcpu>1</vcpu>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
</features>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<interface type='bridge'>
<source bridge='eth0'/>
<mac address='00:16:3e:3a:3b:73'/>
<script path='vif-bridge'/>
</interface>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/VMGuests/example'/>
<target dev='hda'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='phy' />
<source dev='/dev/cdrom' />
<target dev='hdc' />
<readonly />
</disk>
<graphics type='vnc' port='5900'/>
<console tty='/dev/pts/3'/>
<usb>
<mouse/>
</usb>
</devices>
</domain>
- In this process, I learned that vmxloader is later called hvmloader, so don't panic that you are missing something called vmxloader.
- Things were good at this point and wanted to make it fancy. This is how it looks currently:
- The maximum resolution the Cyrrus graphics console allows in 1280x1024 and with that fullscreen on my T61 14" screen which is 1440x900 looks bad. Well, I wanted to try remote desktop since I can use custom resolutions. For remote desktop I need networking on the guest windows. Well without network, what the hell the xp guest can do for me ;-). If you look at the config file, I configured network to use xenbr0 and it was piece of cake, I have had no problem with xp detected the nic, installing drivers and my dhcp server happily assigned an ip adress to it. I enabled remote desktop on windows, not required vnc console anymore.
yum install rdesktop rdesktop -D -B -f -K -g 1440x870 -r clipboard:CLIPBOARD mobux-winxp-xen:3389
- Its 1440x870 and not 1440x900 because I wanted to use the kde toolbar. See below picture of how it looks. I usually run windows on Desktop 2 and linux stuff on Desktop 1. So if you have hot key configured to switch between desktop, its just the key to see the windows world :-D . -D to remove any window decorations
THIS IS HOW MY T61 LOOKS NOW ;-)
Use the discussion link above for discussions and questions. skanuganti@skinetwork.org Also please free to edit this page with your findings.


