Live data from Hacker News

Development on Apple Silicon with UTM

rkiselenko.dev

61–70 of 76 posts

Re: Development on Apple Silicon with UTM

#61
post #58
post #45

Ever since I discovered OrbStack, my M1 has become the perfect laptop for me. OrbStack has great UX, massive FS performance, Docker & Kubernetes support, and a bunch of really clever people behind it. Everyone doing linux development on a Mac should try it

It's really good but the fs caching has bit me a couple times before I realized what was going on.

Can you tell more about this?

Re: Development on Apple Silicon with UTM

#62
post #45

Ever since I discovered OrbStack, my M1 has become the perfect laptop for me. OrbStack has great UX, massive FS performance, Docker & Kubernetes support, and a bunch of really clever people behind it. Everyone doing linux development on a Mac should try it

Orbstack is great! I'm wondering why there is not an open-source equivalent? Did they have to reimplement a lot of the native calls to make it work fast enough?

Re: Development on Apple Silicon with UTM

#63
post #36

Earlier quoted context omitted.

UTM uses Rosetta via qemu. It’s the most direct way of emulating x86 on Apple Silicon, using native Apple emulation layer.

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…

Re: Development on Apple Silicon with UTM

#64
post #45

Ever since I discovered OrbStack, my M1 has become the perfect laptop for me. OrbStack has great UX, massive FS performance, Docker & Kubernetes support, and a bunch of really clever people behind it. Everyone doing linux development on a Mac should try it

What are the real-world benefits over Colima?⁽¹⁾ (Besides having a GUI, which I can do without.)

I'm interested in an up-to-date comparison when running the VM with Rosetta 2:

    colima start --vm-type=vz --vz-rosetta
⁽¹⁾ https://github.com/abiosoft/colima

Edit to add: While researching OrbStack, I found this comment in a post from 7 months ago that mirrors a lot about my experience with Colima: https://news.ycombinator.com/item?id=41424044

Re: Development on Apple Silicon with UTM

#65
post #44
post #26

Earlier quoted context omitted.

> The issue is that of course Apple computers that are large enough to run VMs are… expensive. Expensive compared to what? UTM uses Apple Virtualization Framework, which lets the guest VM only occupy as much memory as it's actually using (instead of reserving all of its available memory). This means it's viable to run a Linux VM on e.g. an 8GB RAM MacBook Air.

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 applications.

Re: Development on Apple Silicon with UTM

#66

Earlier quoted context omitted.

Building on a virtual x86_64 barely achieves the performance when building on host, if there was an applicable way.

Fair enough, but (speaking as a web developer), running a stack locally on Apple Silicon (especially if it has any "interesting" dependencies such as compiled Rust/C libs and whatnot) and expecting the same stack to run identically in the cloud on x64 can still expose differential behavior At the very least, I could test mock deploys from the Apple Silicon side to the x64 VM running locally (over loopback) as an extr…

From a web standpoint it's possible, but when I tried building AOSP on macOS, it didn't turn out great.

Re: Development on Apple Silicon with UTM

#67

Earlier quoted context omitted.

With virtualisation you can use Rosetta 2 for Linux to run x86_64 binaries. That's what I do and it's more efficient.

UTM uses Rosetta via qemu. It’s the most direct way of emulating x86 on Apple Silicon, using native Apple emulation layer.

You can't do Rosetta 2 for Linux thru qemu as qemu doesn't use Virtualization.Framework. UTM does support virtualisation via VF.

Re: Development on Apple Silicon with UTM

#68
post #20

Earlier quoted context omitted.

> My thought was why use UTM? Most of this can be achieved with qemu alone :) qemu needs to be studied a bit, UTM is fairly intuitive. I recently decided to learn how to create VMs with bare qemu (using the command-line). As I have an arm macbook for work, UTM helped me a ton with aarch64 virtual machines because I could enable debug log and see what qemu options/flags/switches would UTM use. Unrelated: I have some i…

Here is some advice: Theoretically the entire docker workflow can be translated to VMs. In practice it is a shit show. The biggest problem by far is building a VM image, because it consists of multiple highly irritating steps. 1. Building custom packages for the target distribution. Since we aren't using containers, we would in principle need a full VM per application. This is not a good idea in practice. We want to…

Is this whole wall of text slop ai-generated content? It’s completely irrelevant wrt what i posted.

Re: Development on Apple Silicon with UTM

#70
post #64
post #45

Ever since I discovered OrbStack, my M1 has become the perfect laptop for me. OrbStack has great UX, massive FS performance, Docker & Kubernetes support, and a bunch of really clever people behind it. Everyone doing linux development on a Mac should try it

What are the real-world benefits over Colima?⁽¹⁾ (Besides having a GUI, which I can do without.) I'm interested in an up-to-date comparison when running the VM with Rosetta 2: colima start --vm-type=vz --vz-rosetta ⁽¹⁾ https://github.com/abiosoft/colima Edit to add: While researching OrbStack, I found this comment in a post from 7 months ago that mirrors a lot about my experience with Colima: https://news.ycombinator…

I use Colima as well. Haven’t found anything that works better, TBH.
Post reply on HN