vmdebootstrap is deprecated; this page is out of date

See https://bugs.debian.org/907751 for more information.

Background

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

Information

https://vmdebootstrap.alioth.debian.org/ hosts the documentation built from the current master branch, links to the manpages, links to the git repository for the vmdebootstrap code and other useful information.

The rest of the information on this page may become out of date, so always check the information available on the homepage before filing bugs.

Use

For LAVA

This information is for the current dispatcher, the refactoring already supports using vmdebootstrap images without needing custom overlays.

http://validation.linaro.org/

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.
PREFIX=https://launchpad.net/~linaro-maintainers/+archive/overlay/+files
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
  fi
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 \
  "$@"

If building an image using Jessie or later, the serial-console and serial-console-command options are not required. (Newer versions of vmdebootstrap will ignore these options for distributions other than Wheezy.)

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 \
  --mirror=http://archive.ubuntu.com/ubuntu

For ARM

Architectures other than i386 or amd64 can use emulation support. (vmdebootstrap is installable on any architecture using the Linux kernel.)

iMX53 / ARM multi-platform kernel

http://packages.debian.org/unstable/linux-image-armmp

$ 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 http://ftp.uk.debian.org/debian \
 --arch=armhf --distribution jessie --foreign=/usr/bin/qemu-arm-static