logoalt Hacker News

Ditching Vagrant: VMs with KVM and Virsh on Debian

63 pointsby fanf2last Monday at 2:42 PM25 commentsview on HN

Comments

fulafeltoday at 4:18 PM

For many use cases you'll do fine without the libvirt tower of babel, with just the qemu/kvm cli.

veetitoday at 2:34 PM

I never got into Vagrant but "lima" has worked well for spinning up (temporary) VM's quick: https://lima-vm.io/

There's plenty of images for different distributions, automatic file sharing between host and guest, etc.

stefanhatoday at 12:51 PM

virt-builder is an alternative to installing a guest OS from scratch. It has a selection of popular guest OSes template images that you can quickly install non-interactively.

It's convenient when you don't want to manually install a guest and also don't want to figure out preseed/kickstart/etc.

It makes creating new KVM guests easier and has handy features like the ability to copy in ssh keys so you can connect to the guest right away.

cortesofttoday at 3:24 PM

Most of my vagrant usage is from when a coworker has set up a vagrant file for a project.

happyPersonRlast Monday at 3:28 PM

There used to be virt-manager

Wonder if it’s still around ? Hope it’s doing well !

show 5 replies
SkipperCattoday at 2:09 PM

This is the first time in my entire life I've ever seen someone use a Plan 9 formatted disk. Deep respect.

show 2 replies
exabrialtoday at 3:08 PM

Honestly though... why not just systemd containers with minimal mounts, and if you're needing an ip, what not an unprivledged LXC container? The surface area is far smaller and they're way easier to inspect.

zamadatixlast Monday at 4:17 PM

This is another area I hope I'm able to migrate to systemd. I already use nspawn for containers but vmspawn is still a bit new and limited in the options. Once it gets there though it'll be nice to have system+containers+vms under one consistent roof.

shellwizardlast Monday at 6:01 PM

Have you tried distrobox/toolbox instead of having to spin up VMs? Also microvm looks nice

guilhastoday at 3:08 PM

vagrant, docker, qemu, lxc, libvirt, incus, proxmox, nixos, guix, incusos, talos, microVMs, distrobox, distrobuilder, ansible, terraform, cloud-init... Just crazy layers of choice and combinations

I am trying vanilla qemu with cloud-init. Images: https://images.linuxcontainers.org/images/

s8kurtoday at 11:20 AM

Membership in the libvirt group is root-equivalent, not a permissions fix. Through qemu:///system it lets you attach arbitrary host block devices to a VM, so anyone in that group can mount and read the host's own disk. If you want to manage VMs without root or that group, use qemu:///session instead: unprivileged, images live under ~/.local/share/libvirt, no sudo. Tradeoff is you lose bridged networking without a setuid helper.

pollux360today at 2:12 PM

[flagged]

rom3odeltatoday at 1:40 PM

[flagged]