• saagarjha 8 hours ago |
    (This also works on baremetal Linux, though Apple of course does not support that usecase.)
    • commandersaki 6 hours ago |
      Isn't there a haiku embedded in the rosetta binary asking for it not to be pirated?
      • Aaron2222 6 hours ago |
        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?
  • gttalbot 8 hours ago |
    Is Apple going to upstream this so it's part of Linux?
    • saagarjha 7 hours ago |
      • londons_explore 6 hours ago |
        > 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...

      • mschuster91 5 hours ago |
        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.
    • pixelesque 7 hours ago |
      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...

  • adrianmoisey 8 hours ago |
    Anyone know if tools like Docker or colima use this?
    • speedgoose 7 hours ago |
      For colima, you can add --vm-type=vz --vz-rosetta to the start command. It's qemu by default.
      • adrianmoisey 7 hours ago |
        That uses rosetta, but does it use this feature?
        • lloeki 7 hours ago |
          AFAICT no because it needs a kernel patch which is not applied in the base Linux system colima is using:

              $ colima ssh
              $ dpkg -l |grep linux-image
              ii  linux-image-6.8.0-31-generic   6.8.0-31.31                       arm64        Signed kernel image generic
              hi  linux-image-virtual            6.8.0-31.31                       arm64        Virtual Linux kernel image
          • rcarmo 6 hours ago |
            Well, at least the Colima developers can consider making that patch standard in their build process.
          • adrianmoisey 6 hours ago |
            Thanks for the clarity! I hope they add it.
          • cassianoleal 4 hours ago |
            I've opened a feature request with them. Feel free to add comments or upvote it! :)

            https://github.com/abiosoft/colima/issues/1186

      • delduca 7 hours ago |
        How about OrbStack?
    • saagarjha 7 hours ago |
      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?
  • physicsguy 7 hours ago |
    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.
    • saagarjha 7 hours ago |
      Rosetta has AVX2 support as of this year.
      • physicsguy 7 hours ago |
        Ha! Well that’s my employer keeping us on 14 for now then to blame for that one.
    • galad87 7 hours ago |
      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.
  • commandersaki 6 hours ago |
    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.

    • arghwhat 6 hours ago |
      > 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.

      • pjmlp 6 hours ago |
        And the only way Desktop Linux will actually grow beyond the usual 1%.
        • ChocolateGod 6 hours ago |
          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.
          • cassianoleal 4 hours ago |
            It works on GUI VMs as well. UTM makes it very easy to use.

            I agree it still doesn't help much with the desktop Linux bit though. :D

          • pjmlp 2 hours ago |
            It may not count, but that is what you will get in most shopping malls as "Desktop Linux" for common folks.

            Even if you add Chromebooks as third option, Crostini runs in a VM just like WSL 2, and still has quite a few integration issues to this day.

            Netbooks could have been it, but first they were torpedoed with Microsoft's clever move to make Windows XP licenses free for those OEMs, followed by the introduction and wide adoptions of tablets.

            OEMs like Tuxedo or System 76 will remain a niche compared to how many people end up running GNU/Linux on desktop VMs.

            Before WSL I had long moved away from dual boot into VMWare Workstation.

        • anonzzzies 6 hours ago |
      • commandersaki 6 hours ago |
        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.
        • iforgotmysocks 6 hours ago |
          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.
    • therealmarv 6 hours ago |
      May you explain how you use it practically? How do you get it working in your choice of Linux?
      • commandersaki 6 hours ago |
        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).
    • wslh 6 hours ago |
      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?

      • commandersaki 6 hours ago |
        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.

    • cassepipe 6 hours ago |
      May I ask what felt wrong with Linux on the Framework ?
  • therealmarv 6 hours ago |
    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).