Run a macOS VM on Apple Silicon from a double-click with Vimy
eclecticlight.co
eclecticlight.co
You can always upgr.. no, wait
I never regret money spent on RAM....
That's kind of Apple's tiered upselling plan, isn't it? ;-/
But as an Apple user I concur completely. The awful experience of bloated apps (or multiple VMs) slowing your system to a crawl isn't worth the few hundred dollars you saved by opting for a lower memory SiP.
My plan right now is to buy a 2nd mac and use VS Code remote development over ssh.
- Docker, but the docker on mac experience has never been great (even if Colima or Orbstack makes that much better)
- A VM running on my mac where I install whatever I need. Tried debian, silverblue, and used the opportunity to properly learn Nix and use NixOS
- My current setup, especially for hairy projects with dependencies I dislike: an intel NUC running in my local network that I set up with NixOS which runs everything I need. Because I install Tailscale everywhere, I can use it even when working from outside my home.
You may use something that encapsulates your dev dependencies. Some use containers like docker, others use Nix (can be run on MacOS ). As Nix has quite a steep learning curve, there are abstractions such as devenv or devbox, which I haven't used.
[0] https://containers.dev [1] https://github.com/features/codespaces
SBCs have less horsepower but you can always run them from a USB battery bank, letting you dev on the go.
I've been coding for the past 2 years almost exclusively through VSCode remote on Linux servers with few complaints.
Get a seperate SFTP/network file client as the built-in VSCode one is slow and unstable but otherwise everything works great. If you're considering using any Jetbrains IDE over a network connection however, I'd encourage you to think again.
In the future Asahi or a native Ubuntu port might be a good option, but a VM is almost better in some ways since it's portable/migratable, has easy snapshots, has better isolation, etc.
So it would likely be much better to simply install qemu instead.
Also, running UTM instead of Qemu has some benefits. e.g. bridged networking
(I'm not a Mac user)
Me personally, I fool around with a lot of languages, and sometimes I don't quite keep every project up to date with the latest version. For work, the situation is even more challenging, because I don't have the authority to go tell teams to upgrade or not upgrade, but sometimes I need to build their projects.
None of this is really Mac specific. I used to use virtual box for this, which worked pretty well. I could set up a baseline environment and snapshot new boxes with new language revs.
Docker can kind of cover this, but I tend to over do it, breaking things out into the one you build with, and the one you run with, and it's fine, but it's a lot to keep in my head. So, I'm kinda flakey about that.
Now, I'm slowly building up some proficiency with nix. I think this is what I really want, to swap out the whole chain of system dependencies, and build docker containers or vms out of that if I need them.
Perhaps I'm a poor sysadmin. _everything_ locally installed makes things real weird after a while (years).
Same experience here (years). Because it’s something that creeps up over time, the problems aren’t obvious overnight.
I think I'm going to stick with nix. VM's, docker, orbstack and nix all seem to let me make a machine that looks like "X". The thing is, docker and VM's provide an abstraction that works 95% of the time, but that last 5% is awful (I don't know about orbstack).
Nix, by all appearances (and my limited experience) is much much worse up front. there's a lot to learn. But in exchange I get to keep control. This abstraction is wrong, we're not doing that, we're doing this. I'm not asking, I'm telling.
After the third or fourth time, I switched to a VM that will stay stable basically whatever happens to the system.
I don’t have a great answer. One thing I’ve noticed on Mac is that, using Activity Monitor, before installing all the dev dependencies for local dev nearly all processes seem to run under the local user’s user space, but after installing a bunch of stuff (with sudo) a ton of processes default to running as “system”
I haven’t had time to research whether this actually has a meaningful impact on security, but TLDR I trust Mac’s out of the box security, but I instantly stop trusting it the moment I start installing a bunch of stuff via Homebrew and NPM.
Homebrew is specifically designed to be used without elevated privileges. This has the downside that packages are owned by the user which first ran the install (which might lead to those packages running with elevated privileges after a sudo install as well? I don’t know, and I’m not eager to find out).
NPM packages are typically either project local (and these definitely shouldn’t be installed with sudo), or “global” (which should be global in the sense of being installed on the user’s PATH, and thus shouldn’t require sudo for any normal setup either).
You’re right to be cautious about the security implications of this.
This is a bit of a security problem if Homebrew's .../bin is on your sudoers secure_path, because now your normal user can overwrite something that might be invoked via a simple `sudo whatever`, which doesn't specify the full path to whatever
> which might lead to those packages running with elevated privileges after a sudo install as well? I don’t know, and I’m not eager to find out
No, definitely not by any normal mechanism. Maybe there are some exception, like packages that set up LaunchAgents or LaunchDaemons, or which run the install scripts of .pkg installers which ask for elevated privileges. But those can set up programs that run with elevated privileges anyway.
But of course, anything that runs on your Mac is a potential security hole. Obviously all 3rd party apps that you use can compromise security. But it can also be your own code: If eg. your rails app has a security vulnerability, which is common during development, and you run it with your local user, as is common during dev, then that vulnerability can potentially compromise all your data.
So if you want to be safe, run all your dev stuff in VMs or on a separate device, or in a container or something.
Of course, that is cumbersome, and whether it is necessary or not depends on what kind of threats you expect...
Docker for Redis/Mongo is reasonable, but npm dependencies creeping into the system is something you can’t really easily undo other than a full wipe and reinstall of the OS. Especially when certain modules require sudo to install
YMMV as performance can sometimes be an issue.
Back to terminal server again.
I don't develop for Mac yet I prefer a Macbook.
So does big brother Viable:
Since it is Eclectic Light, shipping it, I will bet it's great.
https://github.com/cirruslabs/tart
The very cool thing about Tart is how it uses OCI for OS images, so you can use your existing image registry infrastructure to host and pull down OS images.
Cilicon is a compatible F/OSS clone that currently only supports a subset of that functionality: https://github.com/traderepublic/Cilicon
These are more CI-oriented but I like how that makes it easy to manage state with them.
If you're focused on Linux VMs and maybe not on GUI stuff (although I'm sure you can make that work), Lima seems to be the go-to in the user 'community', as it were: https://github.com/lima-vm/lima
If you use ARM guests on Apple Silicon, you should get good perf just like with stuff in the OP. (Like UTM, Lima is based on QEMU.)
Utm is qemu, but they just removed the open source part. So it's just definitely worse.
My motivation here is exploring asahi on my MacBook inside a vm without needing to install it on the metal and modify partitions on the disk
Both Arch and Fedora, which some releases of Asahi are based on, have regular, shmegular ARM variants.
I am working on that project that needs to be built and packaged for both Arm & Intel.
I believe it needs extra work but can be done. It's a relatively common question in the Hackintosh community and they've figured it out.