Skip to content

Instantly share code, notes, and snippets.

@davidvfx07
Last active January 12, 2026 09:22
Show Gist options
  • Select an option

  • Save davidvfx07/fec3d92f6075ece27f7dd875b5dc459b to your computer and use it in GitHub Desktop.

Select an option

Save davidvfx07/fec3d92f6075ece27f7dd875b5dc459b to your computer and use it in GitHub Desktop.
Asahi Linux - OSTree Install Guide
# PLEASE READ ALL OF THE COMMENTS THROUGHOUT THIS COMMAND GUIDE. THANKS!
# This is a command guide to install OSTree / Bootc on Asahi Fedora.
# Compiled with inspiration from:
# - https://github.com/fedora-asahi-remix-atomic-desktops/images/issues/1
# - https://github.com/bshephar/fedora-bootc/tree/main/asahi
# Please reset Asahi from scratch as lingering standard install things will bloat. By the
# same logic, install Asahi Minimal when you do reset, as to not bloat your install with
# lingering packages and applications that won't be accessible once everything is set up.
# To reset Asahi means to delete its partitions on MacOS and reinstall from scratch.
# Check out the oficial "Partitioning Cheatsheet" for more info.
# - https://asahilinux.org/docs/sw/partitioning-cheatsheet
# Asahi Minimal installs do not provide a graphical setup interface for setting up user,
# timezone, etc, but they do provide a CLI to do this config that auto-launches on first
# boot. Follow the prompts like usual, creating a user etc, until you land in the
# terminal.
# Once you've reached the terminal, login if needed, and first update as follows:
sudo dnf upgrade -y
reboot
# Then when you're booted back up, login and follow the commands bellow.
# Please take close attention to the comments, do not simply copy and paste everything.
sudo -i
dnf install -y rpm-ostree
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.backup
mkdir -p /ostree/repo
ostree init --repo=/ostree/repo --mode=bare
ostree config --repo=/ostree/repo set sysroot.bootloader none
ostree config --repo=/ostree/repo set sysroot.readonly true
mv /boot/loader /boot/loader.0
ln -snf loader.0 /boot/loader
mkdir -p /ostree/deploy
ostree admin os-init fedora --sysroot /
# The following will find the root UUID from /proc/cmdline. Its important for this to
# be accurate for a successful boot. The command may not work for you, so please double
# check it's output as I describe.
ROOT_UUID=$(cat /proc/cmdline | awk -F"root=UUID=" '{print $2}' | cut -d ' ' -f 1)
# To double check your root UUID against the found one run the following
echo $ROOT_UUID # This will show what was found that you need to check
blkid # This will show you all IDs. The UUID to look for is under the label "ROOT"
# or "fedora"
# If you find that the UUID is inaccurate, double check, then run the following
ROOT_UUID=PUT-YOUR-UUID-HERE
# Please comment too.
# The following may take a few minutes with no progress report. Please be patient as
# it is downloading the image and doing other things, so depending on your situation
# and internet speed the run time will vary.
# We use the base-atomic image because its the smallest and simplest. It's more important
# to get everything working first than to use whatever final image you want and hope it
# works first try. Feel free to switch to another image if everything boots successfully,
# as I describe at the end.
# Quick tip: if you are on a MacBook and want Linux to use the full height of the display
# including the notch, add (--karg apple_dcp.show_notch=1) to the end of the command.
ostree container image deploy \
--imgref ostree-unverified-image:registry:quay.io/fedora-asahi-remix-atomic-desktops/base-atomic:42 \
--target-imgref ostree-unverified-image:registry:quay.io/fedora-asahi-remix-atomic-desktops/base-atomic:42 \
--stateroot fedora \
--sysroot / \
--karg root=UUID=$ROOT_UUID \
--karg rw \
--karg rootflags=subvol=root
# Be very careful to copy these next commands properly, as they are specific and may not
# warn you even if there is a typo.
DEPLOY_PATH=/ostree/deploy/fedora/deploy/$(ls /ostree/deploy/fedora/deploy/ -rt1 | head -n1)
cp -f /etc/passwd /etc/shadow /etc/group /etc/gshadow /etc/fstab /etc/subuid /etc/subgid $DEPLOY_PATH/etc/
# Put your username here
MAIN_USER=insert_your_username_here
# Take even more extra care to do these ones correctly, they're very nuanced, and may not warn.
sed "s/\/home\/$MAIN_USER/\/var\/home\/$MAIN_USER/g" -i $DEPLOY_PATH/etc/passwd
sed "s/\/home/\/var\/home/g" -i $DEPLOY_PATH/etc/fstab
# To double check the above, run the following and check as desscribed.
cat $DEPLOY_PATH/etc/passwd # Look toward the end for your username, and ensure you see
# /var/home/your-username instead of just /home/your-username. If not, manually edit
# the file to be so with nano or vi.
cat $DEPLOY_PATH/etc/fstab # Similar story for this one, you want to ensure
# you see /var/home instead of just /home
# If any of the manual checks have proven an automatic command was not successful, please
# double check to ensure the command was copied accurately, and if so, comment so they
# can be fixed.
# Continue here
chcon --reference=/etc/passwd $DEPLOY_PATH/etc/passwd
chcon --reference=/etc/fstab $DEPLOY_PATH/etc/fstab
# The initial setup should now be done, but it is not complete. Reboot now and you should
# boot up fine, with everything looking exactly as it was before, but if you don't,
# ensure you ran all of the steps correctly and comment.
reboot
# Once booted, login, and to test if everything worked, run the following.
sudo bootc status # It should show you that you are indeed booted onto an image.
# Now you can finally switch to whichever image you want to use. It is extremely important
# that whatever image you choose is based off an Asahi image, otherwise it won't contain
# the Asahi packages and patches and will fail to boot. If you build your own image, just
# switch the base to be the asahi base-atomic image which in my experience can be treated
# like a fedora-bootc / minimal image, essentially bare bones. Here I use silverblue.
sudo bootc switch quay.io/fedora-asahi-remix-atomic-desktops/silverblue:42
reboot
# In the future, to update to the latest version of your image, just run:
sudo bootc upgrade
# Thats it!
# Good luck, and enjoy! Feel free to add comments with your experience, or with questions/fixes
# for issues you encounter. Hopefully one day Atomic Asahi will be officially supported.
# PS. I'm unsure how long this kind of install would last, as updating your image won't
# also update the bootloader and other Asahi things that are beyond the scope of Atoimic
# images as far as I can tell. There may be a need to manually run the Asahi scripts
# to update the bootloader etc, but I don't really know, just something to be aware of
# and to look into.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment