Can anybody here recommend a good way to get a basic Linux VM running on my (Apple Silicon) Mac?
I don’t want to mess with bootcamp or anything crazy like that. Ideally I don’t want to have to install some massive distribution I only need 1% of.
I pretty much need vi and a recent version of clang++ (or g++) and bison. Well, and a way to either communicate with the parent OS, or the ability to connect to my GitHub.
The only parts of my code that are platform-dependent are some memory leak tracking code in the compiler (already marked up with #ifdef APPLE and the terminal handling code in the interpreter (even that is mostly VT-100 escape sequences).
UTM is good for this as well. It is a wrapper for qemu with a management interface. For best performance you should install the ARM version of a recent Linux distro.
To test Mac builds of Dialog, we currently use Github’s automated build tools. It’s free for open-source projects and means that, no matter which platforms we’re developing on, we can run all the test cases on both Mac and Linux machines before accepting a pull request. (Not Windows currently because its terminal equivalent is so different, so translating the testing pipelines is agony.)
The same system compiles the binaries for each platform when we release. I’d never used this system before Dialog, but it’s so convenient, I’ve set it up for the Å-machine project as well.
VMware Fusion is now free. There’s also VirtualBox, but it’s slower. Either way, I’d recommend something like Fedora for the install — it’s pretty easy to install. Normally I’d recommend Debian, but Debian’s currently a pain to install in VMware on ARM. Ubuntu is increasingly weird as they move to using Snap for everything.
Make sure you download the ARM64 / aarch64 install image for whatever Linux you pick.