Debian Lenny/Squeeze + WindowsXP + HVM HOWTO/setup

Debian Lenny/Squeeze + WindowsXP + HVM HOWTO/setup
Author: Scott Grayban
Send any corrections to sgrayban @ gmail.com


Step 1:
Pre-Requisites for Installing a Windows Xen Guest

A XEN kernel must be installed and running at boot time.

Make sure you have HVM/VMX enabled in the bios - if you don't have this you can't run windows

In console type

xm dmesg | grep VMX

You should see...

(XEN) HVM: VMX enabled

If you don't you will need to restart the server and get into the BIOS and look for an option related to virtualization support.

If your BIOS does NOT have this you can not run any HVM guests, that means you can not run any version of Windows.


Step 2:
Turn off VNC for all xen linux guests and restart them.


Step 3:
---- pico|nano|vi /etc/xen/scripts/qemu-ifup

#!/bin/sh

echo -c 'config qemu network with xen bridge for '

echo $*

ifconfig $1 0.0.0.0 up

brctl addif eth0(your bridge) $1

---- save file


Step 4:
---- Change to the xen directory for the rest of the steps

cd /xen/

---- create blank 80GB disk img
dd if=/dev/zero of=xenwin.img bs=1024k seek=81920 count=0

apt-get install libcdio-utils

---- get cd/dvd info and make sure its the right one

cd-info /dev/(s|h)da

---- create the WindowsXP ISO
dd if=/dev/(s|h)da of=Windows.iso


Step 5:
---- pico|nano|vi xenwin.cfg

kernel = "/usr/lib/xen-default/boot/hvmloader"

builder = 'hvm'

vif = [ 'type=ioemu,bridge=eth0,ip=assigned-ip,mac=22:61:34:00:00:01' ] MAC address has to start with 22:61:34 or 00:16:3e

address = 'assigned-ip'

netmask = '255.255.255.XXX'

memory = 1024

shadow_memory = 8

name = "xenhvm" # domain prefix name

cdrom = 'file:/xen/Windows.iso' # name of iso image you created above

disk = [ 'file:/xen/xenwin.img,hdc,w', 'file:/xen/Windows.iso,hdb:cdrom,r' ]

device_model = '/usr/lib/xen-default/bin/qemu-dm'

# boot on floppy (a), hard disk (c) or CD-ROM (d)

# default: hard disk, cd-rom, floppy

#### boot must be dc to install windows after that you change it to c or cd

boot = "dc"

#boot = "c"

vnc = 1 # use VNC to insall and setup windows after that is done you can disable this

vncconsole = 0

vncpasswd = 'password'

vncviewer = 1

vncunused = 1

vnclisten = 'Domain-0 IP'

vcpus = 2 # number of cpu's to assign

stdvga = 0

serial = 'pty'

usbdevice = 'tablet' # Required for USB mouse

on_reboot = 'restart'

on_crash = 'restart'

--------- save cfg


Step 6:
---- Type the next 2 commands in console

xm create xenwin.cfg

brctl show ## Make sure that the tapX interface is assign to ethX you set in bridge= vif setting

bridge name     bridge id               STP enabled     interfaces
eth0            8000.001b215ceb01       no              peth0
                                                        tap0
                                                        vif19.0
                                                        vif22.0
                                                        vif23.0


Step 7
:
---- Type the next command in console

vncviewer assigned-ip

and continue with the windows install and setup


Step 8:
Setup your windows networking using the correct IP/mask/gateway/dns
Setup remote desktop access if you need/want it


Step 9:
Turn VNC off in the xenwin.cfg file -> vnc = 0
### This step has to be done because XEN/qemu-dm will force the port to be 5900 and it will interfere with the other xen linux vnc guests.


Step 10:
Re-enable vnc for the xen linux guests if you turned them off in Step 2 and restart the guests.


Step 11:
Import the windows instance into Cloudmin
Add System -> Add Xen instance


Step 12:
You're done.

You should be able to access the windows server via RDP(remote desktop) as Administrator and start/stop/reboot and manage the windows guest as a normal windows server.

That means you can run the updates or install any windows apps that you might need.

!! NOTE !!

Passwords/ISO/IMG:
The default passwords for Administrator and new user is temp1234 if you are using the paid version of my WindowsXP img file that is fully functional and ready to use.

YOU MUST HAVE already bought WindowsXP and have a valid license to get the XEN img file, at order time you will have to electronically sign that agreement. Otherwise you can buy the WindowsXP iso from me if you do not have one.

Cloudmin might offer a free Windows ISO at some point.

Prices:
WindowsXP ISO – $25
WindowsXP XEN IMG – $500

You can email me at sgrayban @ borgnet.net to order the iso and/or img file(s).

Was this answer helpful?

 Print this Article