Prereqs:

sudo apt update
sudo apt install \
  build-essential \
  gpg \
  lsb-release \
  wget

Install libvirt-related prereqs:

sudo apt install virt-manager libvirt-dev

Add self to libvirt group:

sudo gpasswd -a $USER libvirt ; newgrp libvirt

Add HashiCorp repo:

wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list

Install vagrant and plugins:

sudo apt update
sudo apt install vagrant 
vagrant plugin install vagrant-libvirt

Prepare a Vagrant directory:

mkdir vagrant-bullseye
cd vagrant-bullseye
vagrant init debian/bullseye64

Install rsync:

sudo apt install rsync

Enable rsync (and disable NFS, which isn’t supported within LXD) for Vagrant by editing the Vagrantfile to include:

  config.nfs.verify_installed = false
  config.vm.synced_folder '.', '/vagrant', type: 'rsync'

Start the VM:

vagrant up

Log in:

vagrant ssh