Use VMs. VirtualBox is fine for tinkering. If you need more resources, then build a server (or use a refurb computer as a cheap server), and use a hypervisor such as ESXi or Proxmox to compartmentalize its resources.
It’s wasteful to run one instance == one machine – even if that machine is cheap – unless you have a *reason* to do so (e.g. the only baremetal nodes I have are running hash collisions, since it takes 100% of the CPUs).
Being able to snapshot and roll back instances is important when you’re doing stuff which, yknow, intentionally breaks or infects or otherwise destroys them.