r/AlpineLinux

Just an appreciation post for Alpine Linux.

Just an appreciation post for Alpine Linux.

Just an appreciation post for Alpine Linux.

I'm using it as my daily driver now, despite what others might say about it not being suitable.

I use it for working with Docker, for llama.cpp Vulkan, and for gaming with Proton, without any issues.

Love you guys, keep the good work <3

u/TheShyDude — 8 days ago

Alpine as a gaming distro

I moved all my x86_64 sh*tboxes over to Alpine a while back and wondered if it would be possible to use this little lovely distro for gaming (I know). However, since it’s based on the Linux kernel, it’s not impossible and I have to admit I’m quite surprised by how easily it went.

You need to switch kernel to linux-stable (idk if LTS includes ntsync) and then modprobe ntsync.

The rest is straightforward: just install wine-staging and dxvk.

Finally, you need to prepare launcher script - something like this:

#!/bin/sh

# Wine prefix path

export WINEPREFIX="$HOME/.wine"

# Use ntsync instead of esync and fsync

export WINEESYNC=0

export WINEFSYNC=0

# Framelimiter (optional)

export DXVK_MAX_FRAMERATE=60

# Game path

GAME_PATH="$HOME/Games/GTASA/gta_sa.exe"

# Per game additional settings

export WINEDLLOVERRIDES="winemenubuilder.d=n;dinput8=n,b"

# Launch game (low res cuz I have uhd620)

wine "$GAME_PATH" -width=1280 -height=720 -fullscreen

Then just chmod +x game.sh, drop game.sh into the game directory, and boom – you've got an Alpine as a gaming distro XD

Edit: And create DXVK symlinks! ln -sf /usr/share/dxvk/x64/.dll "$HOME/.wine/drive_c/windows/system32/" && ln -sf /usr/share/dxvk/x32/.dll "$HOME/.wine/drive_c/windows/syswow64/"

reddit.com
u/drneocortex17 — 9 days ago

Welcome back, Alpine

Alpine still remains being one of my fav distros out of all time :D

bonus point being Steam actually work with game desktop entries

u/tungnon — 10 days ago

Is it possible for Minecraft to run natively with musl libc?

I initially wanted to post this on the old Chimera Linux subreddit because I had a question about the Video Games page, but since it's discontinued and Alpine Linux also uses musl libc, I believe this is the ideal place.

Anyway, on Chimera Linux, I had many problems trying to run Minecraft (without Flatpak). Chimera has PrismLauncher in its repositories, but it says it needs to use a glibc compatibility layer for musl libc. This confuses me a lot because PrismLauncher is available for FreeBSD (which uses a completely different libc), and it doesn't need compatibility layers; it's all native. Why can't I run Minecraft without compatibility layers? Or is this just a problem in Chimera Linux that Alpine Linux has resolved?

I know that the reason stated on the page I mentioned is: "As Minecraft comes with native binaries built for Glibc in its packaging," but isn't the game in Java? Even if C/C++ binaries existed, wouldn't it be possible to compile them with musl?

u/Chester-Berkeley — 13 days ago

Scripts to replace Debian to Alpine in AWS Lightsail.

Hi, I am using these scripts to replace a fresh Debian AWS Lightsail instance to an Alpine one, since it is not possible to natively select Alpine as the OS for AWS's cheap VPS service.

Maybe someone finds them useful, and can be easily altered to fit one's needs.

First, deploy a new Debian instance. I chose Debian Trixie. Then, ssh into the new isntance and paste this code. As with every code in the internet, please first check it out to see it is legit.

# 1. Update Debian and install build tools
apt-get update &amp;&amp; apt-get install -y wget cpio grub2-common openssh-client

# 2. Download official Alpine v3.24 Netboot files
mkdir -p /boot/alpine
cd /boot/alpine
NETBOOT_URL="https://dl-cdn.alpinelinux.org/alpine/v3.24/releases/x86_64/netboot"
wget -q $NETBOOT_URL/vmlinuz-virt
wget -q $NETBOOT_URL/initramfs-virt
wget -q $NETBOOT_URL/modloop-virt

# 3. Create Apkovl Overlay structure
rm -rf /tmp/apkovl /tmp/apkovl_cpio
mkdir -p /tmp/apkovl/etc/network \
         /tmp/apkovl/etc/ssh \
         /tmp/apkovl/etc/runlevels/default \
         /tmp/apkovl/etc/runlevels/boot \
         /tmp/apkovl/var/empty
chmod 755 /tmp/apkovl/var/empty

cat &lt;&lt;'EOF' &gt; /tmp/apkovl/etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto ens5
iface ens5 inet dhcp
EOF

cat &lt;&lt;'EOF' &gt; /tmp/apkovl/etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
Port 22
EOF

ssh-keygen -q -N "" -t rsa -b 3072 -f /tmp/apkovl/etc/ssh/ssh_host_rsa_key
ssh-keygen -q -N "" -t ed25519 -f /tmp/apkovl/etc/ssh/ssh_host_ed25519_key

cat &lt;&lt;'EOF' &gt; /tmp/apkovl/etc/shadow
root:$6$rounds=5000$fixedsalt1234567$PEGiwTAy5jYIb/hkcAqn7xqdqQsKq3Jti7nKfDG1hJPzKNYB587iX/7QxDlE/JYoZeZDwiBjrYevGmaCO3F9x0:19800:0:99999:7:::
EOF
chmod 600 /tmp/apkovl/etc/shadow

ln -s /etc/init.d/sshd /tmp/apkovl/etc/runlevels/default/sshd
ln -s /etc/init.d/networking /tmp/apkovl/etc/runlevels/boot/networking

cd /tmp/apkovl
tar -czf /boot/alpine/localhost.apkovl.tar.gz .

# 4. Embed overlay into initramfs
mkdir -p /tmp/apkovl_cpio
cp /boot/alpine/localhost.apkovl.tar.gz /tmp/apkovl_cpio/localhost.apkovl.tar.gz
cd /tmp/apkovl_cpio
find . | cpio -o -H newc | gzip -9 &gt; /tmp/overlay.cpio.gz

cat /boot/alpine/initramfs-virt /tmp/overlay.cpio.gz &gt; /boot/alpine/initramfs-combined.img

# 5. Configure GRUB for rapid boot into v3.24 RAM
cat &lt;&lt;'EOF' &gt; /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0

menuentry "Alpine Netboot RAM" {
    insmod gpt
    insmod msdos
    insmod ext2
    search --file --set=root /boot/alpine/vmlinuz-virt
    linux /boot/alpine/vmlinuz-virt ip=dhcp alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.24/main modloop=/boot/alpine/modloop-virt copytoram pkgs=openssh,e2fsprogs,dosfstools,util-linux,grub-bios,grub-efi,alpine-conf apkovl=/localhost.apkovl.tar.gz console=tty0 console=ttyS0,115200 ipv6.disable=1
    initrd /boot/alpine/initramfs-combined.img
}
EOF

sed -i 's/^GRUB_DEFAULT=.*/GRUB_DEFAULT="Alpine Netboot RAM"/' /etc/default/grub
sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=0/' /etc/default/grub
update-grub

# 6. Reboot into RAM
reboot

Afterwards, you'll have to log in with your root user, the password will be "IJSDOIWHDUIHWEYTWE" (without the ")

Then we overwrite the drive with an alpine install. Similar to the above, please use this script:

# 1. Unpack matching kernel modules &amp; load storage/network drivers
apk add squashfs-tools
rm -rf /tmp/modloop_extracted /tmp/modloop-virt
wget https://dl-cdn.alpinelinux.org/alpine/v3.24/releases/x86_64/netboot/modloop-virt -O /tmp/modloop-virt
unsquashfs -d /tmp/modloop_extracted /tmp/modloop-virt
cp -r /tmp/modloop_extracted/modules/* /lib/modules/ 2&gt;/dev/null || cp -r /tmp/modloop_extracted/* /lib/modules/ 2&gt;/dev/null

modprobe nvme 2&gt;/dev/null
modprobe xen-blkfront 2&gt;/dev/null
modprobe ena 2&gt;/dev/null
mdev -s

# 2. Format disk and install Alpine
MAIN_DISK=$(lsblk -nd -o NAME | grep -v loop | head -n 1)
export BOOTLOADER=grub
export ERASE_DISKS="/dev/$MAIN_DISK"
setup-disk -m sys -s 0 /dev/$MAIN_DISK

# 3. Mount target root partition for post-install provisioning
TARGET_PART=$(lsblk -ln -o NAME /dev/$MAIN_DISK | grep -E 'p2$|p1$|2$|1$' | tail -n 1)
mount /dev/$TARGET_PART /mnt 2&gt;/dev/null || mount /dev/${MAIN_DISK}p2 /mnt 2&gt;/dev/null || mount /dev/${MAIN_DISK}p1 /mnt

# 4. Enable Main &amp; Community Repositories (Pinned to v3.24 on separate lines)
cat &lt;&lt;EOF &gt; /mnt/etc/apk/repositories
https://dl-cdn.alpinelinux.org/alpine/v3.24/main
https://dl-cdn.alpinelinux.org/alpine/v3.24/community
EOF

# 5. Pre-install nano, htop, tzdata, bash, and bash-completion
chroot /mnt apk update
chroot /mnt apk add nano htop tzdata bash bash-completion

# 6. Set root shell to /bin/bash
sed -i '/^root:/s|:[^:]*$|:/bin/bash|' /mnt/etc/passwd

# 7. Configure Debian-style color prompt &amp; bash-completion for root
cat &lt;&lt;'EOF' &gt; /mnt/root/.bashrc
# Don't do anything if not running interactively
case $- in
    *i*) ;;
      *) return;;
esac

# Enable Debian-style root color prompt (Red host, Blue working directory)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

# Enable colorized command output aliases
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Enable programmable completion features
if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi
EOF

cat &lt;&lt;'EOF' &gt; /mnt/root/.profile
if [ -n "$BASH_VERSION" ]; then
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi
EOF

# 8. Set Hostname to tokyoAlp
echo "tokyoAlp" &gt; /mnt/etc/hostname
cat &lt;&lt;EOF &gt; /mnt/etc/hosts
127.0.0.1   localhost tokyoAlp
::1         localhost tokyoAlp
EOF

# 9. Set Timezone to Asia/Tokyo
chroot /mnt cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
echo "Asia/Tokyo" &gt; /mnt/etc/timezone

# 10. Create and activate 3GB Swapfile
fallocate -l 3G /mnt/swapfile || dd if=/dev/zero of=/mnt/swapfile bs=1M count=3072
chmod 600 /mnt/swapfile
chroot /mnt mkswap /swapfile
echo "/swapfile none swap defaults 0 0" &gt;&gt; /mnt/etc/fstab

# 11. Early IPv6 Disable (sysctl &amp; kernel level)
cat &lt;&lt;EOF &gt; /mnt/etc/sysctl.d/00-disable-ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
EOF

# 12. Persist modules &amp; configure OpenRC runlevels
cat &lt;&lt;EOF &gt;&gt; /mnt/etc/modules
ena
xen-netfront
nvme
EOF

chroot /mnt rc-update add swap boot
chroot /mnt rc-update add sysctl boot
chroot /mnt rc-update add networking boot
chroot /mnt rc-update add sshd default

# 13. Configure Network, SSH, and Root Password
IFACE=$(ip route | awk '/default/ {for(i=1;i&lt;=NF;i++) if($i=="dev") print $(i+1)}' | head -n 1)
[ -z "$IFACE" ] &amp;&amp; IFACE="eth0"

cat &lt;&lt;EOF &gt; /mnt/etc/network/interfaces
auto lo
iface lo inet loopback

auto $IFACE
iface $IFACE inet dhcp

auto eth0
iface eth0 inet dhcp

auto ens5
iface ens5 inet dhcp
EOF

chroot /mnt sh -c 'echo "root:IJSDOIWHDUIHWEYTWE" | chpasswd'
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin yes/' /mnt/etc/ssh/sshd_config
sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /mnt/etc/ssh/sshd_config

# 14. Apply GRUB kernel boot flags (ipv6.disable=1 &amp; 0-second timeout)
sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=0/' /mnt/etc/default/grub
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 /' /mnt/etc/default/grub
chroot /mnt update-grub

# 15. Unmount target cleanly and reboot
umount -R /mnt
reboot

As you can see, this script has some of my preferences already included, which you might want to change (e.g. disabling ipv6).
You end up with a (relatively) fresh alpine AWS Lightsail instance.

Looking forward to any of your comments or questions :)

reddit.com
u/Blitzherpes — 10 days ago

pipewire on alpine linux

FIXED. hello, I installed alpine linux today and i dont know how to make pipewire work, because rc-update -U add pipewire wayland from official tutorial, but it says that "wayland isn't valid runlevel". My rc-status -Ur is sysinit. I tried to add pipewire &amp; and wireplumber &amp; in ~/.config/river/init, but that didn't worked. I installed only rtkit, pipewire, pipewire-pulse, wireplumber and pipewire-alsa packages

reddit.com
u/snchart — 12 days ago

arxy: run glibc / proprietary apps (incl. Steam) on Alpine at native speed, no dep duplication

Hi everyone.

I want to show you a project that honestly makes me a bit embarrassed to share, just because it's the first time I share something with the general public. But I think it might be useful to someone, so here it goes.

I collaborate on a project called Neko Void, specifically I got interested in the part that makes Neko Void images for musl, for the musl C library. And we all know how it is: stuff made for glibc doesn't work on musl, you have to rebuild it. And proprietary software is basically impossible to rebuild because the source isn't free. As a result, on Alpine/musl most proprietary apps just don't work. Practically 100% of closed-source programs fail. Steam doesn't work by default either, and well, that's what makes most users run away.

I've been working on a solution. There are many alternatives to run glibc stuff on musl distros. One is using AppImage, which bundles glibc inside, but it has a problem: when you have many apps packaged as AppImage, dependencies get repeated over and over and in the long run it gets really heavy. Another alternative I tried was installing Nix as a separate subsystem, but it's extremely heavy even if things run natively.

My goal when I started this was to make proprietary apps run in the fastest and lightest way possible, using as little space as possible, without duplicating dependencies like Flatpak does. So I made arxy, which is a very basic and simple project. It's an Arch rootfs that gets mounted so you can install whatever you want on it. It's optimized to weigh as little as possible, but it keeps enough so most Arch packages, if not 100%, work correctly on any existing Linux distro, including Alpine. And best of all, it keeps AUR access.

The process it uses is pretty simple. It mounts the image with bwrap and if that's not available, it uses a basic chroot. And it has very simple commands, like arxy install <package> or arxy update. In short, it installs any app directly from the official Arch repos or from the AUR in a small subsystem, sharing drivers, kernel and other things, so it runs as native and direct as possible. By using Arch's own package manager, there's no dependency duplication, because packages naturally share dependencies. So you can install here everything you'd install via Flatpak, but saving space and running better. The program creates shortcuts for the apps on your desktop normally and they open normally.

As I said, it's one of the first projects I've worked on and I've put a lot of my time into it, and I'd love for you to take a look. I'm still learning, so I really invite anyone who can to collaborate. Any feedback is totally welcome. The project is made to work on any distro, but I personally tested it on Alpine Linux, Chimera Linux and Void Linux, both glibc and musl. I invite you to try it on other distros and well, I hope you like it.

Repo: https://github.com/SrDicov/arxy

For Alpine users specifically: how do you currently deal with closed-source / glibc-only apps on Alpine? I'd love to hear what breaks for you and if this approach helps.

u/SrDicov — 14 days ago

setup-desktop installs Xfce but after rebooting, it still opens into the terminal instead of the GUI, manually starting X doesn't help

Tried installing Alpine on two old laptops (an intel atom netbook and an old x360 running a celeron), with both, alpine installs just fine using the setup-alpine, everything works, when I run setup-desktop (run while logged in as root of course) it goes through the motion of installing the OS, but upon rebooting post Xfce install, Alpine still just boots into the terminal, troubleshooting by asking AI has proved to be a waste of time, a source of frustration and one hell of a prompt for foul language, so here I am, any idea what I'm doing wrong here? I really want to run Alpine on both machines and quite frankly I'm at my wit's end now

reddit.com
u/Nukki91 — 11 days ago

How much resources does Alpine Linux use after a fresh install?

Just curious, for those using Alpine Linux, how much RAM and disk space does it usually use after a fresh install?

Also wondering about idle CPU usage. Is it really that lightweight compared to other Linux distros?

Just trying to get an idea before I install it on an old/low-spec machine.

reddit.com
u/Able-Farm6295 — 14 days ago

Alpine on a Surface Pro 3?

Does anyone know if Alpine will run on a Surface Pro 3. I have one running Linux Mint, and Mint runs pretty well out of the box. Touch, wifi and camera work. However, I'm interested in trying the Alpine distro. Thanks in advance for any comments and suggestions.

reddit.com
u/dccrens — 13 days ago