Admins will be upgrading ORNL GitLab Servers on Saturday, 16 May 2026, from 7 AM until 11 AM EST. Repositories will experience intermittent outages during this time.
Run a derivation in a Linux virtual machine (using Qemu/KVM). By default, there is no disk image; the root filesystem is
a `tmpfs`, and the nix store is shared with the host (via the 9P protocol). Thus, any pure Nix derivation should run
unmodified.
Run a derivation in a Linux virtual machine (using Qemu/KVM).
By default, there is no disk image; the root filesystem is a `tmpfs`, and the Nix store is shared with the host (via the [9P protocol](https://wiki.qemu.org/Documentation/9p#9p_Protocol)).
Thus, any pure Nix derivation should run unmodified.
If the build fails and Nix is run with the `-K` option, a script `run-vm` will be left behind in the temporary build
directory that allows you to boot into the VM and debug it interactively.
If the build fails and Nix is run with the `-K/--keep-failed` option, a script `run-vm` will be left behind in the temporary build directory that allows you to boot into the VM and debug it interactively.
### Attributes
*`preVM` (optional). Shell command to be evaluated *before* the VM is started (i.e., on the host).
*`memSize` (optional, default `512`). The memory size of the VM in megabytes.
*`diskImage` (optional). A file system image to be attached to `/dev/sda` (Note that currently we expect the image to
contain a filesystem, not a full disk image with a partition table etc).
*`memSize` (optional, default `512`). The memory size of the VM in MiB.
*`diskImage` (optional). A file system image to be attached to `/dev/sda`.
Note that currently we expect the image to contain a filesystem, not a full disk image with a partition table etc.
Like [](#vm-tools-runInLinuxVM), but run the build not using the `stdenv` from the Nix store, but using the tools
provided by `/bin`, `/usr/bin`, etc. from the specified filesystem image, which typically is a filesystem containing a
non-NixOS Linux distribution.
Like [](#vm-tools-runInLinuxVM), but instead of using `stdenv` from the Nix store, run the build using the tools provided by `/bin`, `/usr/bin`, etc. from the specified filesystem image, which typically is a filesystem containing a [FHS](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)-based Linux distribution.