Re-use the NixOS VM test infrastructure to test Ubuntu, Debian, and Fedora machines.
Nix
100
125 commits
updated Sep 21, 2026
Instant VMs to test your project
Testing your project on different Linux distributions is essential, but time-consuming.
nix-vm-test allows you to quickly spin up a virtual machine running any of the following Linux distributions under Qemu:
And run your tests using a single CLI command.
This project builds on the NixOS VM test infrastructure to allow you to test your software instantly on Ubuntu, Debian, Fedora, and Rocky virtual machines.
It runs on any Linux machine with Nix installed.
Your tests can either be used:
You configure nix-vm-test using Nix package manager, either in a flake or in a .nix configuration. This includes defining the parameters of the virtual machine you need for the test, and writing a Python script to define your tests. Once you've built the project, you can create the virtual machine and run your tests with a single CLI command.
A Linux machine
Nix Package Manager
Hardware KVM acceleration. The project will run without it, but it will be too slow for practical purposes.
The Get Started guide walks you through setting up and running a simple test scenario.
For more detailed information, see the Reference guide.
Beta-grade
The API will be backward compatible. The project is already used in some production setups in the wild.
However, expect to experience some paper cuts along the way. Check out the bug tracker to see the currently unfixed known bugs and their workaround.
let
test = nix-vm-test.lib.ubuntu."23_04" {
diskSize = "+2M"
sharedDirs = {
numtideShare = {
source = "/home/numtide/share";
target = "/mnt";
};
};
testScript = ''
vm.wait_for_unit("multi-user.target")
vm.succeed("apt-get update")
'';
};
in test.sandboxed
}
This project is supported by Numtide.

We are a team of independent freelancers that love open source. We help our customers make their project lifecycles more efficient by:
Contact us if you have a project in mind, or if you need help with any of our supported tools, including this one. We'd love to hear from you.
Nix
87.0%
Python
13.0%
Re-use the NixOS VM test infrastructure to test Ubuntu, Debian, and Fedora machines.
Nix
100
125 commits
updated Sep 21, 2026
Instant VMs to test your project
Testing your project on different Linux distributions is essential, but time-consuming.
nix-vm-test allows you to quickly spin up a virtual machine running any of the following Linux distributions under Qemu:
And run your tests using a single CLI command.
This project builds on the NixOS VM test infrastructure to allow you to test your software instantly on Ubuntu, Debian, Fedora, and Rocky virtual machines.
It runs on any Linux machine with Nix installed.
Your tests can either be used:
You configure nix-vm-test using Nix package manager, either in a flake or in a .nix configuration. This includes defining the parameters of the virtual machine you need for the test, and writing a Python script to define your tests. Once you've built the project, you can create the virtual machine and run your tests with a single CLI command.
A Linux machine
Nix Package Manager
Hardware KVM acceleration. The project will run without it, but it will be too slow for practical purposes.
The Get Started guide walks you through setting up and running a simple test scenario.
For more detailed information, see the Reference guide.
Beta-grade
The API will be backward compatible. The project is already used in some production setups in the wild.
However, expect to experience some paper cuts along the way. Check out the bug tracker to see the currently unfixed known bugs and their workaround.
let
test = nix-vm-test.lib.ubuntu."23_04" {
diskSize = "+2M"
sharedDirs = {
numtideShare = {
source = "/home/numtide/share";
target = "/mnt";
};
};
testScript = ''
vm.wait_for_unit("multi-user.target")
vm.succeed("apt-get update")
'';
};
in test.sandboxed
}
This project is supported by Numtide.

We are a team of independent freelancers that love open source. We help our customers make their project lifecycles more efficient by:
Contact us if you have a project in mind, or if you need help with any of our supported tools, including this one. We'd love to hear from you.
Nix
87.0%
Python
13.0%