Go to file
Shiz 16637d6d16 scripts: fix quoting issues 2022-04-05 23:14:51 +02:00
vm scripts: fix quoting issues 2022-04-05 23:14:51 +02:00
LICENSE epoch 2017-03-29 05:12:32 +02:00
README.md doc: update setup instructions 2022-04-05 22:08:25 +02:00
init.rc big update 2022-04-05 22:03:08 +02:00



Scripts to manage QEMU-based VMs.


I didn't like libvirt.


Copy the vm folder to your /etc, or elsewhere and adjust the rootdir= statements in the scripts/ files. Optionally, make symlinks for vm-<script> to /etc/vm/scripts/<script> in your /usr/local/sbin, and copy init.rc to /etc/init.d/vm for an OpenRC init script. It can be copied as vm.<name> as well to only start a specific VM.

You're gonna want to have tmux and qemu-system-x86_64 installed, as well as KVM (CONFIG_KVM) and macvtap (CONFIG_MACVLAN) support in your kernel.


These scripts presume a setup like Hetzner, where IPv4s and IPv6 ranges are directly routed to your machine and a macvtap interface can accept them.


  • machines.d: Main VM configurations for QEMU;
  • conf: VM configurations for vm-utils;
  • include: Include files for VM configurations;
  • scripts: Various scripts to automate VM management:
    • start: Start a VM named by machines.d/<name>.conf;
    • stop: Stop a VM named by machines.d/<name>conf;
    • attach: Attach to management console of VM named by machines.d/<name.conf>;
    • launch: Launch VM in current terminal session and attach to management console; used by start
    • ifup/ifdown: Network interface management scripts;

Adding a new VM

  1. Add an entry in machines.d, see example.conf for format;
  2. Add an entry in conf, see example.conf for format;
  3. Create a new disk: qemu-img create -f qcow2 /var/vm/disks/<name>qcow2 <size>G;
  4. Start the VM: scripts/start <name>.


WTFPL; see LICENSE for details.