Install Fedora on an Apple Silicon

🗓 Previously on Mac2net – I explained how to setup Lima

Install Fedora on a Mac

Now it’s time to I install Fedora.


Because we are using Lima, the process of installing a Fedora is not exactly the same as on metal or in a VM, although post install configuration shares a lot in common.


Before beginning, let’s take a look at the relevant template files.


# From templates/fedora.yaml and replicated in templates/fedora-42.yaml
minimumLimaVersion: 1.1.0

base:
- template://_images/fedora-42
- template://_default/mounts


The YAML file references the _images/fedora-42 where the path to the image file is stored.


images:
- location: https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2
  arch: x86_64
  digest: sha256:e401a4db2e5e04d1967b6729774faa96da629bcf3ba90b67d8d9cce9906bec0f

- location: https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/aarch64/images/Fedora-Cloud-Base-Generic-42-1.1.aarch64.qcow2
  arch: aarch64
  digest: sha256:e10658419a8d50231037dc781c3155aa94180a8c7a74e5cac2a6b09eaa9342b7

- location: https://dl.fedoraproject.org/pub/alt/risc-v/release/42/Cloud/riscv64/images/Fedora-Cloud-Base-Generic-42.20250414-8635a3a5bfcd.riscv64.qcow2
  arch: riscv64
  digest: sha256:537c67710f4f1c9112fecaafafc293b649acd1d35b46619b97b5a5a0132241b0

# # NOTE: Intel Mac with macOS prior to 15.5 requires setting vmType to qemu
# # https://github.com/lima-vm/lima/issues/3334
# vmType: qemu


The second YAML file references _images/mounts which creates the hidden ~/.lima directory.


mounts:
- location: "~"

- location: "{{.GlobalTempDir}}/lima"
  mountPoint: /tmp/lima
  writable: true

What is the Fedora source?

For your reference, the images come from this url


fedora-cloud-images


This is a little blurb from the Fedora web site about the cloud images. While Lima has some limitations, when working inside the VM is similar to a VM on a Fedora server and very close to working on Fedora operating on bare metal.


Creating the Fedora VM

I am going to create a Fedora VM both on my M2 MacBook Air and on a 2018 Mac mini and highlight the differences when they come up. I won’t repeat the SSH process here to login to a remote machine that was explained previously.


# In your chosen terminal app enter the following commend
$ limactl create


When you receive the response below navigate > to Choose another template... with ↓ and press Return. A list will appear. With the ↓ key navigate to fedora or fedora-42 – as previously mentioned they are the same – and press Return again.


limactl_create


Now you are ready to let it fly and install a free operating system sponsored and largely funded by IBM! What could go wrong?


limactl_proceed


Depending on he speed of your internet connection, installation only takes a few minutes.


~$ limactl create
? Creating an instance "default" Choose another template (docker, podman, archlinux, fedora, ...)
? Choose a template fedora-42
? Creating an instance "default" Proceed with the current configuration
WARN[0017] field `mounts[1].location` refers to a non-existent directory: "/tmp/lima":
INFO[0017] Attempting to download the image              arch=aarch64 digest="sha256:e10658419a8d50231037dc781c3155aa94180a8c7a74e5cac2a6b09eaa9342b7" location="https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/aarch64/images/Fedora-Cloud-Base-Generic-42-1.1.aarch64.qcow2"
Downloading the image (Fedora-Cloud-Base-Generic-42-1.1.aarch64.qcow2)
508.38 MiB [-----------------------------------------------------] ?% 4.81 MiB/s
INFO[0133] Downloaded the image from "https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/aarch64/images/Fedora-Cloud-Base-Generic-42-1.1.aarch64.qcow2"
INFO[0173] Attempting to download the nerdctl archive    arch=aarch64 digest="sha256:544fa1e518155fcc01a117ea49819d12d96b4dacfb2b62922f9f7956dc9f6dc8" location="https://github.com/containerd/nerdctl/releases/download/v2.1.3/nerdctl-full-2.1.3-linux-arm64.tar.gz"
INFO[0173] Using cache "/Users/mac2net/Library/Caches/lima/download/by-url-sha256/46d9ee12c9f3f484518470db8093719f2b3ddca7daa6f1741c71e0aeb198db2a/data"
INFO[0173] Run `limactl start default` to start the instance.

Start the Fedora VM

When the installation process is finished Lima will print the command to start the VM. Frankly, the feedback from this is more than scary but I suppose developers enjoy this. Bottom line: if the last line tells you how to enter the shell – Runlimato open the shell – the VM should be working ok.


$ limactl start default
INFO[0000] Using the existing instance "default"
INFO[0000] Starting the instance "default" with VM driver "vz"
INFO[0002] [hostagent] hostagent socket created at /Volumes/[user]/vm/.lima/default/ha.sock
INFO[0002] [hostagent] Starting VZ (hint: to watch the boot progress, see "/Volumes/m2n/vm/.lima/default/serial*.log")
INFO[0004] SSH Local Port: 60022
INFO[0004] [hostagent] Waiting for the essential requirement 1 of 2: "ssh"
INFO[0004] [hostagent] [VZ] - vm state change: running
INFO[0014] [hostagent] Waiting for the essential requirement 1 of 2: "ssh"
INFO[0015] [hostagent] 2025/10/16 07:18:22 tcpproxy: for incoming conn 127.0.0.1:50917, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: connection was refused
INFO[0025] [hostagent] Waiting for the essential requirement 1 of 2: "ssh"
INFO[0026] [hostagent] The essential requirement 1 of 2 is satisfied
# SCARY STUFF WAS HERE
INFO[0086] [hostagent] The essential requirement 2 of 2 is satisfied
# MORE SCARY STUFF WAS HERE
INFO[0093] [hostagent] The optional requirement 2 of 2 is satisfied
INFO[0093] [hostagent] Waiting for the guest agent to be running
# MORE SCARY STUFF WAS HERE
INFO[0110] [hostagent] The final requirement 1 of 1 is satisfied
INFO[0110] READY. Run `lima` to open the shell.


Before entering the shell, let’s check where all this stuff is installed and how much space it is taking. First of all, as mentioned previously, if you are not comfortable accessing this inside a hidden folder, now is the time to create the symlink.


# This the command without using a symlink
$ ncdu ~/.lima/default
# This the command using a symlink
$ ncdu /Volumes/m2n/vm/.lima/default


This where some confusion starts thanks to the new fangled sparse files, which after decades of computer technology innovation results in creating confusion regarding exactly how much space a VM takes up. As you can see, ncdu says the space taken up by diffdisk, which is where the VM data is stored, is 1.4GB, but but but from the terminal enter $ open ~/.lima/defaultand the Finder says diffdisk occupies 107.37 GB! Such is progress these days 🥲. The smaller amount is correct.


diffdisk is where all changes to the VM are stored in an accumulated fashion which means the size will grow and grow until…


Lima is a developer tool we are using here for training and testing. A Fedora VM on a Mac does have some potential for systems management, but assume a Lima VM has a definite EOF and backup any of the configuration scripts used to customise it. I will address this in a future post.


ncdu-vm


There are some files here that are of interest. See the Lima documentation for details about these files. The file lima.yaml is of particular interest. For the moment it is an identical to the template selected when the VM was installed, but it can be used now to add additional commands – such as running a script to batch install packages and perform other functions either once or every time the VM is started.

Update Fedora

Before getting into this, it is advisable to first perform a system update as the VM was created from a static cloud image that is not regularly updated. To do this, it is necessary to invoke Fedora’s package manager – DNF. I really like DNF. People complain about it – people complain about everything. They are probably Debian or Ubuntu users🃏! Let’s be serious – DNF is written by IBM and it’s really good and always getting better and as we get more and more into using Fedora – or the numerous other Linux distros that also use DNF like Alma, Rocky, Oracle and Red Hat it will be easy to see how DNF is a great way to manage packages on a self-hosting install. While it looks a bit intimidating, you can find the documentation for DNF here.


To update the VM it is necessary to enter login to its shell and tell DNF to update the packages on the VM. You’ll need to preface the command with the phrase SUDO in order acquire security privileges of the root user. Note: if this is the only Lima instance, just entering Lima will put the terminal in the shell otherwise enter the command limactl shell [vm-instance-name]. If you forget the name of the instance just enter limactl list.


As I have said, Lima was written by developers who tend to obsess about security in a way that much of the issues that come up when trying to get things done are related to security telling you “NO!” Even when running as the “root” obstructions come up.


$ lima
[mac2net@lima-default mac2net]$ sudo dnf update --refresh
Updating and loading repositories:
 Fedora 42 - aarch64 - Updates                  100% |  16.0 KiB/s |   6.3 KiB |  00m00s
 Fedora 42 openh264 (From Cisco) - aarch64      100% |   2.6 KiB/s | 987.0   B |  00m00s
 Fedora 42 - aarch64                            100% |  43.7 KiB/s |  21.4 KiB |  00m00s
Repositories loaded.
Package                        Arch     Version           Repository                Size
Upgrading:
 NetworkManager                         aarch64   1:1.52.1-1.fc42   updates                   5.9 MiB
   replacing NetworkManager   aarch64   1:1.52.0-1.fc42   17bed3bd0467414ebb607f4   5.9 MiB
# List of package details
Transaction Summary:
 Installing:         4 packages
 Upgrading:        177 packages
 Replacing:        177 packages

Total size of inbound packages is 205 MiB. Need to download 205 MiB.
After this operation, 265 MiB extra will be used (install 867 MiB, remove 603 MiB).
Is this ok [y/N]: y
Transaction Summary:
 Installing:         4 packages
 Upgrading:        177 packages
 Replacing:        177 packages

Total size of inbound packages is 205 MiB. Need to download 205 MiB.
After this operation, 265 MiB extra will be used (install 867 MiB, remove 603 MiB).
Is this ok [y/N]: y
[  1/181] gnulib-l10n-0:20241231-1.fc42.noarch      100% | 630.7 KiB/s | 150.1 KiB |  00m00s
# Downloading packages
Importing OpenPGP key 0x105EF944:
 UserID     : "Fedora (42) <fedora-42-primary@fedoraproject.org>"
 Fingerprint: B0F4950458F69E1150C6C5EDC8AC4916105EF944
 From       : file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-42-aarch64
Is this ok [y/N]: y
The key was successfully imported.
[  1/360] Verify package files                       100% | 319.0   B/s | 181.0   B |  00m01s
[  2/360] Prepare transaction                        100% |   1.6 KiB/s | 358.0   B |  00m00s
[  3/360] Upgrading libgcc-0:15.2.1-1.fc42.aarch64   100% |  15.6 MiB/s | 223.9 KiB |  00m00s
# Installing new packages and removing old ones
[360/360] Removing libgcc-0:15.0.1-0.11.fc42.aarch64 100% |   0.0   B/s |  11.0   B |  00m31s
Complete!
# Old kernal
$ uname -r
6.14.0-63.fc42.aarch64
[[user]@[VM] [user]]$ sudo reboot
Broadcast message from root@localhost on pts/1 (Thu 2025-10-16 16:49:06 CEST):
The system will reboot now!
# Go back into the shell on the VM
[user]~$ lima
# New kernal just installed
[[user]@[VM] [user]]$ uname -r
6.16.11-200.fc42.aarch64
$ [[user]@[VM] [user]]$ exit
logout
[user]~$ limactl list
NAME       STATUS     SSH              VMTYPE  ARCH     CPUS  MEMORY  DISK    DIR
default    Running    127.0.0.1:60022  vz      aarch64  4     4GiB    100GiB  /Volumes/
                                                          [volume-name]/vm/.lima/default


After the upgrade process finishes, it is best to reboot the VM so the new packages replace the old ones. Running the command limactl list is the easiest way to get the basic info for VMs currently installed on the machine

One comment

Comments are closed.