Create Alpine Linux PV DomU

From Alpine Linux
Revision as of 07:07, 30 December 2011 by Roger.pau (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

To create an Alpine Linux PV DomU you will need a Dom0 and an Alpine Linux iso, here we will use the "mini" iso. The first step it to mount the image and extract the kernel and initramfs images:

# mkdir -p /mnt/alpine_iso
# mount -o loop /path/to/the/iso /mnt/alpine_iso
# cp /mnt/alpine_iso/boot/grsec /path/to/save/kernel/
# cp /mnt/alpine_iso/boot/grsec.gz /path/to/save/kernel/
# umount /mnt/alpine_iso
# rm -f /mnt/alpine_iso

Now we have the kernel at /path/to/save/kernel/grsec and the initramfs at /path/to/save/kernel/grsec.gz. Now we should create an empty file, that will be the hard drive of the DomU, you can also use a physical partition if you like (in this example we are using a 2GB disk):

# dd if=/dev/zero of=/path/to/disk.img bs=1M count=2000

The next step is to create a basic configuration file, so we can launch the DomU (save it where you like, although the most common place is /etc/xen/).

# Alpine Linux PV DomU

# Kernel paths for install
kernel = "/path/to/save/kernel/grsec"
ramdisk = "/path/to/save/kernel/grsec.gz"
extra="alpine_dev=xvdc:iso9660 modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/grsec.modloop.squashfs"

# Path to HDD and iso file
disk = ['file:/path/to/disk.img,xvda,w']
disk = ['file:/path/to/the/iso,xvdc:cdrom,r']

# Network configuration
vif = ['bridge=br0']

# DomU settings
memory = 128
name = "alpine"
vcpus = 1

Now that we have all the necessary files, we can start the DomU to proceed with the install:

# xl create -c /path/to/conf