Isn't Alpine Linux for Servers?
This is a question I see a lot when people are presented with an example of Alpine Linux running as a desktop OS.
While Alpine is small, fast, and minimal, that doesn't stop it from functioning at a productive level for desktop users.
This post is documentation of how I installed and modified Alpine Linux to become my daily desktop OS.
Installation
Note that I cover the installation of Alpine Linux in my other post, so I won't repeat it here: Alpine Linux: My New Server OS.
Basically, get a bootable USB or whatever you prefer with Alpine on it, boot the ISO, and run the setup script.
Once you have gone through all the options and installer finishes without errors, reboot.
Initial Setup
Once Alpine is installed and the machine has rebooted, login is as root
initially or su
to root once you log in as your user. From here, you should
start by updating and upgrading the system in case the ISO was not fully
up-to-date.
# Update and upgrade system
&&
# Add an editor so we can enable the community repository
You need to uncomment the community
repository for your version of Alpine
Linux.
For v3.17, the repositories
file should look like this:
# Add the rest of your packages
# Add yourself to the wheel group so you can use the doas command
Window Manager (Desktop)
The Sway installation guide has everything you need to get Sway working on Alpine.
However, I'll include a brief list of the commands I ran and their purpose for posterity here.
# Add eudev and set it up
# Since I have Radeon graphics, I need the following packages
# Add user to applicable groups
# Add a font package
# Add the seatd daemon
# Add user to seat group
# Add elogind
# Finally, add sway and dependencies
Once you have the packages installed and set-up, you need to export the
XDG_RUNTIME_DIR
upon login. To do this, edit your .profile
file.
If you use another shell, such as zsh
, you need to edit that shell's profile
(e.g., ~/.zprofile
)!
Within the file, paste this:
if ; then
if ! ; then
fi
fi
Once that's complete, you can launch Sway manually.
Personal Touches
I also added the following packages, per my personal preferences and situation.
From here, I use my Syncthing storage to pull all the configuration files I stored from prior desktops, such as my dotfiles.
Resolving Issues
WiFi Issues
I initially tried to set up my Wi-Fi the standard way with iwd
, but it didn't
work.
Here is what I initially tried (I did all of this as root
):
&&
Then, I added the Wi-Fi entry to the bottom of the networking interface file:
wlan0
wlan0 inet dhcp
Finally, restart the networking service:
My Wi-Fi interface would receive an IP address from the router, but it could not
ping anything in the network. To solve the Wi-Fi issues, I originally upgraded
to Alpine's edge
repositories, which was unnecessary.
Really, the solution was to enable the NameResolvingService=resolvconf
in
/etc/iwd/main.conf
.
[Network]
resolvconf
Once I finished this process, my Wi-Fi is working flawlessly.
Sound Issues
Same as with the Wi-Fi, I had no sound and could not control the mute/unmute or volume buttons on my laptop.
To resolve this, I installed pipewire.
# Add your user to the following groups
# Install pipewire and other useful packages
Finally, I needed to add /usr/libexec/pipewire-launcher
to my
.config/sway/config
file so that Pipewire would run every time I launched
sway.
/usr/libexec/pipewire-launcher
--no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
XF86AudioLowerVolume exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
XF86AudioMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
XF86AudioMicMute exec
Note that I do not use bluetooth or screen sharing, so I won't cover those options in this post.
Other than these issues, I have a working Alpine desktop. No other complaints thus far!