DEBVM-CREATE(1)
β¨ DEBVM-CREATE(1) β¨
okay so bestie, you know how debvm-create is a thing in the Perl docs section? yeah. this is that. it's a whole vibe and we're gonna go through it together π
πΈ NAME πΈ
debvm-create β Create a VM image for various Debian releases and architectures
like. that's literally what it does. it makes you a lil baby VM image and it does NOT care which release or which arch you want, it's flexible like that π¦
π SYNOPSIS π
debvm-create [-h hostname] [-k sshkey] [-o output] [-r release] [-s <task>] [-z size] [-- mmdebstrap options]
that's the whole shape of it. short flags, some values, and then a double dash so you can pass stuff straight down to mmdebstrap. iconic honestly.
π DESCRIPTION π
So debvm-create is essentially a thin wrapper around mmdebstrap, right? It's out here creating a raw ext4 filesystem image that you can boot with debvm-run. That's the whole point π«Ά
And the purpose of these images? primarily testing the different releases and architectures without access to a physical machine of that architecture. That's the dream, no cap β you don't need to own the hardware to test on the hardware. slay.
Beyond the essential packages, the image is gonna contain:
apt- an init system
- a suitable kernel package
and here's what's notably absent, pay attention bestie: a bootloader and a partition table. none. zero. not there π
So like, in order to actually boot one of these images, you're supposed to extract the kernel and initrd from the image and pass it to a suitable bootloader. that's the move.
Also: no user account is created and root can login without specifying a password. yeah. it's giving open door policy. it's a test VM, she's built different π
β OPTIONS β
-h hostname,--hostname=hostnameβ sets the hostname of the virtual machine. default istestvm. cute name, keep it.--initsystem=systemd | busybox | finit | runit | sysv | noneβ pick your init system, babe. the default issystemdand that's true independently of the Debian release. And uh β heads up β when you picknone, the resulting image will not be bootable unless something else takes care of creating/sbin/init. no init, no boot, that's just physics π Also, automatic customizations that are specific to a particular init system get skipped when you select a different init system. And when you're using thefinitinit system, consider passing--include=finit-pluginstommdebstrapπ«-k sshkey,--sshkey=sshkeyβ installs the given ssh public key file into the virtual machine image for the root user. this option also causes the ssh server to be installed. by default, no key or server is installed. to connect to the vm, pass a port number todebvm-runwith the-soption π¦-o output,--output=outputβ the file name of the resulting virtual machine image. default? it gets written torootfs.ext4. periodt.-r release,--release=releaseβ use the given Debian release. default isunstable(living on the edge, love that for you π₯). if you pass a completesources.listthat includes release names tommdebstrap, you may pass an empty string here.-s task,--skip=taskβ skips a particular task or feature. you can specify this option multiple times, or list multiple tasks to skip by separating them with a comma. by default, no tasks are skipped. here's the full menu of skippable things, bestie:autologinβ do not setup the machine for automatic password-less root login on the console. this comprises the following changes that would normally be performed: Automatic root login is configured for the init systemsfinit,runit,systemdandsysv. Forwarding of theTERMkernel command line toagettyis configured. The root password is deleted such that a login does not ask for it and the system directly boots to a shell prompt.ext4β normally,mmdebstrapbootstraps to a temporary directory and we create the output ext4 image from that directory. this option causes the creation of the ext4 image to be skipped and the output file becomes a tar archive of the temporary directory instead. Such a tar archive is not suitable for being booted bydebvm-run. noted πifupdownβ skips installing ifupdown configuration to automatically configure wired interfaces. this is specific to usingfinit,runitorsysvas init system.initsystemβ skips installing an init system. this is equivalent to specifying--initsystem=none.kernelβ skips installing a linux kernel image. this can be useful to install a kernel without a package. and btw, if a kernel is installed via themmdebstrapoption--include, automatic kernel installation is automatically skipped anyway.packagelistsβ reduces the package lists inside the image. The available database fordpkgis not created. The package lists used byaptare deleted. This generally produces a smaller image, but you need to runapt updatebefore installing packages anddpkg --set-selectionsdoes not work. trade-offs, babes.systemdnetworkβ skips installinglibnss-resolveas well as automatic network configuration viasystemd-networkd. this is specific to usingsystemdas init system.usrmergeβ by defaultdebvmadds a hook to enable merged-/usrwithout theusrmergepackage given a sufficiently recent Debian release. without the hook, dependencies will pull theusrmergepackage as needed, which may result in a larger installation.
-z size,--size=sizeβ the minimum image size, as an integer plus an optional unit (example:10Kis10*1024). units areK,M,G,T(powers of 1024). the resulting image will be grown as a sparse file to this size if necessary. default is 2 GB β¨-- mmdebstrap optionsβ everything beyond a double dash gets passed tommdebstrapafter the suite and target specification. you can use this to provide additional hooks for image customization. you can also request additional packages to be installed into the image usingmmdebstrap's--includeoption. Any positional arguments passed here will be treated as mirror specifications bymmdebstrap. And in particular β you can also change the architecture of the resulting image using the--architectureoption. π«
π EXAMPLES π
okay this is the fun part, let's get into it π
When creating an image with multiple architectures, the kernel selection will prefer the sibling 64bit architecture.
debvm-create ... -- --architecture=armhf,arm64
In order to create images for Debian ports architectures, you can pass two options to mmdebstrap.
debvm-create ... -- http://deb.debian.org/debian-ports --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg
You can also install a graphical desktop environment π
debvm-create ... -- --hook-dir=/usr/share/mmdebstrap/hooks/useradd --aptopt='Apt::Install-Recommends "true"' --include=linux-image-generic,task-gnome-desktop
Here the hook creates a password-less user user. In order for task-gnome-desktop to work reasonably well, Recommends should be enabled. By default a -cloud kernel that lacks graphics drivers is installed. (so like, enable Recommends or your desktop experience is gonna be a lil sad, fr fr)
Installing Ubuntu is also supported somewhat π¦
debvm-create --release kinetic -- --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg --components=main,universe --include=e2fsprogs
Note that universe must be enabled as the merged-usr and systemdnetwork hooks rely packages from that component. e2fsprogs should be pulled by initramfs-tools. iykyk
There also is an aid for sharing a directory with the VM π
debvm-create ... -- --include=linux-image-generic --hook-dir=/usr/share/mmdebstrap/hooks/9pmount
debvm-run ... -- -virtfs local,security_model=none,path=/host_path,mount_tag=guest_tag
This will mount the directory /host_path from the host as /media/guest_tag in the VM during boot using 9P. Note that the -cloud kernel lacks the 9P filesystem driver. so like, pick your kernel accordingly bestie π
π SEE ALSO π
and that's the whole page, bestie! go forth and build your little test VMs, you're gonna eat π
this lil writeup is from perl v5.40.1, dated 2026-03-23 π mwah, bye!
π¦ where this page comes from
- ubuntu resolute: debvm 0.5.2ubuntu1 Β· MIT
- ubuntu stonking: debvm 0.5.2ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms