AIR Wiki : SNEmasterHowtos

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Howto



A) Ubuntu 6.10 (Edgy Eft) standard installation



1. Preliminary work in BIOS

2. Boot from the Ubuntu 6.10-desktop DVD-Rom. In the first screen that you will be
presented with, select 'Start or install Ubuntu'. As the LiveCD loads, double-click
the 'Install' icon on the desktop.

3. Choose your language, location, time zone, keyboard layout, etc.

4. Create your own username/password. (Remember it!)

5. Select 'Manually edit partition table' to create customized partitions:
#
* sda1 - swap - 1GB
* sda2 - / - the rest space (Bootable flag on)
#

NOTE: We use the first disk (sda) for the installation of Ubuntu/Xen/VMs, you can
play with the sdb later.

6. Start to install... have a cup of coffee.

7. After copying files completed, reboot.

The basic Ubuntu installation is done!



B) Xen installation



NOTE: In Ubuntu 6.10 (Edgy Eft), there is no need to build and compile Xen from
source. this is no longer necessary. You can easily convert the existing running
Ubuntu Edgy install so that the Dom0 is your current setup.

1. Login to the Ubuntu machine you installed. Switch to root if you don't want
to type 'sudo' at the beginning of every command later.

2. Enable universe in /etc/apt/sources.list

3. Update the system and install nessecary packages. Run the following commands in a Terminal:

apt-get update
apt-get upgrade
apt-get install xen-hypervisor-3.0-i386 xen-image-xen0-2.6.17-6-generic-xen0 xen-utils-3.0 xen-ioemu-3.0 xen-tools bridge-utils

NOTE: This will install the XEN hypervisor, the kernel used by the guest host
and guest domains, and the userspace utilities used for working with Xen domains.

4. Create an initrd image:

mkinitramfs -o /boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img 2.6.17-6-generic-xen0

5. Setup grub. Add the following lines to /boot/grub/menu.lst :

title XEN/2.6.17
root (hd0,1)
kernel /boot/xen-3.0-i386.gz
module /boot/xen0-linux-2.6.17-6-generic-xen0 root=/dev/sda2 ro
module /boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img

NOTE: The root path is based on the partition we created during the Ubuntu install.
In this case, it is sda2.

NOTE: Make sure the Xen kernel is the default boot one. Otherwise you need select
from the boot menu every time.

6. Reboot. When the system is back up try the following command to verify
that everything is ok:

sudo xm list

You will see something like:

Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 1863 1 r - - 42.3

The installation of Xen Dom0 is done!



C) Xen working environment configuration



1. Setup SSH server for remote access

apt-get install openssh-server

2. Setup DHCP server
2.1 Install package
apt-get install dhcp3-server
2.2 Configure file:
# /etc/default/dhcp3-server
INTERFACES="eth2"

2.3 Edit /etc/dhcp3/dhcpd.conf

# Network for Xen DomU in gbon.studlab.os3.nl
subnet 145.92.25.80 netmask 255.255.255.248 {
range 145.92.25.82 145.92.25.86;
option domain-name-servers 145.92.26.2, 145.92.26.5;
option domain-name "gbon.practicum.os3.nl";
option routers 145.92.25.81;
option broadcast-address 145.92.25.87;
default-lease-time 600;
max-lease-time 7200;
}

2.4 Start DHCP server
sudo /etc/init.d/dhcp3-server start/stop/restart

3. Setup DNS server

No introduction. Refer to os3 wiki

4. Enable IP forwarding.
4.1 Display
cat /proc/sys/net/ipv4/ip_forward

4.2 Change manually
echo 1 > /proc/sys/net/ipv4/ip_forward

4.3 Permanent change in file /etc/sysctl.conf add
net.ipv4.ip_forward=1


D) DomU installation



1. Install the Hardware Virtual Machine: Windows XP

1.1 Make an image for your XP installation.

dd if=/dev/zero of=/vm-images/WinXP.img bs=1M count=4096

NOTE: 4096 is the number of megabytes so mine is 4 gigs, pick an appropriate size for your needs.

1.2 Use the provided .iso or create your own from CD/DVD-Rom:

dd if=/dev/cdrom of=/vm-ISOs/winXP.iso

1.3 Edit /etc/xen/winxp.hvm


kernel = '/usr/lib/xen-ioemu-3.0/boot/hvmloader'
builder = 'hvm'
memory = 512
name = 'WinXP'
vcpus = 1
device_model = '/usr/lib/xen-ioemu-3.0/bin/qemu-dm'
vif = [ 'type=ioemu,mac=00:16:3e:40:38:8a,bridge=xenbr2' ]
disk = [ 'file:/vm-images/winxp.img,ioemu:hda,w', 'file:/vm-ISOs/WinXP.iso,hdc:cdrom,r' ]
stdvga = 0
sdl = 0
vnc = 1
vncviewer = 1
ne2000 = 1
localtime = 1
on_poweroff = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'
# put 'd' when install new os
boot = 'c'


1.4 Boot from iso file and install XP

xm create winxp.hvm

1.5 After the installation is completed, change [boot='c'] in /etc/xen/winxp.hvm to
boot from img file.


2. Install HVM with other OSs

Only make several changes in the config file with other names and disk booting ISOs.
The rest steps are similar as installing Windows.

3. Non-HVM guest using the same kernel image that was used for dom0
3.1 use loopback-mounted-file
3.2 use raw partition
See https://help.ubuntu.com/community/XenVirtualMachine/XenOnUbuntuEdgy for detail.



E) Network configuration



1. To adjust the network settings that XEN will use, you need to modify the file
/etc/xen/xend-config.sxp in which the xend daemon is configured.

# we do our ownconfig here #
#(network-script network-bridge)

#
# Your default ethernet device is used as the outgoing interface, by default.
# To use a different one (e.g. eth1) use
#
# (network-script 'network-bridge netdev=eth1')
#
# The bridge is named xenbr0, by default. To rename the bridge, use
#
# (network-script 'network-bridge bridge=<name>')
(network-script 'INR-start') <-- use your own script

2. Create xenbr0, xenbr1, xenbr2 , in /etc/xen/scripts/INR-start

#!/bin/sh
/etc/xen/scripts/network-bridge start vifnum=0 bridge=xenbr0 netdev=eth0 $*
/etc/xen/scripts/network-bridge start vifnum=1 bridge=xenbr1 netdev=eth1 $*
/etc/xen/scripts/network-bridge-eth2 start vifnum=2 bridge=xenbr2 netdev=eth2 $*

3. Edit /etc/xen/scripts/network-bridge-eth2 to rename the veth2 to eth2, assign a /29 IP
address to eth2. For example:

# add $vdev interface here
# todo: other IP address fill in
create_bridge ${bridge} mac="00:16:3E:06:01:01"

if link_exists "$vdev"; then
ip link set ${vdev} name ${netdev}

setup_bridge_port ${vif0}
ip link set ${netdev} addr ${mac} arp on
ip link set ${bridge} up
add_to_bridge ${bridge} ${vif0}

ifconfig ${netdev} 145.92.25.81 netmask 255.255.255.248 up
ip link set dev ${netdev} up
else
# old style without ${vdev}
transfer_addrs ${netdev} ${bridge}
transfer_routes ${netdev} ${bridge}
fi

4. To stop/delete the virtual interface, use the similar commands. (See script for details).

5. restart the Xen daemon
xend restart

6. Browse the bridge status, run command:
brctl show

If everything goes well, you should see like this:
bridge namebridge id STP enabled interfaces
xenbr0 8000.feffffffffff no peth0
vif0.0
xenbr1 8000.feffffffffff no peth1
vif0.1
xenbr2 8000.5a5edb8079f8 no vif0.2



F) VNC on Dom0/DomU



1. For Ubuntu 6.10 on Dom0, select in menu
System -> Preference -> Remote Desktop

to activate the remote desktop access.

2. For Windows on DomU, install some VNC server software. e.g. TightVNC to
enable the remote control.




Reference:


- https://help.ubuntu.com/community/
- http://www.debian-administration.org/
- http://www.xensource.com/xen/xen/
- http://www.howtoforge.com/
- http://www.digg.com/linux_unix/

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0476 seconds