Minimal Alpine Linux Setup with a Graphical Interface

Step-by step instructions on how to install the XFCE graphical interface on Alpine Linux, which does not come with pre-installed GUI. Given that Alpine is lightweight, this approach yields a funtional Linux configuration with minimal resource usage.

1. Download the “Virtual” realease for your processor architecture at https://alpinelinux.org/downloads.

2. Spin up a VM in Oracle VirtualBox with enough RAM and disk space, the mount the downloaded ISO.

3. Log in with the user root and no password, then run setup-alpine to install Alpine Linux to the disk.

4. Choose sda as the disk, sys as the use case and confirm you want the disk to be erased. Accepting everything else on default is fine.

5. After the installation succeeds, unmount the ISO and reboot the VM.

6. After logging in as root, install some basic tools by running apk add sudo vim bash.

7. Create a non-root user by running adduser [username], set its password as prompted and add it to the sudoers by running visudo.

8. After the line root ALL=(ALL) ALL, add the following line: [username] ALL=(ALL) NOPASSWD: ALL.

9. Run setup-xorg-base xfce4 lightdm-gtk-greeter xfce4-terminal chromium mousepad to setup the graphical environment and install other needed programs.

10. Run rc-update add lightdm and rc-update add dbus so the graphical interface starts when the system boots up.

11. Finally run rc-service lightdm start to start the graphical environment.