Skip to content

Instantly share code, notes, and snippets.

@peternguyen93
Created December 21, 2022 10:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peternguyen93/4a2cd12422b450fc9bd5c230fce0c15c to your computer and use it in GitHub Desktop.
Save peternguyen93/4a2cd12422b450fc9bd5c230fce0c15c to your computer and use it in GitHub Desktop.
Using Rosetta2 in Docker on ArchLinux VM Apple Silicon

Using Rosetta2 in Docker on ArchLinux arm64 - Apple M1

  1. Start vm with tart
tart run archlinux --no-graphics --dir=shared:~/Sources --rosetta=ROSETTA
  1. mount rosetta to Linux
sudo mkdir -p /mnt/rosetta
sudo mount -t virtiofs ROSETTA /mnt/rosetta
  1. Add rosetta to systemd-binfmt.d
sudo echo ":rosetta:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/mnt/rosetta/rosetta:F" > /lib/binfmt.d/rosetta.conf
sudo systemctl restart systemd-binfmt
  1. Run docker x86_64 image
docker pull ubuntu:latest --platform linux/amd64
docker run -it ubuntu /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment