Libvirt Powered Claude Sandbox A developer built a Libvirt-powered sandbox for Claude using a Bash script that provisions a Debian 13 LXQt desktop VM with Chrome for acceptance testing. The script runs without sudo, manages VM lifecycle and a dedicated NAT network, and includes a teardown function for complete removal. | /usr/bin/env bash | | set -euo pipefail | | ───────────────────────────────────────────────────────────────────────────── | | uat provisioner — LXQt + Chrome acceptance-testing desktop under qemu:///system. | | Runs entirely as your normal user no sudo : disks live in a path you own, | | and libvirtd already root does the privileged VM/network work. | | Keep uat-cloud-init.yaml and uat-net.xml next to this script. | | ───────────────────────────────────────────────────────────────────────────── | | | | Pin a clean PATH so a custom python pyenv/conda/etc. can't shadow the system | | python3 this script uses to render cloud-init. | | export PATH=/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games/:/usr/sbin/ | | | | VM=uat | | RAM=8192 MB boot/resting target -