lxd init # choose defaults except use "dir" for disk
lxc launch ubuntu:22.04 my-ubuntu # or any other distro
lxc exec my-ubuntu -- bash
Clean, lightweight, full virtual machine every time that's much less heavy than Virtualbox. You can mess around in there as much as you want without creating the quagmire you speak of on your main installation, because it's a full, completely clean VM isolated away. Also lots of distros to choose from. Personally I find Windows to be super unstable once you've installed/uninstalled a bunch of stuff. Obviously, there's also Docker but sometimes you want a full VM to get a bunch of stuff working together.