I know many people use VMs for work, or to test things they develop. Makes sense.
But what else do people use it for? I want to hear interesting or unusual things you use a VM for.
For example, I have thought of running a VM only to use git in there, maybe so try and see if magit will run faster in a VM rather than on the host macos. I also have thought of using a VM to only run a browser in there, to keep the memory under control. Not sure any of these are good, but they are interesting.
What are your ideas or actual ways you use VMs?
For other Linux users out there — a VM is not needed for this, use a cgroup with memory limits. It's very easy to do with systemd, but can be done without it:
The kernel will prevent Firefox from using more than 2 GiBs of RAM by forcing it into swap (including all child processes). To quote systemd.resource-control(5):> Specify the throttling limit on memory usage of the executed processes in this unit. Memory usage may go above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away aggressively in such cases. This is the main mechanism to control memory usage of a unit.
If you'd rather have it OOMed, use MemoryMax=2G.
It's actually very useful for torrent clients. If you seed terabytes of data (like I do), the client quickly forces out more useful data out of the page cache. Even if you have dozens of gigabytes of RAM, the machine can get pretty slow. This prevents the client from doing that.
There are lots of other interesting controllers that can put limits on disk and network I/O, CPU usage, etc.