Live data from Hacker News

Development on Apple Silicon with UTM

rkiselenko.dev

31–40 of 76 posts

Re: Development on Apple Silicon with UTM

#31
post #18

UTM is OK for light workloads, but if you can justify the cost of Parallels, you’ll be far better off using that.

I hate most things about Parallels. I spun up a Windows VM using Parallels for work purposes, and it decided to change from using native Chrome to open html files to using Edge in the Windows VM. So double-clicking a html file would first start the Windows VM, if it wasn't already started, and then open it in Edge inside the VM. WTF is wrong with you Parallels?

Re: Development on Apple Silicon with UTM

#32
post #29
post #19

Hmm I haven't tried x86 linux on utm on an arm mac (i have an x86 linux box i can ssh in), but i tried x86 windows. It was so slow as to be unusable. Edit: would command line linux be usable, considering it doesn't have to emulate all those pixels?

An x86 Linux VM on an ARM Mac is roughly native speed because it can utilize Rosetta 2: https://docs.getutm.app/advanced/rosetta/

Ahh. Thanks, I didn't know that.

Looks like you need to install an arm distro and x86_64 binaries on top of it though. May be a lot of trouble in some cases.

Re: Development on Apple Silicon with UTM

#33
post #15

Maybe I'm just really out of my depth on this, but it feels like there's not a lot of information about _why_ these particular steps and tools are used. Why are 4 different Linux images needed? Why are there all of these steps to create a one-time use "init.iso"? Is it just so the cloud-init script can run? I see the call to mkisofs is referencing "cidata", but it's the only place in the whole page that "cidata" show…

My thought was why use UTM? Most of this can be achieved with qemu alone :). But it showed me something new. The cloud init tool was new to me. From my toolbox I would have used ansible or something. But I think it very interesting that this runs all automatically during first boot. But I agree one needs to read between the lines to understand what the purpose of this post is. As you said it reads like a overcomplica…

Cloud-init isn't a replacement for ansible unless you're building your own VM images. cloud-init only runs on the first boot. You would use it to install and setup ansible.

Re: Development on Apple Silicon with UTM

#35
UTM is great when you’re using native ARM versions of Linux or Windows. Where it (or QEMU) is absolutely terrible is trying to emulate x86 for working on legacy apps or for retro computing.

For example, try installing a Windows 2000 vm. It won’t even get past the initial setup screen because it runs so slowly.

My saving grace has been that Windows 11 ARM also has its own x86 translation layer, so I can still run many (but not all) 32bit windows apps. But it’s been frustrating having such a powerful machine that can’t run an x86 vm.

Re: Development on Apple Silicon with UTM

#36

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.

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.

Re: Development on Apple Silicon with UTM

#37
post #7

Earlier quoted context omitted.

A lot of dev tooling still expects x86_64. Example off the top of my head, Cosmopolitan will not build ARM binaries and will not compile on ARM. (But it WILL build x86_64 universal binaries that will run on Apple Silicon and macOS via Rosetta.) There is also the issue of wanting to have your dev environment be as close to your prod environment as possible, and the vast majority of cloud-based hosting is still x86_64.

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 extra data point

I don't actually use it for this use-case but now that I'm thinking about it, I might try, because this seems useful

Re: Development on Apple Silicon with UTM

#39
post #16

Maybe I'm just really out of my depth on this, but it feels like there's not a lot of information about _why_ these particular steps and tools are used. Why are 4 different Linux images needed? Why are there all of these steps to create a one-time use "init.iso"? Is it just so the cloud-init script can run? I see the call to mkisofs is referencing "cidata", but it's the only place in the whole page that "cidata" show…

If you just need a single Linux VM, you don't need to fiddle with cloud-init. If you want repeatability or automation, that's when you'd reach for it, whether for setting up per-project VMs, shareable VM configs between developers etc. Also, you don't need all 4 Linux images, just the one you want to run as your guest OS. Emulation / virtualization depends on the guest OS CPU architecture.

Yep, I just install from the Fedora netinstall iso and do a normal install. I might be missing some features but it works for me.

The easiest way is to just choose from the UTM gallery. But I wanted Fedora 41, not 38 which is the latest in the gallery.

Re: Development on Apple Silicon with UTM

#40
post #22
post #15

Earlier quoted context omitted.

My thought was why use UTM? Most of this can be achieved with qemu alone :). But it showed me something new. The cloud init tool was new to me. From my toolbox I would have used ansible or something. But I think it very interesting that this runs all automatically during first boot. But I agree one needs to read between the lines to understand what the purpose of this post is. As you said it reads like a overcomplica…

> My thought was why use UTM? Most of this can be achieved with qemu alone Afaik UTM uses Qemu under the hood, but provides a nice UI on top for the basic use cases. It also has a library of prepared images, so that your VM is a few clicks away from intention to have one. It can also modify the VM, resize storage after creation etc. Of course all of it can be done with QEMU alone, but this makes it easier to deal wit…

Guess you misunderstood me. I know that UTM is built on top of qemu. I use it as well. I mean when already using this init image tooling etc why clicking through the UI to setup a VM. One would think to offload this also to a script. Because in the posts steps UTM is just a means to start the resulting image.
Post reply on HN