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+qemulibguestfs{s,}fdiskchrootandlosetupshould be ubiquituous
This is the primary script.
- Creates, partitions, and formats a
rawQEMU image - Creates a
chroot- Installs alpine's
minirootfs - Installs necessary chunks from alpine's
netbootasminirootfsdoes not have a kernel - Sets up Vagrant users
- Installs and configures
opensshfor Vagrant use - Attempts to properly configure
syslinux
- Installs alpine's
- Displays info about run
- Provides
kvmtest shortcut
It generates alpine.im, a raw QEMU image that is. unfortunately, not actually bootable.
- Converts
alpine.imgtoalpine.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
chrootthe 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.