hexaitos.com/_site/2024/11/19/asahi-on-m1-mba.html

92 lines
12 KiB
HTML
Raw Normal View History

2024-11-18 23:05:54 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="">
<title>Asahi Linux on my base model M1 MacBook Air</title>
<link rel="stylesheet" href="/assets/css/styles.css">
</head>
<body>
<div class="menu">
<a href="/index.html">Home</a>
<a href="/blog.html">Blog</a>
<a href="/art.html">Art</a>
<a href="/refsheet.html">Ref sheet</a>
<a href="/contact.html">Contact</a>
</div>
<div class="main">
<h1>Asahi Linux on my base model M1 MacBook Air</h1>
<p style="text-align: right; font-style: italic;">This post was published on 19 Nov 2024</p>
<figure class="main">
<a target="_blank" href="/assets/images/blog_posts/asahi_mba_m1/20241118-WE2A1144.jpg">
<img src="/assets/images/blog_posts/asahi_mba_m1/thumbnails/20241118-WE2A1144_2000w.jpg" alt="An opened MacBook Air M1 standing on a table. It is showing the desktop of KDE Plasma 6 with the floating task bar at the bottom. The desktop background is a bird of prey." loading="lazy">
</a>
<figcaption>A photo of my MacBook Air running Asahi Linux with KDE Plasma 6</figcaption>
</figure>
<p>A couple of years ago still during my apprenticeship and also during the pandemic I bought a base model M1 MacBook Air with some bonus money that I got for finishing an important (to my boss, at any rate) project at work and its been my main laptop ever since and one that Ive been using basically daily ever since. However, the fact that I only got a base model has been a bit problematic and, thefore, I decided to upgrade to the new M4 MacBook Pro this year. This, then, leaves me with my still more than capable MacBook Air and Ive been thinking about what to do with it. Then I remembered the fact that Ive always been wanting to try out Asahi Linux; and that coupled with the <em>very</em> low power consumption of these M-series chips made me think that it would probably make for a really good low-powered server that still has enough <em>oomph</em> for more heavy workloads (definitely more than my <em>actual</em> server thats running an Intel N100). And so thats exactly what I did!</p>
<h2 id="installation">Installation</h2>
<p>The installation of Asahi is pretty straightforward in general, but having only a base model Mac (with a measly 256 GB SSD) does pose a bit of a problem: Asahi cannot be installed as the sole operating system; instead; it can only be installed <em>alongside</em> macOS. This, then, means that even after completely erasing my previous Sonoma install and then <em>only</em> running the Asahi Linux installer afterwards, I only have about 150 GB of usable disk space on my Asahi partition. Now thats not that bad or anything, but its definitely not a lot of disk space in todays world.</p>
<p>Speaking of the installation, its pretty much as simple as running <code class="language-plaintext highlighter-rouge">curl https://alx.sh | sh</code> in a terminal window and following the on-screen prompts (insert disclaimer about running running shell scripts without checking their contents first here). If youre even remotely familiar with the command line (and are able to read), then the installation shouldnt pose any significant problems. Still, I would not recommend installing this on your main machine that you use for other things as well as Im sure it can quite easily render your macOS install useless if something goes wrong.</p>
<p>During the installation process, youll be given the opportunity to set a new size for the macOS partition and a size for the to-be-created Asahi Linux partition. Additionally, you can choose between either Gnome or KDE (if I remember correctly) as your desktop environment. Then, after some rebooting and changing of Mac security features, youll be greeted by an installer that youre going to be very familar with if youve ever installed a Linux distribution. There youll choose a timezone and a username and password. Afterwards you can reboot and you should be greeted by a login window.</p>
<p>As a side note: Asahi used to be based on Arch Linux but they appear to have moved over to Fedora and the Fedora-based Asahi Linux is, as far as I can tell, the only <q>official</q>. There are some <a href="https://github.com/AsahiLinux/docs/wiki/SW:Alternative-Distros">community-maintained flavours</a> but I havent tried out any of those yet; I am also guessing their installation process will differ quite significantly from that of the official Fedora-based version.</p>
<h2 id="the-desktop-experience">The desktop experience</h2>
<p>I was honestly quite surprised at how <em>usable</em> it was in general, the only thing I still would very much like to see implemented is the ability to connect an external monitor through one of the USB-C ports of the MBA — that has (as of the publishing of this post) not yet been implemented. Other than that, however, everything worked pretty much as youd expect: you can change the brightness of the keyboard and the screen; the trackpad works (and even has force feedback); the speakers work and sound as you would expect them to sound; the keys on the keyboard all work (including things like the media keys for playing/pausing videos or music); closing the lid makes the laptop reliably go to sleep and opening it wakes it up quite quickly … you get the idea. Even the battery life is as fantastic (KDE estimating 9-12 hours) despite this MacBook being 4-ish years old now. WiFi also works perfectly and at the the expected speed.</p>
<figure class="small-image">
<a target="_blank" href="/assets/images/blog_posts/asahi_mba_m1/screenshot-fastfetch.png">
<img src="/assets/images/blog_posts/asahi_mba_m1/thumbnails/screenshot-fastfetch_1200w.png" alt="A screenshot showing a full-screened terminal window and the output of the program fastfetch. The output shows some information about the machine, such as the processor and its speed, OS etc." loading="lazy">
</a>
<figcaption>Fastfetch running on the MacBook Air</figcaption>
</figure>
<p>There are some strange behaviours here and there though. For example, whilst the trackpad does work, the palm rejection is, seemingly, non-existent, especially if youre used to how well it works on macOS. Oh and speaking of the trackpad, it feels strangely laggy, almost as though it were connected through a terrible bluetooth connection (Im pretty sensitive to input delay in general though, so you might not notice this at all). Also, youre going to have to use regular Windows-style shortcuts, i. e. <code class="language-plaintext highlighter-rouge">⌃C</code> instead of <code class="language-plaintext highlighter-rouge">⌘C</code> for copying things, as an example.</p>
<p>Additionally, you might not have access to all the packages as, obviously, this isnt an <code class="language-plaintext highlighter-rouge">x86_64</code>-based system but rather <code class="language-plaintext highlighter-rouge">aarch64</code>. I wanted to install Ruby on my system and I generally use <code class="language-plaintext highlighter-rouge">rbenv</code> to manage my Rubies. However, I first had a bit of trouble getting <code class="language-plaintext highlighter-rouge">rbenv</code> itself working and once I did, I had even <em>more</em> trouble getting it to actually compile Ruby 3.3.6 for me. At first, there were some problems with <code class="language-plaintext highlighter-rouge">openssl</code> that I managed to somehow fix by running <code class="language-plaintext highlighter-rouge">sudo dnf groupinstall "Development Tools"</code> but then it complained about <code class="language-plaintext highlighter-rouge">libffi</code> apparently missing (even though it wasnt as far as I could tell) so I just ended up using <code class="language-plaintext highlighter-rouge">rvm</code> instead that could compile Ruby 3.6.6 without any problems.</p>
<p>Most of the Flatpaks that Ive tried worked without any problems except for the Flatpak for Telegram for some reason, but that mightve just been my doing something wrong. LibreWolf, the browser I generally use on Linux, works fine and runs as expected, though also through a Flatpak. Tokodon, KDEs own Mastodon / Fediverse client, also works quite well. The GPU, apparently, <em>also</em> works but I havent really tried that out yet. Watching YouTube videos, even at 4K, was not a problem however and I couldnt detect any dropped frames.</p>
<p>A colleague of mine who is also quite interested in both ARM and RISC-V has told me about Box64 which allows you to run normal <code class="language-plaintext highlighter-rouge">x86_64</code>-based programs on an ARM-based processor. I havent yet tried this out myself but I definitely want to try it out and see if I can get some non-native programs running through that.</p>
<h2 id="and-as-a-server">And as a server?</h2>
<figure class="small-image">
<a target="_blank" href="/assets/images/blog_posts/asahi_mba_m1/screenshot-sensors.png">
<img src="/assets/images/blog_posts/asahi_mba_m1/thumbnails/screenshot-sensors_1200w.png" alt="A screenshot showing a terminal window and the output of the sensors command. It is showing temperatures, voltages and a wattage." loading="lazy">
</a>
<figcaption>The output of lm-sensors</figcaption>
</figure>
<p>I still havent done too much with regards to trying it out as a server, but I still feel like it should work quite well as long as all the software also works. I <em>really</em> wanted to get something like Proxmox or maybe even just YunoHost working, but I havent really found a way to do that yet. One thing I already did was change the charging limit from <code class="language-plaintext highlighter-rouge">100%</code> down to <code class="language-plaintext highlighter-rouge">80%</code>. I had to do this through the console by running <code class="language-plaintext highlighter-rouge">echo 80 |sudo tee /sys/class/power_supply/macsmc-battery/charge_control_end_threshold</code> in the terminal as changing the charging limit through KDEs GUI settings did not seem to work.</p>
<p>I also installed <code class="language-plaintext highlighter-rouge">lm-sensors</code>. I did that mostly to see the temperatures at which the computer was running, but I was very surprised to see that it also provided me with a nice way of seeing how much power it was using at a given time. This showed me that the power usage even with the screen turned on was rather low! I, therefore, enabled ssh and sshd into the machine to see what its power usage would be when the screen was completely turned off; and I was very surprised to see that the idle power consumption appears to be around 1-2 W with the screen turned off. Now thats <em>really</em> low value and something that you would <em>probably</em> have a hard time noticing on your monthly power bill.</p>
<p>If I were to actually start using this machine as a server, I would probably install a more minimal version of Asahi (probably without any DE whatsoever) and I would also need to get some sort of USB-C to ethernet adapater and <em>hope</em> that it works; though depending on what exactly Ill end up using the server for, a decent WiFi connection might not be all that problematic either.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I was pleasantly surprised to see how well it works just out of the box and will definitely be keeping Asahi on my MBA. Ill try out some more stuff, especially in regards to running it as a server or I might just keep it around as a nice Linux machine in general.</p>
<div class="clearfix"></div>
</div>
<footer>
<p>2024 - 2024 hexaitos.com</p>
<p>Made with Jekyll</p>
<a rel="me" href="https://squawk.social/@hexaitos"></a>
</footer>
</body>
</html>