Alpine Linux in VirtualBox

I’ve been playing with Alpine Linux on VirtualBox, and here are some notes I took during the process.

Installation

Let’s get started:

Applications

Pandoc

For Pandoc we need to install Haskell and a few more things first:

# apk add cabal ghc libc-dev zlib-dev
# cabal update
# cabal install pandoc

Create Users

You don’t want to be root all the time:

Shell

My favourite shell is zsh:

Connect to Another VM

Let’s repeat the process, so that we can ssh from one VM to another:

Xfce

Xfce is a nice and snappy desktop environment. The install instructions are very straightforward:

# setup-xorg-base
# apk add xfce4 xfce4-terminal lightdm-gtk-greeter xfce4-screensaver dbus-x11
# apk add virtualbox-guest-additions virtualbox-guest-modules-virt
# rc-service dbus start
# rc-service lightdm start

By default one can’t shutdown or reboot from the Xfce UI, though; easy fix:

Networking from ISO Image

When booting from the ISO image, all changes are lost!

Write this into /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Then type the command /etc/init.d/networking restart and you should be able to ping google.com once again.

Cloning VMs

When cloning VMs in VirtualBox, pay attention to the fact that it also clones the MAC address of the interface… hence the clone shares the same IP address as the original VM! Don’t forget about this.

Stuff that doesn’t (can’t) work on Alpine

Some software I tried to install actually requires glibc, but since Alpine uses musl, it can’t run: