VNG(1)

πŸ’… vng(1) β€” the virtme-ng era

okay so bestie. welcome to vng(1), aka the virtme-ng manual, and no cap this thing is a whole vibe. it's giving "run your kernel in a little virtual snowglobe made of your actual live system" πŸ¦‹ and honestly? iconic.


🌸 NAME

vng β€” quickly run kernels inside a virtualized snapshot of your live system. literally that's the whole pitch. πŸ”₯


✨ SYNOPSIS

okay so here's the full invocation, copied EXACTLY because we do not mess with syntax in this house:

vng [-h] [--version] [--run [RUN] | --build | --clean | --dump DUMP |
--mcp] [--dry-run] [--no-virtme-ng-init] [--empty-passwords] [--pin
[PIN]] [--gdb] [--snaps] [--debug] [--kconfig] [--skip-modules]
[--commit COMMIT] [--config CONFIG] [--configitem CONFIGITEM] [--busybox
PATH_TO_BUSYBOX] [--qemu QEMU] [--name NAME] [--user USER] [--shell
BINARY] [--root ROOT | --root-disk IMAGE] [--root-dev DEVICE] [--root-
fstype FSTYPE] [--root-release ROOT_RELEASE] [--rw] [--no-root-posix-
acl] [--force-9p] [--disable-microvm] [--disable-kvm] [--disable-
monitor] [--cwd CWD] [--rodir RODIR] [--rwdir RWDIR] [--overlay-rwdir
OVERLAY_RWDIR] [--cpus CPUS] [--memory MEMORY] [--numa
MEM[,cpus=FIRST_CPU1[-LAST_CPU1]][,cpus=FIRST_CPU2[-LAST_CPU2]]...]
[--numa-distance SRC,DST=VAL] [--balloon] [--network NETWORK] [--no-
dhcp] [--net-mac-address NET_MAC_ADDRESS] [--disk PATH] [--exec EXEC]
[--append APPEND] [--force-initramfs] [--sound] [--graphics] [--fb]
[--verbose] [--quiet] [--qemu-opts QEMU_OPTS] [--jobs N] [--build-host
BUILD_HOST] [--build-host-exec-prefix BUILD_HOST_EXEC_PREFIX] [--build-
host-vmlinux] [--arch ARCH] [--cross-compile CROSS_COMPILE] [--force]
[--nvgpu [GPU PCI Address]] [--vfio-pci PCI_ADDRESS] [--console [PORT]]
[--console-client [PORT]] [--ssh [PORT]] [--ssh-client [PORT]] [--ssh-
tcp] [--remote-cmd COMMAND] [--systemd] [envs ...]

yeah it's a lot. it's a lot lot. but we're gonna go through every single one together, hand in hand, like besties do 🫢


πŸŽ€ DESCRIPTION

Build and run kernels inside a virtualized snapshot of your live system

that's it. that's the product. you get a tiny VM that's a snapshot of your actual system and you shove a kernel into it. slay.

oh and also:

  • envs β€” additional Makefile variables πŸ’œ

πŸ’… OPTIONS

okay deep breath. there are SO many. we're doing all of them. grab a snack. πŸ“

  • --version, -V β€” show the program's version number and exit. short, sweet, self-explanatory.
  • --dry-run β€” only show the commands without actually running them. it's giving "look but don't touch" πŸ’€
  • --no-virtme-ng-init β€” fall back to the bash virtme-init (useful for debugging/development). the old reliable, for when you're poking at things.
  • --empty-passwords β€” use empty passwords for all users. yes, all of them. πŸ™ˆ
  • --pin [PIN], -P [PIN] β€” pin each QEMU vCPU thread to a distinct host CPU. if you give it no arguments, all host CPUs are used. if you give it an argument, it has to be a list/range of CPUs (e.g., 0,1,3-5,9). NOTE: only a single virtme-ng guest can be pinned at a time β€” pinning multiple virtme-ng guests is not supported yet. so like… one at a time, bestie 😭
  • --gdb β€” attach a debugging session to a running instance that was started with --debug. debugging bestie hours.
  • --snaps β€” allow executing snaps inside virtme-ng. πŸ“¦
  • --debug β€” start the instance with debugging enabled: lets you generate crash dumps, attach a debugging session with GDB, etc. main character debugging energy πŸ”₯
  • --kconfig, -k β€” only override the kernel .config without building/running anything. just the config. nothing else. periodt.
  • --skip-modules, -S β€” run a really fast build by skipping external modules (no external modules support). zoom zoom ⚑
  • --commit COMMIT, -c COMMIT β€” use a kernel identified by a specific commit id, tag or branch. pick your fave.
  • --config CONFIG, --custom CONFIG, -f CONFIG β€” use one (or more) kernel .config snippet files, or - for stdin. 🧚
  • --configitem CONFIGITEM β€” add a CONFIG_ITEM=val, after --config <fragments>; these override previous config settings. so they win the argument.
  • --busybox PATH_TO_BUSYBOX β€” use the specified busybox binary.
  • --qemu QEMU β€” use the specified QEMU binary.
  • --name NAME β€” set guest hostname and qemu -name flag. name your child πŸŽ€
  • --user USER β€” change user inside the guest (default is same user as the host).
  • --shell BINARY β€” override the default user shell.
  • --root ROOT β€” pass a specific chroot to use inside the virtualized kernel (useful with --arch).
  • --root-disk IMAGE β€” boot from a disk image attached over virtio-blk instead of exporting a host directory as the guest root (useful with --arch).
  • --root-dev DEVICE β€” the guest device holding the root filesystem of --root-disk, e.g. /dev/vda for the whole image, or /dev/vda3 for its third partition (default: /dev/vda). third partition girlies rise πŸ™Œ
  • --root-fstype FSTYPE β€” filesystem of --root-disk's root device, e.g. ext4, so its module can be loaded instead of requiring it built into the kernel.
  • --root-release ROOT_RELEASE β€” use a target Ubuntu release to create a new chroot (used with --root).
  • --rw β€” give the guest read-write access to its root filesystem. > WARNING: this can be dangerous for the host filesystem! like fr fr be careful πŸ’€ no cap.
  • --no-root-posix-acl β€” disable POSIX ACL support for external root virtiofs exports (ignored with 9p, host root, or --root-disk).
  • --force-9p β€” use the legacy 9p filesystem as rootfs. vintage ✨
  • --disable-microvm β€” avoid using the "microvm" QEMU architecture (only on x86_64).
  • --disable-kvm β€” avoid using hardware virtualization / KVM.
  • --disable-monitor β€” disable the QEMU STDIO monitor.
  • --cwd CWD β€” change guest working directory (default is the current working directory when possible).
  • --rodir RODIR β€” supply a read-only directory to the guest. use --rodir=path or --rodir=guestpath=hostpath. πŸ”’
  • --rwdir RWDIR β€” supply a read/write directory to the guest. use --rwdir=path or --rwdir=guestpath=hostpath. πŸ”“
  • --overlay-rwdir OVERLAY_RWDIR β€” supply a directory that is r/w to the guest but read-only in the host. use --overlay-rwdir=path. best of both worlds, honestly obsessed πŸ¦‹
  • --cpus CPUS, --cpu CPUS, -p CPUS β€” set guest CPU count (qemu -smp flag), or 'host' to mirror the available host CPU topology and pin each vCPU.
  • --memory MEMORY, -m MEMORY β€” set guest memory size (qemu -m flag).
  • --numa β€” takes MEM[,cpus=FIRST_CPU1[-LAST_CPU1]][,cpus=FIRST_CPU2[-LAST_CPU2]]... β€” create a NUMA node in the guest. use this option multiple times to create more NUMA nodes. the total memory size assigned to NUMA nodes must match the guest memory size (specified with --memory/-m). this option implicitly disables the microvm architecture. so like, pick a lane.
  • --numa-distance SRC,DST=VAL β€” set a distance of VAL between NUMA node SRC_NODE and DST_NODE. use this option multiple times to define multiple distances between NUMA nodes. this option is only used together with --numa. (they're a package deal πŸ’œ)
  • --balloon β€” allow the host to ask the guest to release memory. polite host behavior tbh.
  • --network NETWORK, -n NETWORK β€” enable network access: user, bridge(=<br>), loop.
  • --no-dhcp β€” disable DHCP configuration for network interfaces.
  • --net-mac-address NET_MAC_ADDRESS β€” the MAC address to assign to the NIC interface, e.g. 52:54:00:12:34:56. the last octet will be incremented for the next network devices. cute little counter πŸŽ€
  • --disk PATH, -D PATH β€” add a file as a virtio-scsi disk (can be used multiple times).
  • --exec EXEC, -e EXEC β€” execute a command inside the kernel and exit. in and out, ghost mode πŸ‘»
  • --append APPEND, -a APPEND β€” additional kernel boot options (can be used multiple times).
  • --force-initramfs β€” use an initramfs even if it's unnecessary.
  • --sound β€” enable audio device (if the architecture supports it). πŸ”Š
  • --graphics, -g β€” show graphical output instead of using a console.
  • --fb β€” show graphical console, but do not start any graphics server (mutually exclusive with --graphics). they cannot both slay. πŸ’…
  • --verbose, -v β€” increase console output verbosity. talk to me talk to me
  • --quiet, -q β€” override verbose mode (disable --verbose).
  • --qemu-opts QEMU_OPTS, -o QEMU_OPTS β€” additional arguments for QEMU (can be used multiple times) or bundled together: --qemu-opts='...'.
  • --jobs N, -j N β€” build kernel with N jobs (default: number of cores).
  • --build-host BUILD_HOST β€” perform the kernel build on a remote server (ssh access required).
  • --build-host-exec-prefix BUILD_HOST_EXEC_PREFIX β€” prepend a command (e.g., chroot) to the make command executed on the remote build host.
  • --build-host-vmlinux β€” copy vmlinux back from the build host. bring it home πŸ₯Ί
  • --arch ARCH β€” generate and test a kernel for a specific architecture (default is the host architecture; if set, to be used with --root or --root-disk).
  • --cross-compile CROSS_COMPILE β€” set cross-compile prefix.
  • --force β€” force reset the git repository to the target branch or commit (warning: this may drop uncommitted changes), and force kernel config override. > like, this one will literally throw away your uncommitted changes. be SO careful. 😭
  • --nvgpu [GPU PCI Address] β€” add a passthrough NVIDIA GPU.
  • --vfio-pci PCI_ADDRESS β€” pass through a PCI device using vfio-pci (can be used multiple times), e.g. --vfio-pci 0000:ce:00.0.
  • --systemd β€” execute systemd as init (EXPERIMENTAL). experimental!! you've been warned πŸ’€

⭐ ACTION

these are the "what are we even doing" flags:

  • --run [RUN], -r [RUN] β€” run a specified kernel. --run can accept one of the following arguments: 1) nothing (in this case it'll try to boot the same kernel running on the host), 2) a kernel binary (like ./arch/x86/boot/bzImage), 3) a directory (where it'll try to find a valid kernel binary file), 4) an upstream version, for example vng --run v6.6.17 (in this case vng will download a precompiled upstream kernel from the Ubuntu mainline repository). look at all those options, she's versatile πŸ‘‘
  • --build, -b β€” build the kernel in the current directory (or remotely if used with --build-host).
  • --clean, -x β€” clean the kernel repository (local, or remote if used with --build-host).
  • --dump DUMP, -d DUMP β€” generate a memory dump of the running kernel (the instance needs to be started with --debug). memory dump, but make it forensic πŸ•΅οΈ
  • --mcp β€” start the MCP (Model Context Protocol) server for AI agent integration. ai bestie integration, we love to see it 🌈

πŸ¦‹ REMOTE CONSOLE

the long-distance relationship section πŸ’Œ

  • --console [PORT] β€” enable a server to communicate later from the host using '--console-client'. by default, a simple console will be offered using a VSOCK connection, and 'socat' for the proxy.
  • --console-client [PORT] β€” connect to a VM launched with the '--console' option for a remote control.
  • --ssh [PORT] β€” enable an SSH server to communicate later from the host to using '--ssh-client'.
  • --ssh-client [PORT] β€” connect to a VM launched with the '--ssh' option for a remote control.
  • --ssh-tcp β€” use TCP for the SSH connection to the guest.
  • --remote-cmd COMMAND β€” to start in the VM a different command than the default one (--server), or to launch this command instead of a prompt (--client).

πŸ’¬ COMMENTS πŸ’¬

okay bestie, gather round, because this is the whole why of virtme-ng and it's honestly iconic ✨

virtme-ng is a tool that lets you easily and quickly recompile and test a Linux kernel, starting straight from the source code. Like, you don't have to do the whole sad little ritual. You can recompile the kernel in a few minutes (rather than hours, yes HOURS 😭), and then the kernel just... starts itself. Automatically. In a virtualized environment that is an exact copy-on-write copy of your live system πŸ’…

which means β€” and this is the slay part β€” any changes you make to that virtualized environment do not affect the host system. none. zero. the host is untouched and unbothered, main character energy only πŸ‘‘


so how does this little magic trick work? πŸͺ„

a minimal config is produced (with the bare minimum support needed to test the kernel inside qemu), then the kernel you selected is automatically built and started inside qemu, using the filesystem of the host as a copy-on-write snapshot. πŸ¦‹

which means you can literally destroy the entire filesystem, crash the kernel, do your worst β€” none of it touches the host. go feral fr fr πŸ’€πŸ”₯

NOTE: kernels produced with virtme-ng are lacking lots of features, on purpose, to reduce the build time to the absolute minimum while still giving you a usable kernel that can run your tests and experiments. so like... it's a vibe, not a full-featured distro kernel, iykyk πŸ™ˆ

and for the lore keepers πŸŽ€: virtme-ng is based on virtme, written by Andy Lutomirski <luto@kernel.org>. credit where credit is due, periodt.


πŸ‘‘ AUTHOR πŸ‘‘

virtme-ng is written by Andrea Righi <arighi@nvidia.com> πŸ’–

based on virtme by Andy Lutomirski <luto@kernel.org> 🫢


πŸŽ€ DISTRIBUTION πŸŽ€

the latest version of virtme-ng may be downloaded from:

https://github.com/arighi/virtme-ng

go get it bestie, it's giving essential tooling 🌈⭐


and that's the whole page!! πŸŽ‰ this was virtme-ng version 1.42, dated 2026-10-13, living its best life as VNG(1) in section 1 of the manual πŸ’œ now go recompile a kernel in a few minutes and think of me πŸ’…βœ¨πŸ§š

πŸ“¦ where this page comes from