- Start vm with tart
tart run archlinux --no-graphics --dir=shared:~/Sources --rosetta=ROSETTA
- mount rosetta to Linux
sudo mkdir -p /mnt/rosetta
sudo mount -t virtiofs ROSETTA /mnt/rosetta
- 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
If you use fedora arm64, you have to setup SELinux to allow rosetta to be loaded into systemd-binfmt
sudo -i
ausearch -c 'systemd-binfmt' --raw | audit2allow -M my-systemdbinfmt
semodule -i my-systemdbinfmt.pp
semodule -X 300 -i my-systemdbinfmt.pp
- Run docker x86_64 image
docker pull ubuntu:latest --platform linux/amd64
docker run -it ubuntu /bin/bash