Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rosetta support #23

Closed
Tracked by #19
cfergeau opened this issue Jan 30, 2023 · 0 comments · Fixed by #57
Closed
Tracked by #19

Add Rosetta support #23

cfergeau opened this issue Jan 30, 2023 · 0 comments · Fixed by #57

Comments

@cfergeau
Copy link
Collaborator

This would help for issues such as crc-org/crc#3483
The vfkit side should be relatively easy, quite close to the file sharing support.
The guest will need to mount the shared rosetta directory, and to configure binfmt support https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta?language=objc

@cfergeau cfergeau moved this to Scheduled in Project planning: crc Jul 26, 2023
cfergeau added a commit to cfergeau/vfkit that referenced this issue Jul 27, 2023
This adds support for `--device rosetta,mountTag=something` on the
commandline. This is only available on system with Apple CPUs, vfkit
will error out if this option is used on Intel CPUs.

Once the VM is running and the rosetta share is mounted, rosetta support can be enabled by creating this file:

$ cat /etc/binfmt.d/rosetta.conf
: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:F

and then running `systemctl restart systemd-binfmt`

See these links for more details:
https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta?language=objc
https://docs.kernel.org/admin-guide/binfmt-misc.html
https://www.man7.org/linux/man-pages/man5/binfmt.d.5.html

This fixes crc-org#23
cfergeau added a commit to cfergeau/vfkit that referenced this issue Jul 28, 2023
This adds support for `--device rosetta,mountTag=something` on the
commandline. This is only available on system with Apple CPUs, vfkit
will error out if this option is used on Intel CPUs.

Once the VM is running and the rosetta share is mounted, rosetta support can be enabled by creating this file:

$ cat /etc/binfmt.d/rosetta.conf
: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:F

and then running `systemctl restart systemd-binfmt`

See these links for more details:
https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta?language=objc
https://docs.kernel.org/admin-guide/binfmt-misc.html
https://www.man7.org/linux/man-pages/man5/binfmt.d.5.html

This fixes crc-org#23
cfergeau added a commit to cfergeau/vfkit that referenced this issue Aug 21, 2023
This adds support for `--device rosetta,mountTag=something` on the
commandline. This is only available on system with Apple CPUs, vfkit
will error out if this option is used on Intel CPUs.

Once the VM is running and the rosetta share is mounted, rosetta support can be enabled by creating this file:

$ cat /etc/binfmt.d/rosetta.conf
: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:F

and then running `systemctl restart systemd-binfmt`

See these links for more details:
https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta?language=objc
https://docs.kernel.org/admin-guide/binfmt-misc.html
https://www.man7.org/linux/man-pages/man5/binfmt.d.5.html

This fixes crc-org#23
@github-project-automation github-project-automation bot moved this from Scheduled to Done in Project planning: crc Aug 22, 2023
cfergeau added a commit that referenced this issue Aug 22, 2023
This adds support for `--device rosetta,mountTag=something` on the
commandline. This is only available on system with Apple CPUs, vfkit
will error out if this option is used on Intel CPUs.

Once the VM is running and the rosetta share is mounted, rosetta support can be enabled by creating this file:

$ cat /etc/binfmt.d/rosetta.conf
: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:F

and then running `systemctl restart systemd-binfmt`

See these links for more details:
https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta?language=objc
https://docs.kernel.org/admin-guide/binfmt-misc.html
https://www.man7.org/linux/man-pages/man5/binfmt.d.5.html

This fixes #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant