Skip to content

vfkit: Rosetta support - run amd64 containers on Apple silicon macs #20559

@nirs

Description

@nirs

What Happened?

Some projects do not build container images for arm64 (aarch64 on linux). When using minikube on Apple silicon macs, the container will fail to start.

vfkit already support Rosetta:
https://github.com/crc-org/vfkit/blob/main/doc/usage.md#rosetta

Enabling the feature requires:

  1. Adding --device rosetta:
--device rosetta,mountTag=minikube-rosetta 
  1. Mounting the roseta share in the guest:
mount -t virtiofs minikube-rosetta /mnt/minikube-rosetta 
  1. Configure binfmt to use the rosetta binary for x86_64 executables
sudo /usr/sbin/update-binfmts --install rosetta /mnt/minikube-rosetta/rosetta \ --magic "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00" \ --mask "\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \ --credentials yes --preserve yes --fix-binary yes 

Issues:

  • update-binfmts is not installed in our iso, we need to add it.

See also

  • vfkit rosetta docs
  • lima have full support for rosetta. You only need to add the --rosetta flag and it handles the rest.

Metadata

Metadata

Assignees

Labels

co/vfkitVFkit related issueskind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions