Also, what you're describing already exists, it's called iSH. It runs an x86 emulator with a copy of Alpine Linux inside. Somehow, they even convinced App Review to allow it (yes, Apple did threaten to remove it at one point, they backed down). You can use this penalty box to run pretty much any developer tool you like, you can mount file providers inside of the VM, etc. The only limitation is that it's x86 emulation is incomplete, I can't get it to run cargo so I can't compile Rust programs on it yet.