Package: transient
transienttransientis a wrapper around QEMU that provides additional features like downloading
and building disk images, shared folders, and SSH support.MotivationThe primary motivation for the development oftransientis to have a simple way to
create short-lived virtual machines for testing and development, particularly kernel
and hypervisor development. There are many other tools for creating virtual machines,
such asvagrantor the manylibvirtbased solutions. However, these are almost always very stateful. It can be difficult
to create virtual machines using these tools in CI environments, as the state may
not always be appropriately synchronized. Also, these tools can make it more difficult
to supply an existing kernel/initramfs when booting the virtual machine.Almost all linux-based virtualization tools ultimately rely onqemu.transientmakes
this dependency transparent, allowing the user the entire flexibility of QEMU. This can
be very helpful, for example, when attempting to setup complex virtual networking
situations which may be difficult to express in the abstractions provided by other tools.Installationtransientis available onPyPI, so the latest
release can be installed withpip install transient. It is also available fromGNU Guix, and can be installed withguix install python-transient. To installtransientfrom source, clone this
repository and runpip install -e '.[dev]'from the project root. As always,
the usage of pythonvirtual environmentsis recommended for a development setup. The development environment can also
be built by runningmake devfrom the project root.transienthas very few dependencies. On Ubuntu, these can be installed by runningapt-get install ssh qemu-system-x86 python3-pip.DocumentationDocumentation fortransientis available onRead the Docs.Quick Starttransientis primarily a wrapper for QEMU. It supplies a small set of flags that
are used to add additional features to the VM being started. As the name implies,
it is almost completely stateless. This avoids problems that can sometimes occur
withlibvirtbased tools becoming 'unsynchronized' with the real system state.For example, in the following command, the flags before the--are passed totransient. The remaining arguments are passed directly to QEMU. This example
will causetransientto download and run a Centos7 VM (from the Vagrant Cloud)
with 1GB of memory using a text console. This virtual machine will be automatically
shut down on exit and its disk will be destroyed.transient run centos/7:2004.01 -- -nographic -enable-kvm -m 1Gtransientalso supports avagrantstyle SSH connection. This will start the
virtual machine and connect standard input and output to an SSH connection
with the machine, instead of the serial console. However, when this connection
is closed, the machine will be automatically shut down (unlikevagrant). For
example:transient run centos/7:2004.01 --ssh-console -- -enable-kvm -m 1GThe--ssh-consoleflag depends on the image having the normal vagrant keypair
trusted for thevagrantuser.Building ImagesOne side-effect of the development oftransientwas to create a Dockefile-like
declarative file that can be used to build virtual machine disk images. For example,
the file below would build a Centos 7 image based on the existingvagrantimagecentos/7:2004.01but withnanoinstalled and a hostname change:FROM centos/7:2004.01
RUN yum install -y nano
RUN echo 'myhostname' > /etc/hostnameFor additional information on building images, see theBuilding Images pageof the docs.LicenseThis project is licensed under the terms of the MIT license. See the LICENSE
file for details