DEBVM-RUN(1) | User Contributed Perl Documentation | DEBVM-RUN(1) |
debvm-run - Run a VM image created by debvm-create
debvm-run [-g] [-i image] [-s sshport] [-- qemu options]
debvm-run is essentially a thin wrapper around qemu for running a virtual machine image created by debvm-create or something compatible. The virtual machine image is expected to be a raw ext4 image with a non-empty file system label. The architecture of the machine is detected from the contained /bin/true. It must contain a symbolic link pointing to a kernel image at one of (|/boot)/vmlinu[xz] a symbolic link pointing to an initrd image at initrd.img in the same directory as the kernel image. Both are extracted and passed to qemu. A net interface configured for user mode is added automatically.
ssh -o NoHostAuthenticationForLocalhost=yes -p $sshport root@127.0.0.1
Run a virtual machine stored in the image rootfs.ext4 (the default) with local port 8022 routed to port 22 of the virtual machine. The -snapshot argument is passed to QEMU and prevents any permanent changes to rootfs.ext4, resulting in an ephemeral run.
debvm-run -s 8022 -i rootfs.ext4 -- -snapshot
Due to the way kernel and bootloader are being extracted before running qemu, one cannot upgrade a kernel and then just reboot. Attempting to do so, will still use the old kernel. Instead, qemu must be terminated and debvm-run should be launched again to pick up the new kernel. In order to avoid accidental reboots, one may pass -no-reboot to qemu.
debvm-create(1) qemu(1)
2023-03-21 | perl v5.36.0 |