Rosetta 2 for Linux is my favourite feature of Mac at the moment. I've been working on a project for many years that had a hard dependency on a library that only compiled on amd64 architecture. So for the longest time I was dual wielding a Mac and Framework laptop. I really hated switching between the two and moreso using Linux on my Framework; just felt like a bleh experience. When Rosetta 2 for Linux came around, I immediately started using it and was fully productive developing on our Intel only projects. I don't see any perceivable speed loss, t hough we had to adjust some sleeps for a few concurrency/threading tests to accommodate Rosetta.
Apple really did not have to make Rosetta 2 available for Linux. If they hadn't, it wouldn't even register a blip on the users / market share of Macs/MacOS. But it's just one of those hidden gems of the OS, and going by this article they haven't stopped improving on it.
Most Linux dev environments do not need to be tied down to Intel. In fact it is more performant and efficient if you're working on ARM native on Linux. It was already a good Linux dev env before Rosetta 2 was on the scene, they just enabled more use cases with Rosetta 2.
I also do not see much need for Rosetta support for Linux as arm64 Linux works fine for most of my use cases. However it is definitely better to have Rosetta support than not having it.
I do it all via docker. I execute `docker --platform linux/amd64 <run|build>` and it uses Rosetta 2 for Linux in the VM (colima sets the rest up automatically).
Curious about your setup, especially regarding GUI support: are you running Rosetta in the GUI VM? I haven't tried Rosetta yet myself, and I'm considering options for a stable Linux VM (not frequently creating and removing VMs). I'd appreciate any insight!
Also, reading through this thread has given me an "aha" moment about the under-the-radar innovations Apple is building. Many people criticize Apple without understanding these aspects, and I’m not an Apple fanboy. I had similar realizations with Microsoft’s .NET, which I still believe is incredible underrated.
Lastly, how does running the Linux VM impact battery management efficiency?
I only run Rosetta 2 for Linux via `docker --platform linux/amd64 <run|build>` which triggers the rosetta helper in the underlying docker VM to do the right thing. I use colima for a docker VM which sets up Rosetta 2 automatically.
I don't know anything about GUI use; I don't run Linux for GUI stuff.
Linux VM affects battery proportional to how much you use it. For example when I build our projects that take 12 minutes running across all cores, I'm using the laptop at 100%. When I'm not using docker, the VM is idle, and therefore doesn't really impact battery whatsoever.
Biggest issue I run into now with Rosetta + Linux VMs/Docker is not having support for translating the AVX vector extensions, since they're becoming more and more common in compiled binaries. For more popular things there's typically an ARM image but that's by no means guaranteed, and compiling your own to support ARM can be quite involved.
The latest version of Rosetta on macOS 15 can translate up to AVX2. However I don't know if the capability is enabled by default or exposed in the Linux VMs.
Finally. Some long time ago I filed a ticket for UTM and QEMU if TSO (and Rosetta) could be used for VMs because x86 VMs on ARM CPUs are dog slow at the moment, but back then this wasn't on the horizon. Good to see Apple themselves are working on it.
I don't think anyone is using this, given that the register it touches was not really officially documented until now. Maybe the OrbStack people were crazy enough to try?
Rosetta 2 for Linux is my favourite feature of Mac at the moment. I've been working on a project for many years that had a hard dependency on a library that only compiled on amd64 architecture. So for the longest time I was dual wielding a Mac and Framework laptop. I really hated switching between the two and moreso using Linux on my Framework; just felt like a bleh experience. When Rosetta 2 for Linux came around, I immediately started using it and was fully productive developing on our Intel only projects. I don't see any perceivable speed loss, t hough we had to adjust some sleeps for a few concurrency/threading tests to accommodate Rosetta.
Apple really did not have to make Rosetta 2 available for Linux. If they hadn't, it wouldn't even register a blip on the users / market share of Macs/MacOS. But it's just one of those hidden gems of the OS, and going by this article they haven't stopped improving on it.
> Apple really did not have to make Rosetta 2 available for Linux.
The kinda did - offering good Linux dev environments is now a fairly big feature for both of the major Desktop OS's nowadays.
Most Linux dev environments do not need to be tied down to Intel. In fact it is more performant and efficient if you're working on ARM native on Linux. It was already a good Linux dev env before Rosetta 2 was on the scene, they just enabled more use cases with Rosetta 2.
I also do not see much need for Rosetta support for Linux as arm64 Linux works fine for most of my use cases. However it is definitely better to have Rosetta support than not having it.
And the only way Desktop Linux will actually grow beyond the usual 1%.
I don't think it counts as Desktop Linux if its running in a CLI-only VM targeted at developers on a different host OS.
https://gs.statcounter.com/os-market-share/desktop/worldwide
so 6%+ then :)
May I ask what felt wrong with Linux on the Framework ?
May you explain how you use it practically? How do you get it working in your choice of Linux?
I do it all via docker. I execute `docker --platform linux/amd64 <run|build>` and it uses Rosetta 2 for Linux in the VM (colima sets the rest up automatically).
Curious about your setup, especially regarding GUI support: are you running Rosetta in the GUI VM? I haven't tried Rosetta yet myself, and I'm considering options for a stable Linux VM (not frequently creating and removing VMs). I'd appreciate any insight!
Also, reading through this thread has given me an "aha" moment about the under-the-radar innovations Apple is building. Many people criticize Apple without understanding these aspects, and I’m not an Apple fanboy. I had similar realizations with Microsoft’s .NET, which I still believe is incredible underrated.
Lastly, how does running the Linux VM impact battery management efficiency?
I only run Rosetta 2 for Linux via `docker --platform linux/amd64 <run|build>` which triggers the rosetta helper in the underlying docker VM to do the right thing. I use colima for a docker VM which sets up Rosetta 2 automatically.
I don't know anything about GUI use; I don't run Linux for GUI stuff.
Linux VM affects battery proportional to how much you use it. For example when I build our projects that take 12 minutes running across all cores, I'm using the laptop at 100%. When I'm not using docker, the VM is idle, and therefore doesn't really impact battery whatsoever.
Biggest issue I run into now with Rosetta + Linux VMs/Docker is not having support for translating the AVX vector extensions, since they're becoming more and more common in compiled binaries. For more popular things there's typically an ARM image but that's by no means guaranteed, and compiling your own to support ARM can be quite involved.
Rosetta has AVX2 support as of this year.
Ha! Well that’s my employer keeping us on 14 for now then to blame for that one.
The latest version of Rosetta on macOS 15 can translate up to AVX2. However I don't know if the capability is enabled by default or exposed in the Linux VMs.
(This also works on baremetal Linux, though Apple of course does not support that usecase.)
Isn't there a haiku embedded in the rosetta binary asking for it not to be pirated?
You might be thinking of the one in the SMC of Intel Macs that macOS uses to check that it's running on an actual Mac?
It is also a thing for Rosetta 2 for Linux: https://news.ycombinator.com/item?id=37221013
That kind of thing was very common back in the day, although usually not so polite
https://tcrf.net/Mad_Professor_Mariarti
https://tcrf.net/Jurassic_Park_(Amiga,_ECS)
Is Apple going to upstream this so it's part of Linux?
Apple submitted a patch, and then Hector Martin of Asahi Linux also submitted an alternative:
https://lore.kernel.org/lkml/20240411132853.GA26481@willie-t...
but it was rejected due to concerns of fragmentation and it being non-standard...
They tried: https://lwn.net/Articles/969480/
> This program will hang indefinitely if TSO is in use, and will crash almost immediately if it is not in use.
So now we just need to solve the halting problem, and we'll have our answer...
Finally. Some long time ago I filed a ticket for UTM and QEMU if TSO (and Rosetta) could be used for VMs because x86 VMs on ARM CPUs are dog slow at the moment, but back then this wasn't on the horizon. Good to see Apple themselves are working on it.
Patching the Linux Kernel... one of the things I don't want to do ever as a normal user (even if I'm a developer).
I'd assume that Apple plans on upstreaming the patch, but that they it as a separate patch as long as it isn't?
Edit: apparently they already tried: https://news.ycombinator.com/item?id=42074961
Anyone know if tools like Docker or colima use this?
I don't think anyone is using this, given that the register it touches was not really officially documented until now. Maybe the OrbStack people were crazy enough to try?
For colima, you can add --vm-type=vz --vz-rosetta to the start command. It's qemu by default.
That uses rosetta, but does it use this feature?
AFAICT no because it needs a kernel patch which is not applied in the base Linux system colima is using:
Well, at least the Colima developers can consider making that patch standard in their build process.
Thanks for the clarity! I hope they add it.
How about OrbStack?