Live data from Hacker News

Development on Apple Silicon with UTM

rkiselenko.dev

71–76 of 76 posts

Re: Development on Apple Silicon with UTM

#72
post #30

I’n about to embark on my first Apple Silicon machine tomorrow, and UTM is a core part of my plans for it. The difference from TFA, for me, is that I already have some mature Nix flakes for doing development in WSL that I’ve built up over the last year. If I can’t have that environment bake a VM for me wholesale, it’s probably a short `nixos-rebuild switch --flake` away.

Keep Colima on your radar. Best way to run Docker on a Mac, IMHO.

Re: Development on Apple Silicon with UTM

#73
post #36

Earlier quoted context omitted.

Then you're emulating everything that runs in the VM, as opposed to using an ARM vm and only emulating the x86 program you want to run. This makes things a lot slower.

That’s a good point… but does Rosetta in a Linux VM somehow use the native MacOS hypervisor? I would like to see a benchmark of these various methods…

I don't know how Rosetta 2 for Linux is implemented in Virtualization.Framework - but it exposes it via a mountpoint on the (ARM) Linux VM. The binfmt executable that is exposed essentially does what Rosetta 2 does but for a Linux binary.

I think the binfmt executable can be used outside of Virtualization.Framework and can even be used in an ARM VM in say Asahi but people don't because it's not easy to do but also honour system as it's not licensed for use outside of MacOS.

Re: Development on Apple Silicon with UTM

#74
post #38
post #13

I've had a really good time using https://github.com/lima-vm/lima

I also suggest https://github.com/abiosoft/colima for containers, "Containers on Lima"

Big fan. I will say Orbstack is superior - and can be more performant with mountpoints but colima does pretty much everything I need and is FOSS.

Re: Development on Apple Silicon with UTM

#76
post #65
post #44

Earlier quoted context omitted.

How can I verify that? it definitely looks in htop and Activity Monitor that the RAM is occupied and unavailable. Maybe memory compression helps, but it doesn’t appear so to me right now.

> How can I verify that? Good question. I was speaking from memory, and all I can find when googling is this: https://docs.getutm.app/settings-apple/virtualization/#ballo... EDIT: I recall vaguely something about it being a problem with Linux guest VMs because it aggressively uses RAM as a file system cache. So it'll just fill up RAM to the max when reading from disk, and overwrite this if it's later needed by applic…

balloon memory is supported by qemu on linux too.
Post reply on HN