Create various flavours of linux VMs in no time.
Currently only one command: kvm-guest-create
- Takes ~35 seconds from running script till SSH being available
- Amazon Linux 2, Fedora, Rocky Linux
- Guests findable by name from host and each other with zero config
- On first boot: - runs system update - installs tailscale
- bash completion on available distros
- fix ssh between guests (Add Tailscale domain to /etc/resolv.conf)
GUEST_NAME=grafana
export LIBVIRT_IMAGES_DIR=~/.libvirt/images # optional for non-root usage
sudo bin/kvm-guest-create "${GUEST_NAME}-amazon" amazon
sudo yum install -y \
genisoimage \
guestfs-tools \
libvirt \
libvirt-client \
libvirt-dbus \
policycoreutils-python-utils \
qemu-kvm \
virt-install \
virt-manager \
virt-viewer \
sudo systemctl enable --now libvirtd.service # required?
- Configure Rootless access
- Use libvirt as non root user
- Change default location for libvirt-images
Optionally update the default username / password / SSH public key.
Make guests addressable from host by name:
sudo yum install -y libvirt-nss ## RHEL/CentOS/Fedora ##
sudo apt install libnss-libvirt ## Debian/Ubuntu ##
Add libvirt libvirt_guest
to hosts entry of nsswitch:
$ grep hosts /etc/nsswitch.conf
hosts: files libvirt libvirt_guest dns
bin/kvm-guest-create GUEST_NAME [GUEST_TYPE] # amzn2, fedora, rocky, etc
Connect to guest console:
virsh console $GUEST_NAME
SSH to it's IP address (accessible by name from host or other guests):
ssh admin@$GUEST_NAME