Spin up Linux VMs with QEMU.
In the above image: Docker running on ARM64 Ubuntu Virtual Machine.
- Linux, macOS or Windows (needs testing) host OS.
- QEMU installed and available in the image, you can install it with homebrew or your package manager of choice. VMKit uses
qemu-imgbinary,qemu-system-aarch64binary on ARM64 andqemu-system-x86_64binary on AMD64.
The only way for now is to have a working Go environment and install VMKit by running this command:
go install github.com/alessiodionisi/vmkit@latestCreate a Debian 12 (Bookworm) virtual machine with 4 CPUs, 4096 mebibytes of ram and 20 GB of disk by running this command:
vmkit run debian12 -i debian:bookworm -c 4 -m 4096 -d 20Run uname -a inside the virtual machine by running this command:
vmkit exec debian12 -- uname -aYou can get SSH parameters by running this command:
vmkit ssh debian12On Unix systems you can quickly connect via SSH by running this command:
$(vmkit ssh debian12 --command)With vmkit run you can create and start a new virtual machine.
VMKit will automatically create a pair of SSH keys and configure the chosen system via cloud-init. If not specified, a forward to guest port 22 will be created using a free port. This will be used to access the virtual machine via SSH.
Example:
vmkit run debian12 -i debian:bookworm -c 4 -m 4096 -d 20Available options:
-c,--cpunumber of cpu(s) (example:-c 4)-d,--disk-sizedisk size in gigabytes (GB) (example:-d 20)-i,--imageimage to use (example:-i debian:bookworm)-m,--memoryram in mebibytes (MiB) (example:-m 4096)-p,--port-forwardforward host port to the virtual machine (example:-p 8080-80,-p [host]-[guest])
With vmkit remove or vmkit rm you can remove a virtual machine.
Example:
vmkit remove debian12With vmkit start you can start a virtual machine.
Example:
vmkit start debian12With vmkit stop you can stop a virtual machine.
Example:
vmkit stop debian12