macOS 13 Ventura introduced support of running amd64 binaries with Rosetta inside of arm64 Linux VMs when using Apple Virtualization framework.
Lima VM v0.14.0 and later support the new feature.
Setup:
# Install Docker client and Lima
brew install docker docker-compose docker-credential-helper lima
# Link docker-compose plugin
mkdir -p ~/.docker/cli-plugins
ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
# Start VM
limactl start --name=default ubuntu-docker-lima.yaml
# Lima 0.14.2 panics on first start, run start again
limactl start default
# Run the ouput of the command above to setup Docker ^
docker context create lima-default --docker "host=unix:///Users/$USER/.lima/default/sock/docker.sock"
docker context use lima-default
# Docker client can now run arm64 containers
docker run hello-world
# and amd64 containers with the help of Rosetta
docker run --platform=linux/amd64 hello-world
Note: the yaml Lima config below is a combination of docker.yaml and vz.yaml with customized mounts.
@runeksvendsen It looks like you have an amd64 version of Lima installed (also perhaps amd64 version of Homebrew?). You need arm64 Lima to use Visualization Framework with Rosetta. There was a commit two days ago that reports an error when Lima runs under Rosetta.
What does
file $(which limactl)
output? It should beMach-O 64-bit executable arm64
.