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 bashvirtme-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.configwithout 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.configsnippet files, or-for stdin. π§--configitem CONFIGITEMβ add aCONFIG_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-nameflag. 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/vdafor the whole image, or/dev/vda3for 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=pathor--rodir=guestpath=hostpath. π--rwdir RWDIRβ supply a read/write directory to the guest. use--rwdir=pathor--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-smpflag), or'host'to mirror the available host CPU topology and pin each vCPU.--memory MEMORY,-m MEMORYβ set guest memory size (qemu-mflag).--numaβ takesMEM[,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 themicrovmarchitecture. 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β copyvmlinuxback 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--rootor--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β executesystemdas 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.--runcan 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 examplevng --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
- arch rolling: virtme-ng 1.42-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms