vmdebootstrap is a wrapper around debootstrap to install Debian into a disk image, which can be used with a virtual machine (such as KVM).



If devices of the chosen type do not support auto-login in LAVA, an overlay is used to provide access.

set -e

# temporary: download linaro-overlay packages, which provide
# auto-serial-console. Plans for the future include providing
# auto-serial-console in the Debian archive so we don't need this.
while read line; do
  if ! echo "$line" | sha1sum --check --quiet - > /dev/null 2>&1; then
    package=$(echo "$line" | awk '{ print($2) }')
    echo "Downloading $package ..."
    wget --quiet $PREFIX/$package
    echo "$line" | sha1sum --check --quiet
done < external-packages.sha1sum

sudo vmdebootstrap \
  --custom-package='linaro-overlay_1112.2_all.deb' \
  --custom-package='linaro-overlay-minimal_1112.2_all.deb' \
  --enable-dhcp \
  --serial-console --serial-console-command='/bin/auto-serial-console' \
  --root-password='root' \
  --verbose \

For Ubuntu images

vmdebootstrap automates the selection of kernels from Debian archives for i386 and amd64, different repositories or different architectures need to specify the kernel meta package directly:

$ sudo vmdebootstrap \
  --enable-dhcp --no-kernel --package=linux-image \
  --root-password='root' --hostname='ubuntu' --user=linaro/linaro --sudo \
  --verbose \

For LAVA Ubuntu images

sudo vmdebootstrap  --custom-package='linaro-overlay_1112.2_all.deb' \
  --custom-package='linaro-overlay-minimal_1112.2_all.deb' \
  --enable-dhcp --no-kernel --package=linux-image-generic \
  --serial-console --serial-console-command='/bin/auto-serial-console' \
  --root-password='root' --hostname='ubuntu' --user=linaro/linaro \
  --sudo --distribution=trusty  --verbose  --image trusty.img \


Architectures other than i386 or amd64 need emulation support. (vmdebootstrap is only installable on i386 and amd64 due to dependencies.)

iMX53 / ARM multi-platform kernel

$ sudo apt-get install qemu-system-arm qemu-user-static binfmt-support

$ sudo vmdebootstrap  --enable-dhcp --no-kernel --package=linux-image-armmp \
 --verbose --image armmp.img --size 1g --mirror \
 --arch=armhf --distribution jessie --foreign=/usr/bin/qemu-arm-static