Installing XFCE & other things on Arch Linux

How to do a complete Arch Linux install with XFCE, LightDM, Udisks, Yaourt, and other essentials


Arch Linux is a lightweight Linux distribution and installing Arch Linux teaches you a lot about how system works under the hood, after you've installed Arch you'll start to appreciate command line and Arch's install procedure.

I used to like distributions such as Parrot and Ubuntu because they already had packages installed and configured for me, but the point of installing Arch is to learn about Linux system. Learning core components of Linux and knowing which packages you've installed will also help you in fixing problems which might arise in the future, also building a system from command line is fun.

Like Arch, XFCE Desktop Environment is also lightweight, minimal, and not resource hungry. Though XFCE is simple and lightweight it has some modern features, and if you customize it like me, It'd look really cool while taking about 200 MB to 300 MB of your memory.

Prerequisites:
  • Time
  • Good Internet Connection
  • Little bit of confidence of using command line
  • Backup of important data before messing up with partitions
  • Base install of Arch Linux 
Tips:
  • Use 'cfdisk' command to edit partitions, it's easier that way
  • While doing the base install, don't forget to install base-devel packages for doing that use the following command
pacstrap /mnt base base-devel
We're going to install XFCE with LightDM and Xorg along with other essentials like Network Manager Applet and Pulse Audio Applet and Udisks for disk management & yaourt for AUR support. 

We're going to pick up from where they left off
Let's get started.

Installing GRUB bootloader for machines running BIOS

I kept all my files in a single partition.

If you're not in the chroot environment then chroot into your arch installation again by mounting the partition in which you chrooted earlier, use arch-chroot as mentioned in the Installation Guide.

Execute the following commands once entered in chroot environment
pacman -S grub-bios
Substitute your device letter.
grub-install /dev/sdX
mkinitcpio -p linux
This will make the grub configuration file.
grub-mkconfig -o /boot/grub/grub.cfg
Exit the chroot environment
exit
Now boot into your new install & login into root account

Network Configuration

You need to use dhcpcd to start networking, It's not enabled by default so you need to use the following command. 
systemctl enable dhcpcd
To get networking in this session use dhcpcd, it takes few seconds to start.
dhcpcd
You can check your internet connection by pinging archlinux.org
ping -c 4 archlinux.org

Creating a new user account

See create a new sudo user article, from now we'll be using a sudo user account to execute commands.

Login into your newly created sudo user account.

Let's check for  updates, then we can start installing packages.
sudo pacman -Syyu

Now we're ready to install XFCE4

Installing Xorg

First you have to select appropriate drivers for your machine.
Now in case you're installing Arch in VirtualBox then you've to install xf86-video-vesa drivers.
sudo pacman -S xf86-video-vesa
NOTE: If you're installing in VirtualBox you'll need VirtualBox guest tools for Arch, see Post Install Configuration of Arch Linux

In my case I'm not installing it on VirtualBox so I'll be using xf86-video-intel driver because I don't have a Graphics Card.
sudo pacman -S xf86-video-intel
 Now we can install Xorg.
sudo pacman -S xorg-server xorg-xinit xorg-twm xorg-xclock xterm
(Keep hitting enter)

Package Description
To check if we've installed Xorg properly we've to install a minimal desktop environment for which xorg-twm, xorg-xclock & xterm are required.

Let's check if we've installed it correctly.
startx
Now you'll see a GUI like desktop with a clock and terminal which means we've installed Xorg correctly.

Installing XFCE4 Desktop Environment 

Lets install XFCE4 desktop environment and XFCE applications.
sudo pacman -S xfce4 xfce4-goodies
(Keep hitting enter)

Now lets see if we've installed xfce4 properly.
startxfce4

Configuring XFCE4

It should ask for setting up panels, I'm going to choose "Use default config"

Now we've to make XFCE start with startx command, for that we need xinitrc file which we've to copy it from its location.
cp /etc/X11/xinit/xinitrc ~/.xinitrc
Now we've to edit it.
nano ~/.xinitrc
Now scroll down to the end & you'll find following lines.
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm - geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
Above that 'twm &' line you have to add 'exec startxfce4' so it'll look like this.
exec startxfce4
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm - geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
Now use CTRL + X to exit hit 'y' to confirm and then hit ENTER

To allow other users of this machine to start XFCE using 'startx' command you'll have to copy this file to home directories of other users. In my case root is the only other user who does not have this file, so I have to copy this file to root's home directory.
sudo cp ~/.xinitrc /root/.xinitrc
sudo reboot
Now to check if you've done it correctly you've to login in into accounts of all users and use the 'startx' command and see if XFCE starts.
If it does then congratulations XFCE is now installed and configured

Installing Other Essential Packages

Installing Network Manager

Network Manager lets us connect to the Internet via WiFi or Ethernet.
Now I really want to unplug this Ethernet Cable, so lets do it.
sudo pacman -S networkmanager network-manager-applet
Package Description

networkmanager - It'll manage Network connections for you.

network-manager-applet - It is a systray icon for networkmanager which will give you nice GUI to interface for networkmanager.

Next we've to enable networkmanager so it can start automatically when machine boots up.
sudo systemctl enable NetworkManager
sudo reboot
Now Network Manager should have started automatically, you should see a notification if you're still connected via Ethernet, you should also see a Network manager icon in system tray.

Now click on it, then click on your wireless network name, now right click on the systray icon then select 'Edit connections' you should see your wireless network's name in Wi-Fi sub section, hit 'Edit' and in 'Wi-Fi Security' tab you can add your network's password.

Now click on your wireless network's name, this time it'll connect to the network.

Ah! Now I can unplug this cable. 

Installing LightDM

Now that we've WiFi connection let's install LightDM which is a login screen, it'll ask for password after we boot up and you would no longer see the terminal.
sudo pacman -S lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings light-locker
Package Description

lightdm-gtk-greeter - It is the login screen.

lightdm-gtk-greeter-settings - It'll give you GUI to configure the login screen.

light-locker - It locks the screen.

We need to enable lightdm to be greeted upon startup.
sudo systemctl enable lightdm

NOTE: For fixing screen lock, if it doesn't work and for enabling autologin, see Post Install Configuration of Arch Linux 

Installing yaourt 

How to install yaourt

Installing PulseAudio

We also need sound in Arch, for that we need pulseaudio.
sudo pacman -S pulseaudio pavucontrol
Package Description
pulseaudio - PulseAudio is a sound system for POSIX OSes

pavucontrol - It's a nice GUI to control pulseaudio

For having a systray icon for pulseaudio you need to have pa-applet
pa-applet is not available in Arch repositories but you can get it from AUR

For having AUR support in Arch you need to have yaourt.
If you have yaourt then run following command.
yaourt -S pa-applet-git
Don't edit package build and continue installation.

Add pa-applet in "Session and Startup" by going in 'Application Autostart' section then click on "Add"
Type the name & description according to your liking, but command should be
pa-applet

Installing udisks

Udisks is a disk management service, you can edit polkit rules for udisks to mount drives in your machine without being prompted for a password.
sudo pacman -S udisks2
We need to add rules for udisks
sudo nano /etc/polkit-1/rules.d/50-udisks.rules
Paste the following block of code
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.udisks2.filesystem-mount-system" &&
        subject.isInGroup("storage")) {
        return polkit.Result.YES;
    }
});
Now use CTRL + X to exit hit 'y' to confirm and then hit ENTER

You should be a member of group 'storage' as well, so execute following commands for adding yourself in 'storage' group.
sudo groupadd -r storage
sudo gpasswd -a your_username storage
Now reboot, after that you should be able to mount drives without being asked for a password.
If you can't see drives in thunar to mount don't worry, in the next section we'll install gvfs which will solve that problem.

Installing gvfs

This lets us to see other drives on the machine in Thunar & also gives us the Trash icon on the desktop.
sudo pacman -S gvfs

Installing Other Essential Applications

Refer to Post Install Configuration of Arch Linux  


Now we've installed Arch Linux with XFCE4, LightDM and other essentials.
Enjoy Arch, keep it simple, stupid!

If you found this helpful leave a comment(you don't need to sign in), Check out that side pane, join our group and like our page. Share this article so that others could also enjoy Arch Linux.

Comments

Post a Comment

Popular posts from this blog

Site wide CSRF on a popular program

Releasing Flumberbuckets: S3 Bucket Enumeration Tool for Bug Hunters