Skip to content

Instantly share code, notes, and snippets.

@KnedlikMCPE
Last active April 17, 2024 10:23
Show Gist options
  • Save KnedlikMCPE/5d3b4610a5da77d604554197d3877604 to your computer and use it in GitHub Desktop.
Save KnedlikMCPE/5d3b4610a5da77d604554197d3877604 to your computer and use it in GitHub Desktop.
binfmt_misc setup for Asahi Linux w/ FEXBash
#!/bin/bash
# /usr/bin/fex
buildah unshare krunvm start emu /entrypoint.sh -- FEXBash /mnt"$@"
# /etc/binfmt.d/fex32.conf
:fex32:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/fex:F
# /etc/binfmt.d/fex64.conf
:fex64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/fex:
Follow this tutorial by Prestigious-Oil on Reddit: https://www.reddit.com/r/AsahiLinux/comments/1c5232t/guide_to_setting_up_krunvm_with_opengl_46_fexemu/
Install the files in their commented directories and run `systemctl restart systemd-binfmt`
Ensure the VM has the root volume mounted - in this example, the VM is "emu" and / is mounted as /mnt
Also ensure the files you want to access are publicly accessible
Edit the /entrypoint.sh and /entrypoint-user.sh (in the VM) to run the passed command instead of /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment