.TH autopkgtest\-virt\-qemu 1 2014 "Linux Programmer's Manual" .SH NAME autopkgtest\-virt\-qemu \- autopkgtest virtualisation server using QEMU .SH SYNOPSIS .BI "autopkgtest " "[...] " "\-\- qemu" .RI [ options ] .I image \fR[\fIro\-image\fR ...] .SH DESCRIPTION .B autopkgtest\-virt\-qemu provides an autopkgtest virtualisation server using QEMU. Normally .B autopkgtest\-virt\-qemu will be invoked by .BR autopkgtest . You always need to specify at least one QEMU VM image. If your VM needs more disks, you can specify arbitrarily many additional images which will be added in order. .B autopkgtest\-virt\-qemu does .B not modify the given images, but will instead create a temporary overlay for the primary image, and add all other images as read-only. .SH REQUIREMENTS .B autopkgtest\-virt\-qemu assumes that you have already prepared a suitable Debian based QEMU image (see .B BUILDING IMAGES below for how to create them). But you can use any VM which has .B python3 or .B python installed and either .IP * 4 opens a root shell on hvc1, or .IP * 4 opens a root shell on ttyS1 (x86 only), or .IP * 4 has a serial console on the first serial port where you can log in (getty or similar) with specified user and password. This will then be used to start a root shell on hvc1 or ttyS1, to reduce this to the first case and to not assume that the first serial port stays operational throughout the whole test. Depending on the CPU architecture, the first serial port might be ttyS0, ttyAMA0, hvc0 or something else. .SH OPTIONS .TP .BI \-u " user" " | \-\-user=" user User name for running tests that don't require root privileges. If the VM is not already prepared to start a root shell on hvc1 or ttyS1 this will be also used for logging in on the first serial port. If this is not root, it must be able to run sudo without a password to become root for that purpose. .TP .BI \-p " password" " | \-\-password=" password Password for above user for logging into the VM on the first serial port. This is necessary if the VM is not already prepared to start a root shell on hvc1 or ttyS1. .TP .BR \-\-qemu\-architecture= ARCHITECTURE Set the architecture according to qemu's vocabulary, for example x86_64 or ppc64le. The default is the .B \-\-dpkg\-architecture if specified, or guessed from the .B \-\-qemu\-command if specified, or the host system's architecture. .TP .BR \-\-dpkg\-architecture= ARCHITECTURE Set the architecture according to dpkg's vocabulary, for example amd64 or ppc64el. If both .B \-\-qemu\-architecture and .B \-\-dpkg\-architecture are specified, the .B \-\-qemu\-architecture takes precedence. .TP .BI \-q " command" " | \-\-qemu\-command=" command QEMU command to run. If not specified, this defaults to .BI qemu\-system\- ARCHITECTURE for the architecture chosen by .B \-\-qemu\-architecture or .BR \-\-dpkg\-architecture , or the host system's architecture. .TP .BI \-o " dir" " | \-\-overlay\-dir=" dir Directory where the temporary image overlay for the primary image is created. By default this will happen in a work directory in .I /tmp (or \fI$TMPDIR\fR), but you can use this to e. g. ensure that the overlay is placed on a tmpfs if your .I /tmp directory is not on tmpfs. This will greatly increase the speed. .TP .BI \-c " num" " | \-\-cpus=" num" Number of (virtual) CPUs in the VM. Default is 1. .TP .BI "\-\-ram\-size=" MiB VM RAM size in MiB. Default is 2048, i. e. 2 GiB. .TP .BI "\-\-timeout\-reboot=" SECONDS Timeout for waiting for reboot. Default is 60 seconds. .TP .B \-\-show\-boot Show boot messages from serial console. .TP .B \-\-timeout-poweroff Rather than terminating the VM process, initiate poweroff from within the VM, and terminate only when timeout occurs. This can be useful where host devices are shared with the VM, and a clean poweroff is necessary for the host device to be re-initialized by the next test. .TP .BR \-d " | " \-\-debug Enable debugging output. .TP .B \-\-baseimage Add a read-only copy of the first image without the overlay as an additional read-only hard drive, which will be available for tests as .IR /dev/baseimage . This allows tests that require nested VMs to reuse the same image. Be aware that .I /dev/baseimage will not be accessible between calling .B autopkgtest\-reboot\-prepare and the next boot, thus make sure to stop accessing it before. .TP .BR \-\-boot=auto | bios | efi | ieee1275 | none Select how the qemu virtual machine will boot the image. .B auto chooses a suitable boot mode for the architecture, and is the default. .BR bios , .B ieee1275 and .B none do not do anything special, and assume the image is bootable by a default qemu configuration. .B auto is equivalent to one of these options on amd64, i386, ppc64el and unknown architectures. .B efi loads EFI firmware on supported architectures, currently meaning amd64, arm64, armhf or i386. The .B \-\-efi option is an alias for this mode. .B auto selects this mode on arm64 or armhf. This requires the ovmf, qemu\-efi\-arm or qemu\-efi\-aarch64 package, as appropriate for the architecture. .TP .BI "\-\-qemu\-options=" arguments Pass through arguments to QEMU command; e. g. \-\-qemu\-options='\-readconfig qemu.cfg' .SH CONFIGURATION FILES If you use lots of options or images, you can put parts of, or the whole command line into a text file, with one line per option. E. g. you can create a file .I sid\-desktop.cfg with contents like .RS .EX \-utestuser \-ps3kr1t \-\-ram\-size=4096 /home/bob/autopkgtest/sid\-desktop.img .EE .RE and then run .RS .EX autopkgtest [...] \-\- qemu @sid\-desktop.cfg .EE .RE The contents of the configuration file will be expanded in-place as if you would have given its contents on the command line. Please ensure that you .B don't place spaces between short options and their values, they would become a part of the argument value. .SH INPUT, OUTPUT AND EXIT STATUS The behaviour of .B autopkgtest\-virt\-qemu is as described by the AutomatedTesting virtualisation regime specification. .SH NOTES \fBautopkgtest\fR does not run \fBapt\-get update\fR at the start of a package build, which can cause a build failure if you are using a development series template. You will need to run \fBapt\-get update\fR in the template yourself (e. g. using \fB\-\-setup\-commands\fR). If the .B \-\-qemu\-command option has not been specified and no custom CPU type was selected in .BR \-\-qemu\-options , .B autopkgtest\-virt\-qemu will try to enable nested KVM support by default on x86_64 platforms if the hardware supports this. To fully enable this, one needs to additionally set some module parameters on the host, by creating a file .I /etc/modprobe.d/nested_kvm.conf with the contents .EX options kvm_intel nested=1 options kvm_amd nested=1 .EE and rebooting or reloading the KVM modules. It is still possible to use QEMU in tests without this, albeit without hardware acceleration. On Ubuntu systems these module options are typically already set. .SH BUILDING IMAGES .SS Debian For Debian you can use .BR autopkgtest\-build\-qemu(1) to build a suitable image. E. g. for unstable: .RS .EX autopkgtest\-build\-qemu unstable autopkgtest\-unstable.img .EE .RE See \fBautopkgtest\-build\-qemu\fR(1) for more information. .SS Ubuntu For Ubuntu, autopkgtest provides \fBautopkgtest\-buildvm\-ubuntu\-cloud\fR(1) to build a VM based on the Ubuntu cloud images. To create an image for the current development series and the i386 architecture: .RS .EX autopkgtest\-buildvm\-ubuntu\-cloud \-v \-a i386 .EE .RE This will produce e. g. .B autopkgtest\-trusty\-i386\-cloud.img\fR. .SH EXAMPLE Run the tests of the gdk\-pixbuf source package, using an Ubuntu cloud image: .RS .EX autopkgtest gdk\-pixbuf \-\- qemu autopkgtest\-trusty\-i386\-cloud.img .EE .RE .SH SEE ALSO \fBautopkgtest\fR(1), \fBautopkgtest\-schroot\fR(1), \fBautopkgtest\-virt\-lxc\fR(1), \fBautopkgtest\-build\-qemu\fR(1), \fBautopkgtest\-buildvm\-ubuntu\-cloud\fR(1), \fB/usr/share/doc/autopkgtest/\fR. .SH AUTHORS AND COPYRIGHT .B autopkgtest\-virt\-qemu was written by Martin Pitt This manpage is part of autopkgtest, a tool for testing Debian binary packages. autopkgtest is Copyright (C) 2006-2014 Canonical Ltd and others. See \fB/usr/share/doc/autopkgtest/CREDITS\fR for the list of contributors and full copying conditions.