community.riocities.com
  • Home
  • Categories
  • Tags
  • Archives

Alpine Linux as a XEN domU

Contents

  • Preparations in dom0
  • Steps in the installer domU
  • dom0: prepare for first boot

Guide for how-to install Alpine Linux as a domU (tested on a Debian Jessie dom0).

The iso alpine-extended-3.4.4-x86_64.iso is used as that makes it possible to complete a full alpine linux installation without networking in the domU.

Preparations in dom0¶

  1. Setup storage as /dev/<lvm_vg>/<domU-name>-disk and create an ext4 file system on it. (in the examples below the VG is called vg_raid1).

  2. Optional: if you need swap create /dev/<lvm_vg>/<domU-name>-swap and add it to the domU config as xvda2

  3. Extract vmlinuz-grsec & initramfs-grsec from alpine-extended-3.4.4-x86_64.iso and store it in /home/<user>/.

  4. Setup basic domU configuration for installation from iso.

# basic config for alpine linux installation

vcpus       = '1'
memory      = '128'

kernel = "/home/<user>/vmlinuz-grsec"
ramdisk = "/home/<user>/initramfs-grsec"
extra="alpine_dev=hdc:iso9660 modules=loop,squashfs,sd-mod,usb-storage console=hvc0"


disk        = [
                  'file://home/<user>/alpine-extended-3.4.4-x86_64.iso,hdc:cdrom,r',
                  'phy:/dev/vg_raid1/<domU-name>-disk,xvda1,w',
              ]


name        = '<domU-name>'

vif         = [ 'mac=00:16:3E:AA:BB:CC,bridge=br_<domU>' ]

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

Now we can start the alpine domU and run the installer.

dom0# xl create /etc/xen/<domU-name>.cfg -c

Steps in the installer domU¶

Install e2fsprogs and mount the partition that was setup before in the dom0.

domU# apk add e2fsprogs 
domU# mount /dev/xvda1 /mnt

Run alpine setup (answer none for the last options)

domU# setup-alpine
  ...
  Enter where to store configs ('floppy', 'usb', 'xvdc1' or 'none') [xvdc1]: none
  Enter apk cache directory (or '?' or 'none') [/var/cache/apk]: none

On some test runs /etc/apk/world got a strange entry .setup-apkrepos, make sure it is not there and if it is remove that line before continuing with the next step.

Install alpine linux to the mounted partition.

domU# setup-disk /mnt

Optional: setup swap on /dev/xvda2 accordning to the Setting_up_swap instruction on the alpine wiki.

Setup basic grub configuration for pvgrub

domU# mkdir /mnt/boot/grub
domU# vi /mnt/boot/grub/grub.cfg
set timeout=2
set default=0

menuentry "alpine" {
    linux /boot/vmlinuz-grsec modules=ext4 console=hvc0 root=/dev/xvda1 
    initrd /boot/initramfs-grsec
}

Now the installation is done so we can halt the installer.

domU# halt

dom0: prepare for first boot¶

Change domU configuration to use pvgrub

vcpus       = '1'
memory      = '128'

kernel = '/usr/lib/grub-xen/grub-x86_64-xen.bin'

disk        = [
                  'phy:/dev/vg_raid1/<domU name>-disk,xvda1,w',
              ]

name        = '<domU name>'

vif         = [ 'mac=00:16:3E:AA:BB:CC,bridge=br_<domU>' ]

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

boot alpine with pvgrub

dom0# xl create /etc/xen/<domU-name>.cfg -c

Grub should show up and boot into your new alpine linux domU.


  • « Fedora as Xen domU with pv-grub
  • FiiO E10K (OLYMPUS 2-E10K) »

Published

Apr 29, 2016

Last Updated

2016-09-28 21:48:51+02:00

Author

henrik

Category

HOWTOs

Tags

  • Alpine 15
  • XEN 21

Social

  • atom feed
  • rss feed
  • ipv6 ready
  • Powered by Pelican. Theme: Elegant by Talha Mansoor