Skip to main content

Demo Gif

transient

Documentation Status

transient is a wrapper around QEMU that provides additional features like downloading and building disk images, shared folders, and SSH support.

Motivation

The primary motivation for the development of transient is 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 as vagrant or the many libvirt based 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 on qemu. transient makes 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.

Installation

transient is available on PyPI, so the latest release can be installed with pip install transient. It is also available from GNU Guix, and can be installed with guix install python-transient. To install transient from source, clone this repository and run pip install -e '.[dev]' from the project root. As always, the usage of python virtual environments is recommended for a development setup. The development environment can also be built by running make dev from the project root.

transient has very few dependencies. On Ubuntu, these can be installed by running apt-get install ssh qemu-system-x86 python3-pip.

Documentation

Documentation for transient is available on Read the Docs.

Quick Start

transient is 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 with libvirt based tools becoming 'unsynchronized' with the real system state.

For example, in the following command, the flags before the -- are passed to transient. The remaining arguments are passed directly to QEMU. This example will cause transient to 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 1G

transient also supports a vagrant style 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 (unlike vagrant). For example:

transient run centos/7:2004.01 --ssh-console -- -enable-kvm -m 1G

The --ssh-console flag depends on the image having the normal vagrant keypair trusted for the vagrant user.

Building Images

One side-effect of the development of transient was 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 existing vagrant image centos/7:2004.01 but with nano installed and a hostname change:

FROM centos/7:2004.01
RUN yum install -y nano
RUN echo 'myhostname' > /etc/hostname

For additional information on building images, see the Building Images page of the docs.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details

Release files for transient 0.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transient 0.25
File Size Uploaded
transient-0.25.tar.gz 17.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for transient 0.25
File Interpreter ABI Platform
transient-0.25-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 MB

Release files / transient-0.25.tar.gz

Download URL transient-0.25.tar.gz
Size 17.9 MB
Tags Source
SHA-256 checksum
How to use checksums
28971553c29657781e5515bee3048640bb66a892b33a435a4d56435c2bb020c2
BLAKE2b-256 checksum
How to use checksums
79fa126bf7ef9b32743128115abdd916a528bf7eb55cc54ac4007219fc5c3333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.2 requests/2.23.0 setuptools/58.1.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

Release files / transient-0.25-py3-none-any.whl

Download URL transient-0.25-py3-none-any.whl
Size 17.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6e548142c740cae2f3ecfb973dbb1540b067e1f32857f1484187821831cb805a
BLAKE2b-256 checksum
How to use checksums
6048cd5b2d0e8abdaaa48884e28d1da43f23fe54afc926ea9723421806f592f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.2 requests/2.23.0 setuptools/58.1.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

Release history Release notifications | RSS feed

This release

0.25 This release

2 release files

0.24

2 release files

0.23

2 release files

0.22

2 release files

0.21

2 release files

0.20

2 release files

0.19

2 release files

0.18

2 release files

0.17

2 release files

0.16

2 release files

0.15

2 release files

0.14

2 release files

0.13

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page