Pages

Wednesday 18 June 2014

Setting up an Xfce desktop with Void Linux

I recently discovered Void Linux, an independent Linux distro (i.e. not based on anything else) that is designed to have the minimum possible included by default, without sacrificing features.

I updated this post on June 18th, 2014, making the instructions a little clearer.

Void is rolling-release, so you install it once and it keeps itself up to date without you having to install a new version every so often, and comes as a live image which can be used to perform a minimal install to a hard drive. From this command-line interface you can build up the system however you want using the xbps package manager.

I chose to build up a desktop environment with the light but fully featured Xfce DE, taking a little bit of help from here to get sudo working. The result: a fully featured, visually nice Linux desktop system that takes up only about 2-3GB of hard drive space (though I'd leave at least 12-18GB so more things can be installed as you wish) and doesn't use much RAM (about 75MB when idle). It's also fast - it boots on my low-RAM, slow, 8 year-old laptop in just 24 seconds - and it's very quick and responsive.
My Void Linux Xfce desktop
Void Linux is definitely not newb-friendly, so I'll assume a certain level of command-line and Linux knowledge for these guidelines. I claim no responsibility if they break your system, and I can't guarantee that they'll work for you - not everyone's system is the same. However, they should be fine.

Installation
The installer for Void is relatively self-explanatory, and anyone who's ever done a Debian or Ubuntu minimal/command line install should be fairly familiar with the process. It was a lot easier than I thought it would be! However, I recommend using a live CD to partition your hard drive before you install Void, and then skipping the partitioning step of the installer and simply choosing what to do with the existing partitions, unless you're comfortable partitioning using the command line (parted is the partitioner in the installation process).

Now for the fun part...
Once the installation is complete, and you've rebooted, you'll have a root user and root password. This is not ideal at all, especially for a desktop environment, so we'll want to create a standard user that can't break the whole system just by making a typo. Enter the command
useradd [USERNAME]
where [USERNAME] is your desired username, for example:
useradd photonucleon
Then add a password for that user:
passwd [USERNAME]
Now for the tricky bit - we're going to give the newly created user the ability to use the sudo command to execute tasks that need root privileges. BE VERY CAREFUL HERE. Enter the command
visudo
and use the arrow keys to move the cursor down until it is below the first character of the line that says root ALL=(ALL) ALL. Press "i", then type the same line, but with your username instead of root, for example (assuming your username is 'photonucleon'):
 photonucleon ALL=(ALL) ALL
Then press "esc" and type :wq! (including the ':' and '!') to save the file and exit. Once you're back at the bash command prompt, type exit to exit from being the root user, and log in with the username and password you just created. From now on, you can use sudo with your password (not the root password) to execute commands as root.

Installing X and Xfce
For this, you'll probably want to be connected to the internet via ethernet cable.

First of all, update the system and sync the software list by running
sudo xbps-install -Syu
Then, update the pkgdb (you'll rarely need to do this, but do it now):
sudo xbps-pkgdb -u

Then, to install the base of the graphical environment, use the command
sudo xbps-install xorg
Once it has installed, install the Xfce environment:
sudo xbps-install  xfce4
Now, in theory you can now start your graphical environment with the command startx, but this didn't work for me. I resolved the issue by installing lightdm:
sudo xbps-install lightdm lightdm-gtk-greeter
You may wish to install lightdm anyway; it'll slow boot time a little bit, but it's useful especially if you wish to install multiple WMs or DEs.

Reboot (using sudo reboot).

The lightdm greeter looks a bit ugly at this stage; we'll solve that problem later. Log in with your username and password.

Setting up networking with NetworkManager
You'll probably want to install a network manager now; here are the steps I took:

  • sudo xbps-install network-manager-applet
  • sudo xbps-install gnome-keyring
  • sudo systemctl stop dhcpcd.service
  • sudo systemctl disable dhcpcd.service
Those commands install NetworkManager and its applet, install gnome-keyring so I can connect to password-protected WiFi networks without problems (in theory), and stop and disable dhcpcd, which conflicts with NetworkManager. You might want to reboot here to get everything running nicely.

Configuring Xfce and installing applications
Set up Xfce how you want it, it's all up to you! I used the default panel setup, but without the bottom panel, and I disabled icons on the desktop.
Now, in terms of installing applications: the Void repos are in their relatively early stages, and so they won't necessarily have all the software you want - but here are my recommendations, which are in the repository at the time of writing:
  • Browser: firefox
  • Editor: mousepad
  • Media player: vlc
  • PDF viewer: evince
These (or alternatives of your choice) can be installed with sudo xbps-install, of course, and if you want to search the repos for a particular package, you can use
xbps-query -Rs [KEYWORDS]
with the search keywords you want.

Audio
Pulseaudio was pulled into the system by something or other, and having heard about problems with it I was slightly apprehensive - and sure enough, having added the volume control applet to the panel, and changed various settings in the mixer program, I couldn't get sound to work. Thankfully, the solution was as simple as installing pavucontrol and un-muting the speakers with it (for some reason the mixer included couldn't do this.)

GTK and making lightdm look nicer
The GTK theme I used, crunchy-dark-grey, requires the murrine gtk engine:
 sudo xbps-install gtk-engine-murrine
To make lightdm look nice and fit with my dark theme, I edited the config file  /etc/lightdm/lightdm-gtk-greeter.conf and uncommented the lines background, theme-name, show-clock and clock-format, and made them look like this:
background=#000000
theme-name=Xfce-dusk
show-clock=true
clock-format=%H:%M
Themes/icons I used
Apart from crunchy-dark-grey, the GTK theme mentioned above, I used Faenza-Dark icons from the Faenza icons pack, Cantarell as the default font (installable as cantarell-fonts via xbps), and Xaphire-Aqua as the window manager theme.

xbps
For more info on using xbps, start by reading these man pages:
  • man xbps-install
  • man xbps-query
  • man xbps-remove

So that's it. Having used it for more or less a week now, I can say that this is the fastest Xfce setup I've ever used. I guess only time will tell if I'll run into any problems with it in the future, but for the moment there's not much I can criticise it for... so, have fun with Void Linux!

2 comments:

  1. Hey followed you over from #!. Thanks for the walk-through. I look forward to other posts.

    ReplyDelete