Howto Install Windows XP / Vista on Xen

This short guide describes how to install Windows XP or Windows 2003 Server on Xen. It provides an overview of the Debian Linux Etch installation, and detailed steps for installing and configuring Xen and starting the Windows XP or Windows 2003 Server
installation.

Requirements

  • CPU with either Intel’s Vanderpool (IVT – Intel Virtualization Technology) orAMD’s Pacifica Technology (AMD virtualization)
  • Windows iso-image

First you need to install Xen on Debian Etch:

sudo apt-get install xen-linux-system-2.6.18-4-xen-686 libc6-xen bridge-utils

Boot into the newly installed Xen enabled Linux kernel

sudo reboot

Then adjusted the network settings in /etc/xen/xend-config.sxp. Enabling the network bridge:

(network-script network-bridge)

Install Xen IO Emulation tools:

sudo apt-get install xen-ioemu-3.0.3-1

Create a directory for the virtual machine files e.g. /home/xen/domains/win01 and create a disk image for the virtual machine’s primary disk.

mkdir /home/xen
mkdir /home/xen/domains
mkdir /home/xen/domains/win01
sudo dd if=/dev/zero of= /home/xen/domains/win01/disk.img bs=1M count=4096

Establish a Xen machine Configuration file (/etc/xen/win01.cfg) like this

kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
memory = '256'
device_model='/usr/lib/xen/bin/qemu-dm'

# Disks
disk = [ 'file:/home/xen/domains/win01/disk.img,ioemu:hda,w',
'file:/home/cc/iso-images/WindowsXP-SP2/image.iso,ioemu:hdc:cdrom,r' ]

# Hostname
name = ‘win01′

# Networking
vif = ['type=ioemu, bridge=xenbr0']

# Behaviour
boot='d'
vnc=1
vncviewer=1
sdl=0

The ready to fire up the new machine and start the Windows installation in a vnc terminal.

xm create win01.cfg

After the virtual machine is started – a VNC server port should be available on port 5900 at the Xen server’s IP, e.g. 192.168.1.102 – A VNC XEN Client session is depicted here.

If an error like this shows up

Error: Device 0 (vif) could not be connected. Backend device not found.

You should check your that you have enabled the network bridge, “(network-script network-bridge)”, in /etc/xen/xend-config.sxp and restarted the xen deamon by /etc/init.d/xend restart

For more on creating Xen virtual machines read this guide, which outlines the features of the xen-tools package.

Comments

Howto: Resize Xen Loop Disk Image

Win4lin, KVM, QEMU, Virtualbox and Xen are all widely used technologies, used in virtual servers. Fairly often a virtual server run from within a loop filesystem and generally start with a fairly small file (1GB is big for a normal file, but not when it is pretending to be an entire filesystem!)

However things often grow over time.

Here is a nice simple procedure for increasing the size of a loop filesystem, if the filesystem is ext2 or ext3 (the procedure should work for ext4 too, but I havn’t tested it yet)

1. Stop the virtual server that is using the loop filesystem
2. Add some extra space to your loop filesystem file
# dd if=/dev/zero bs=1024k count=1024 >> loop_image_file

This adds 1GB to the end of a file called loop_image_file (make sure to use the append output redirector >> not a single >, otherwise you’ll have an empty 1GB file!)

3. Force a check on the resized/increased filesystem
# e2fsck -f loop_image_file

4. Resize the filesystem within the loop filesystem file
# resize2fs loop_image_file

5. Start the virtual server again

Comments off

Howto: Create your own Debian or Ubuntu package repository

The Debian package management system (called Advanced Packaging Tool or APT) is by far the most well-designed and is one of the top killer features on the Linux platform.

This short Howto describes howto establish a Debian package repository for home-grown deb-packages or like (could be used for Ubuntu as well, since Ubuntu uses the Debian package management system).

Establish repository structure
Create the repository structure in a directory. E.g. in ~/public_html directory exposed to the web.


cd public_html
mkdir my-repository
cd my-repository
mkdir binary
mkdir source

Copy your deb-packages into the repository

Like this
cp src/bzr_0.11-1.1_all.deb public_html/my-repository/binary/

Install the tools to be able to create a repository index

sudo aptitude install dpkg-dev

Create a repository index
cd my-repository
dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz

Using the repository


# Add these two lines into the /etc/apt/sources.list
deb http://mediakey.dk/~cc/my-repository binary/
deb-src http://mediakey.dk/~cc/my-repository source/

Feel free to comment – easier methods and tips are more than welcome ;)

For a more professional package management setup, use reprepro

Comments

Howto Install Sun Java on Debian Etch

This small guide shows how to install the original Sun Java 2 Platform Standard Edition 5.0 JRE (Java Runtime Environment) and JDK (Java Developer Kit) on Debian 4.0 Etch
.

The original Sun Java 2 is available in the ‘non-free’ section of the Debianrepositories. To enable this section first add the non-free repository to the apt sources file – the /etc/apt/sources.list should look like, – important parts are in bold:


deb http://ftp.us.debian.org/debian/ etch main contrib non-free

Now, update apt:

sudo apt-get update

Then install the Java debian packages.

sudo apt-get install sun-java5-jre

Or this for installing the JDK ( the Java SDK )

sudo apt-get install sun-java5-jdk

Comments off

Xen Howto: Install Windows

This short guide describes how to install Windows XP orWindows 2003 Server on Xen. It provides an overview of theDebian Linux Etch installation, and detailed steps for installing and configuring Xenand starting the Windows XP or Windows 2003 Server
installation.

Requirements

  • CPU with either Intel’s Vanderpool (IVT – Intel Virtualization Technology) orAMD’s Pacifica Technology (AMD virtualization)
  • Windows iso-image

First you need to install Xen on Debian Etch:

sudo apt-get install xen-linux-system-2.6.18-4-xen-686 libc6-xen bridge-utils

Boot into the newly installed Xen enabled Linux kernel

sudo reboot

Then adjusted the network settings in /etc/xen/xend-config.sxp. Enabling the network bridge:

(network-script network-bridge)

Install Xen IO Emulation tools:

sudo apt-get install xen-ioemu-3.0.3-1

Create a directory for the virtual machine files e.g. /home/xen/domains/win01 and create a disk image for the virtual machine’s primary disk.

mkdir /home/xen
mkdir /home/xen/domains
mkdir /home/xen/domains/win01
sudo dd if=/dev/zero of= /home/xen/domains/win01/disk.img bs=1M count=4096

Establish a Xen machine Configuration file (/etc/xen/win01.cfg) like this

kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
memory = '256'
device_model='/usr/lib/xen/bin/qemu-dm'

# Disks
disk = [ 'file:/home/xen/domains/win01/disk.img,ioemu:hda,w',
'file:/home/cc/iso-images/WindowsXP-SP2/image.iso,ioemu:hdc:cdrom,r' ]

# Hostname
name = ‘win01′

# Networking
vif = ['type=ioemu, bridge=xenbr0']

# Behaviour
boot='d'
vnc=1
vncviewer=1
sdl=0

The ready to fire up the new machine and start the Windows installation in a vnc terminal.

xm create win01.cfg

After the virtual machine is started – a VNC server port should be available on port 5900 at the Xen server’s IP, e.g. 192.168.1.102 – A VNC XEN Client session is depicted here.

If an error like this shows up

Error: Device 0 (vif) could not be connected. Backend device not found.

You should check your that you have enabled the network bridge, “(network-script network-bridge)”, in /etc/xen/xend-config.sxp and restarted the xen deamon by /etc/init.d/xend restart

For more on creating Xen virtual machines read this guide, which outlines the features of the xen-tools package.

Comments off

Howto setup SPF (Sender Policy Framework) on a domain

SPF is a Policy Framwork that helps fighting return-path address forgery and makes it easier to identify spoofs. Domain owners identify and pinpoint sending mail servers in a DNS record, and thereby its posible for SMTP receivers (e.g. MTAs like Exim, Postfix, Qmail etc.) to verify the envelope sender address against this information, and can distinguish authentic messages from forgeries before any message data is transmitted.

Create a SPF record
The easist way to create a SPF record is to use this online tool: openspf

Deploy the SPF record
To use the newly created SPF record on a domain, make sure you have access to create a TXT-DNS record for the given domain. If you have access to create a TXT-DNS record all you need is to create such a TXT-DNS record containing the SPF record information, and you are done.

Comments off