Set up a Lightweight Desktop Environment on the Raspberry Pi with XFCE4
The Raspberry Pi is an amazing little device, but when it comes to running a desktop environment it can be a little sluggish. Here I will show you how to set up a responsive desktop environment, complete with web-browser, network access, file sharing and incoming remote desktop capabilities.
Lets install Raspian Lite
Lets grab the latest release version of Raspian Lite from here.
Once downloaded, write the image to your SD card. If your new to writing images, there is a great cross-platform program called Etcher you can use to write to the SD card. It can be found here.
Once your have written to the SD card, lets insert and start our Raspberry Pi.
Configure Raspian Lite
On first boot, we will need to do some initial configuration on the Raspberry Pi. First we need to log into the system with the following.
This will log us in with the default user/pass. Now at the command prompt, enter the following.
Change your default password. (You may want to set your keyboard layout first under localization options)
Configure your network options.
Configure your Localization settings.
Under Interfacing Options, set SSH to be active.
Once complete, select Finish to reboot the system.
Once restarted, lets now login to our Raspberry Pi again using SSH or the console again with
Pass: (new password)
Now lets see if there are any updates for Raspian using the following commands.
sudo apt-get update sudo apt-get upgrade -y sudo apt-get dist-upgrade -y sudo reboot
Lets Install our Desktop Environment
Once restarted, lets login back in and install the packages needed to get our desktop up and running.
sudo apt-get install xfce4 #installs the XFCE4 desktop environment sudo apt-get install xfce4-terminal #install the xfce4-terminal application sudo apt-get install gvfs-fuse gvfs-backends -y #Allows our desktop to understand NTFS file systems sudo apt-get install exfat-fuse #Allows our desktop to understand exFat file systems sudo apt-get install firefox-esr #Installs Firefox web-browser (Extended Support Release) sudo apt-get install xrdp #Installs remote desktop server (Allow incoming desktop connections) sudo apt-get install samba #Allows us to create file shares sudo apt-get install xarchiver #Allows us to work with archive files ie. zip etc sudo apt-get install thunar-archive-plugin #Allows archives management with Thunar
Lets configure xRDP to allow connections
With the initial installation of xRDP, it is not configured to allow incoming connections. We can fix that by making the following changes.
sudo nano /etc/X11/Xwrapper.config
Change the allowed_users=console to be allowed_users=anybody
Press CTRL + x, y to save, and overwrite the file.
Now lets set our Raspberry Pi to boot into the desktop
Now we are going to set our Raspberry Pi to boot directly into the desktop. We can do this by going into our Raspberry Pi Configuration.
Select Boot Options, Desktop/CLI, and select Desktop or Desktop Autologin.
Select Finish, and Yes to Reboot.
Now when you have rebooted, you should go directly into your desktop. If you selected the default panel layout, at the bottom center, you should be able to launch Firefox and use the file manager to browse your Raspberry Pi and network. A simple setup, but a good start for you to customize and configure as you like.
You will also be able to connect to your Raspberry Pi desktop using Remote Desktop on Windows, or with Remina on Linux using your Raspberry Pi’s IP address and login information.
If you found this guide helpful please leave me some encouragement below! If your really happy, you can always gift me a coffee, I can never say no to coffee!
I have also by request added a bitcoin donation address. If you want to show your appreciation I would be grateful, but under no means do you need to feel obligated. This is a fun hobby for me. 🙂
And for those that have, thank you for enabling my addiction! You all know who you are!