Creating paravirtualized CentOS 5.3 DomU on OpenSolaris 2009.06 Dom0

Setup OpenSolaris Dom0

First Step is to setup xVM Hypervisor on the OpenSolaris 2009.06 machine.

Follow the steps mentioned at following link and setup Dom0 OpneSolaris 2009.06.
http://hub.opensolaris.org/bin/view/Community+Group+xen/2008_11_dom0

Create a RAW disk image for the DomU installation

mkdir /centos53-pv/
cd /centos53-pv/
dd if=/dev/zero of=CentOS-5.3-x86_64.img bs=1k seek=10000k count=1

Enable xvm/virtd service on Dom0

svcadm enable svc:/system/xvm/virtd:default

Begin the Paravirtualized CentOS DomU installation with the virt-install command

virt-install -n centos53_x86_64 \
-r 1024 \
-f /centos53-pv/CentOS-5.3-x86_64.img \
-p --nographics \
-l http://mirrors.kernel.org/centos/5.3/os/x86_64/

In the above command -n is for the name of the domu, -r is for the memory, -f is for specifying location of the raw disk on which installation will be performed, -p is for specifying paravirtualized mode and -l is for the location containing an installable distribution image.

Follow the regular CentOS installation steps and reboot the DomU when prompted.

Following snapshots walk you through CentOS DomU installation.

Cent_OS_domu_Install_Screens

After reboot enable ssh login for root user on DomU

uncomment the line “PermitRootLogin yes” from “/etc/ssh/sshd_config” file and save it.

Extract kernel and ramdisk from the running DomU image

Copy “/boot/vmlinuz-2.6.18-128.el5xen” and “/boot/initrd-2.6.18-128.el5xen.img” files to Dom0 machine at “/centos53-pv/”.

scp  /boot/vmlinuz-2.6.18-128.el5xen root@dom0-ip:/centos53-pv/
scp  /boot/initrd-2.6.18-128.el5xen.img root@dom0-ip:/centos53-pv/

Halt the DomU.

Shutdown domU issuing halt command inside domU and remove a domain from Xend domain management using following command.

# xm delete centos53_x86_64

Create a domain configuration file as given below.

Create “/centos53-pv/domu.py” file as given below

# cat domu_64.py
name = "centos53_x86_64"
memory = "2058"
kernel = "/centos53-pv/vmlinuz-2.6.18-128.el5xen"
ramdisk = "/centos53-pv/initrd-2.6.18-128.el5xen.img"
disk = ['file:/centos53-pv/CentOS-5.3-x86_64.img,xvda,w']
vif = ['']

Relaunch the DomU by passing extracted kernel and ramdisk images using py script.

# xm create domu.py
Using config file "./domu.py".
Started domain centos53_x86_64

Access domU console

# xm console centos53_x86_64



Cent OS 5.3 Paravirtualized DomU VNC Session on OpenSolaris 2009.06 Dom0

Create a fully virtualized ubuntu-9.04 DomU on Sun xVM Hypervisor

Share/Save/Bookmarka2a_linkname=”Create a fully virtualized ubuntu-9.04 DomU on Sun xVM Hypervisor”;a2a_linkurl=”http://blogs.sun.com/divyen/entry/create_a_fully_virtualized_ubuntu”;

Lets begin with the installation of xVM Hypervisor on OpenSolaris 2008.11.

You can follow exact steps mentioned on Dileep Kumar’s blog – “How to create domU in OpenSolaris 2008.05“. These steps are also valid for OpenSolaris 2008.11.

Once dom0 is up and running, walk through the below given steps to create a fully virtualized ubuntu 9.04 DomU. Fully virtualized DomU is also known as HVM Domain (Hardware-assisted Virtual Machine Domain), with that you can run unmodified guest operating system without the knowledge of underlying hypervisor.

Step-1: Download and save ubuntu 9.04 ISO file at /ubuntu-hvm

mkdir /ubuntu-hvm
cd /ubuntu-hvm
wget http://ftp.ucsb.edu/pub/mirrors/linux/ubuntu/jaunty/ubuntu-9.04-desktop-i386.iso

Step-2: Create a virtual Disk for the guest domain.

dd if=/dev/zero of=/ubuntu-hvm/ubuntu-9.04-desktop-i386.img bs=1k seek=10000k count=1

Step-3: Create guest configuration file install.py with following script at /ubuntu-hvm

Detailed explanation on each lines used in the script is given here.

disk = ['file:/ubuntu-hvm/ubuntu-9.04-desktop-i386.img,hda,w','file:/ubuntu-hvm/ubuntu-9.04-desktop-i386.iso,hdc:cdrom,r']
memory = 1024
vcpus=1
name = "ubuntu-904-hvm-install"
kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
vif = [ '' ]
on_poweroff = 'destroy'
on_reboot   = 'destroy'
on_crash    = 'destroy'
boot='dc'
vnc=1
sdl=0
vncdisplay=5
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'

Launch the guest domain to begin the installation.

cd /ubuntu-hvm/
xm create install.py

Bring up VNC Session to proceed with the installation. In the install.py script we specified to bind VNC on port 127.0.0.1:5

vncviewer 127.0.0.1:5

If HVM guest is unsupported on your system, you may see following error message.
Error: HVM guest support is unavailable: is VT/AMD-V supported by your CPU and enabled in your BIOS?

Step-4: Install guest domain.

Snap-01

Snap-02

Snap-03

Snap-04

Snap-05

Do not click on the restart. Follow step-5 instead.

Step-5: Destroy the guest domain and create new configuration file to boot the domU from the disk image.

xm destroy ubuntu-904-hvm-install
cd /ubuntu-hvm/

Create new configuration file “domu.py” with following script at /ubuntu-hvm

disk = ['file:/ubuntu-hvm/ubuntu-9.04-desktop-i386.img,hda,w']
memory = 1024
vcpus=1
name = "ubuntu-904-hvm-guest"
kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
vif = [ '' ]
on_poweroff = 'destroy'
on_reboot   = 'destroy'
on_crash    = 'destroy'
boot='c'
vnc=1
sdl=0
vncdisplay=5
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'

Step-6: Finally launch the HVM guest domain

cd /ubuntu-hvm/
xm create domu.py

Bring up VNC Session

vncviewer 127.0.0.1:5

Snap-05

Snap-06