HVM domain installation with Alpine linux as a guest and host OS.

Dom0: kernel 3.2.13 (Alpine linux)

xen hypervisor 4.1.3

write your own configuration file, mine is

$ cat /etc/xen/AlpineHVM.cfg

======

# -*- 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.
#============================================================================

#—————————————————————————-
# Kernel image file.
kernel = “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 = 2048

# A name for your domain. All domains must have different names.
name = “AlpineHVM”

# The number of cpus guest platform has, default=1
vcpus=4

#—————————————————————————-
# 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 = [ ‘file:/mnt/home/ruslan/alpine_hvm.img,hda,w’, ‘file:/home/ruslan/alpine-2.3.6-x86_64.iso,hdc:cdrom,r’ ]

# Device Model to be used
device_model = ‘qemu-dm’

#—————————————————————————–
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
boot=”c”

#—————————————————————————-
# enable SDL library for graphics, default = 0
sdl=1

#—————————————————————————-
# enable OpenGL for texture rendering inside the SDL window, default = 1
# valid only if sdl is enabled.
opengl=0

#—————————————————————————-
# enable VNC library for graphics, default = 1
vnc=0

#—————————————————————————-
# set password for domain’s VNC console
# default is depents on vncpasswd in xend-config.sxp
vncpasswd=”

#—————————————————————————-
# no graphics, use serial port
nographic=1

#—————————————————————————-
# 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’

===========

$ xl create -c AlpineHVM

#(new black window will open NOTE: do not run this with ssh. I spent 2 weeks debugging why this is not working and then realized that it doesnt work with ssh)

If you are booting from cdrom then you will be prompted for installation.

enter username = root

and then

$setup-alpine

this will install alpine linux.

then do

$ apk add e2fsprogs syslinux mkinitfs

====

Now your both Dom0 and DomU should have same kernels.

so mount your 3rd partition of disk at /mnt/disk/

and mount your 1st partition at /mnt/disk/boot

not install kernel from dom0 terminal using command

$ apk add –root=/mnt/disk /home/sushrut/linux-3.2.13.*.apk

Then to cross-check just open /mnt/disk/boot/extlinux.conf and it should have two entries of kernel.

I followed following tutorial to mount image disk on partition : http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux

Once your HVM domU is up, append console=ttyS0 to extra parameter. And then comment sdl=1 and add line serial=’pty’. Now you can access your domain console via ssh too.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: