I wanted to build a slimmer Alpine image for use with Vagrant while learning some new tooling. I learned some new tooling but I wasn't able to build the Vagrant images.
I didn't track system deps, so you'll potentially have to hunt them down.
- Vagrant
- Virtual Box
libvirt
+qemu
libguestfs
{s,}fdisk
chroot
andlosetup
should be ubiquituous
This is the primary script.
- Creates, partitions, and formats a
raw
QEMU image - Creates a
chroot
- Installs alpine's
minirootfs
- Installs necessary chunks from alpine's
netboot
asminirootfs
does not have a kernel - Sets up Vagrant users
- Installs and configures
openssh
for Vagrant use - Attempts to properly configure
syslinux
- Installs alpine's
- Displays info about run
- Provides
kvm
test shortcut
It generates alpine.im
, a raw
QEMU image that is. unfortunately, not actually bootable.
- Converts
alpine.img
toalpine.vmdk
- Creates a new VM
- Sets up storage access
- Assigns
alpine.vdmk
As alpine.img
is not bootable, neither is the created VBox.
Convenience script to unmount all the things I normally had mounted while developing compile.sh
.
No matter what, I was unable to get the image to boot. At a glance, it looks like it should work. I tried both MBR and GPT (with preformatting for sfdisk
in mbr.out
and gpt.out
, respectively). I tried a slew of configurations.
- Is the loop device the problem?
- Is the
chroot
the problem? - Is the bootloader the problem?
- Is the fs the problem?
- Is the kernel the problem?
- Is the operator the problem?
If you have any insight, I'd love to hear from you! PRs, comments, and issues are very welcome.