News for hackers. Stuff that matters.
Re:Running Intel Binaries in Linux VMs with Rosetta by eckza on Monday June 06, 2022 @04:58PM (#31646163)
Soooo does this mean that Docker will suck less on macOS, Real Soon Now?
Re:Running Intel Binaries in Linux VMs with Rosetta by samwillis on Monday June 06, 2022 @05:44PM (#31646751)
I believe the main issue is file syncing between macOS and the container host OS.

I don’t have a M1 mac, but on my Mac a standard Linux VM has no impact on performance or battery life. The minute I use Docker the machine become sluggish and halves (literally) the batter life, I now avoids is as much as possible.

Re:Running Intel Binaries in Linux VMs with Rosetta by laurencerowe on Monday June 06, 2022 @06:27PM (#31647205)
Have you tried enabling "Use the new virtualization framework" in experimental features? This removed the background CPU usage for me.
Re:Running Intel Binaries in Linux VMs with Rosetta by zamalek on Monday June 06, 2022 @06:38PM (#31647325)
Try out Colima with the experimental 9p mount type. Network performance is improving. It's as good as it will likely get on the platform.
Re:Running Intel Binaries in Linux VMs with Rosetta by eckza on Tuesday June 07, 2022 @07:30AM (#31652604)
I have a M1 Macbook Pro with 16 GB RAM, and qemu ballons in RAM when I try to stand up our backend microservice stack locally - it uses RAM until there's none left, and falls over. My teammates running Linux report ~30mb of RAM usage by the Docker processes to run the same containers.
Re:Running Intel Binaries in Linux VMs with Rosetta by dmt0 on Tuesday June 07, 2022 @10:39PM (#31662590)
Vagrant solved most of my problems. Docker Desktop was unusable to me as well.
Re:Running Intel Binaries in Linux VMs with Rosetta by saagarjha on Monday June 06, 2022 @05:28PM (#31646531)
This can't boot x86-64 containers, but you can create an arm64 container and run x86-64 code in it.
Re:Running Intel Binaries in Linux VMs with Rosetta by akdor1154 on Monday June 06, 2022 @06:42PM (#31647359)
I don't think that's right - containers are just userspace code, nothing to boot.

By my reading of TFA, your container runtime (eg Docker for Mac) should be able to provide an ARM VM, and use this Rosetta feature to run amd64 containers directly.

Re:Running Intel Binaries in Linux VMs with Rosetta by cromka on Monday June 06, 2022 @07:13PM (#31647676)
Containers that you and everyone else think of use Linux distros as a base, so yeah, anything else than Linux actually had to boot a VM to use them. That’s what eg Docker does on macOS.
Re:Running Intel Binaries in Linux VMs with Rosetta by mhio on Tuesday June 07, 2022 @03:11AM (#31650823)
Why does the rosetta binfmt_misc setup exclude starting amd64 containers? It's the same functionality the Docker desktop arm64 VM currently uses to run the process for an amd64 container via qemu (or any non arm64 container).
Re:Running Intel Binaries in Linux VMs with Rosetta by WatchDog on Monday June 06, 2022 @06:07PM (#31647003)
Docker on macOS already has some kind of qemu based solution for running x86_64 containers on m1.

Potentially this could be used as an alternative?

Re:Running Intel Binaries in Linux VMs with Rosetta by zamalek on Monday June 06, 2022 @06:40PM (#31647346)
It's QEMU emulation. It's slow. It also segfaults a lot. I am able to run a select few containers on it, but I needed to sort out native arm64 for the vast majority.
Re:Running Intel Binaries in Linux VMs with Rosetta by zekica on Tuesday June 07, 2022 @02:43AM (#31650638)
The main reason for segfaults is that not all syscalls (syscalls on linux are different per architecture - not even 32bit and 64bit x86 use the same) are implemented in a 100% compatible way.
Re:Running Intel Binaries in Linux VMs with Rosetta by zekica on Tuesday June 07, 2022 @02:44AM (#31650648)
Yes, this is exactly what Apple has done - created Rosetta that handles Linux ELF binaries, translates code and syscalls.
Re:Running Intel Binaries in Linux VMs with Rosetta by mxey on Wednesday June 08, 2022 @05:35AM (#31665089)
Yes, Docker on macOS can switch from qemu-user to this. It uses the same binfmt mechanism, so it should be mostly a drop-in replacement.

This is only available in combination with Virtualization.framework, but Docker is already migrating from Hypervisor.framework to Virtualization.framework.

Re:Running Intel Binaries in Linux VMs with Rosetta by duskwuff on Monday June 06, 2022 @05:35PM (#31646613)
I have to admit to a little bit of trepidation about the Rosetta mount point. Will this work for Docker without explicitly passing that mount point through to the containers?
Re:Running Intel Binaries in Linux VMs with Rosetta by cpuguy83 on Monday June 06, 2022 @06:09PM (#31647027)
The way this would work is Docker would be setting this up for you (maybe through some option to switch between qemu and Rosetta).

The containers should not need the mount. What happens is Rosetta gets registered with the kernel (binfmt_misc) to execute x86 binaries. The is the same mechanism that allows seamless qemu support.

Re:Running Intel Binaries in Linux VMs with Rosetta by saagarjha on Monday June 06, 2022 @05:38PM (#31646661)
Yeah I'm not entirely sure how they're going to make this work, but I kind of understand why it's so weird, because there's really not any very good way to communicate between macOS userspace and some arbitrary kernel running inside the VM…