Bug#886332: autopkgtest-virt-qemu: how to make persistent dist-upgrades

Martin Pitt mpitt at debian.org
Thu Jan 4 15:19:07 UTC 2018

Hello Johannes,

Johannes Schauer [2018-01-04 15:46 +0100]:
> my use case is: use the autopkgtest qemu backend with sbuild. This works
> well after having created the image with vmdebootstrap but after a while
> the image has to be persistently upgraded. It would be nice if you could
> either:
>  1. document how to easily upgrade a autopkgtest qemu image outside of
>     sbuild

Note that autopkgtest does not require that the image you use with it was
created by vmdebootstrap, and autopkgtest is not supposed to be a VM management
tool. It merely can *use* a VM which satisfies certain properties (i. e. serial
console or known root/sudo password).

There's nothing magic about the vmdebootstrap images either - you can just boot
them on the command line, or through libvirt, etc.

That said, this can certainly be mentioned somehow in the autopkgtest-virt-qemu

>  2. document which options to use so that the qemu image is persistently
>     upgraded every time that sbuild runs autopkgtest

The point of autopkgtest is to use ephemeral overlays, not to make anything
persistent. So this isn't and shouldn't be possible.

> As for (1.), when I run:
>  $ sudo qemu-system-x86_64 -enable-kvm -m 4G -drive format=raw,file=/srv/qemu/unstable-amd64-autopkgtest.img
> Then I get "no bootable device".

Possibly because this is not a raw device, but a qcow2 image? There's little
reason to explicitly specify it, just let qemu figure it out by itself. Try

  -drive file=/srv/qemu/unstable-amd64-autopkgtest.img,if=virtio

> As for (2.), I was unsuccessful to use the -U option or --setup-commands
> options to do persisting upgrades. This didn't work:

Right, because autopkgtest-virt-qemu always creates an ephemeral overlay. It
never ever touches the given VM image.


More information about the autopkgtest-devel mailing list