One way you can work around the above scenario is to install multiple virtual machines. Now the first thing you might realize is that this will also take up a lot of compute and storage.
In reality, I use to use this method myself in the past using Hyper-V. To reduce the amount of storage the virtual machines used in Hyper-V I use to used parenting disks.
Since the introduction of containers and Docker this has become a less popular option. However, you can still read an old post of mine with tips inĀ here.
Click through for additional options.