I like to use a GUI. I like to see what I am doing, and while I am now comfortable with a command line, I like to mindlessly click eye candy to do the work that I do. The Raspberry Pi is not a powerful computer, and the 3B+ is a few generations old now, so I needed to choose a light weight option. The FreeBSD handbook, has 6 suggested desktop environments, and after looking for light weight options, I chose XFCE.
Installing XFCE
I will be installing the X Window System, on the RPi. I tried to experiment with Wayland, but I could not get it to work. To install XFCE, you need to install X Windows, XFCE and its goodies. This is done by entering the string of commands below. The command will execute the arguments in order until it is done. It will prompt you for your password and then it will execute the command. Don’t panic, you will get a ton of lines scrolling by as the pkg command executes and installs the software package. When you are done it will return you to the command prompt.
freebsd-rpi% sudo pkg install xorg xfce xfce4-goodies
Configuring XFCE
Log in to the account you wish to use XFCE on. Per the FreeBSD handbook, you want to edit the filesystem table found at /etc/fstab
, to have the /proc share mounted at startup. You do this by using nano, and entering your password.
freebsd-rpi% sudo nano /etc/fstab
At the end of the filesystem table, you want to add the following:
# Device Mountpoint FStype Options Dump Pass#
proc /proc procfs rw 0 0
The # sign is a comment symbol, and everything following it will be commented out and ignored. It is there to just be a header to the table. The file should look like this.
GNU nano 7.2 /etc/fstab Modified
# Custom /etc/fstab for FreeBSD embedded images
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/rootfs / ufs rw 1 1
/dev/msdosfs/EFI /boot/efi msdosfs rw,noatime 0 0
tmpfs /tmp tmpfs rw,mode=1777 0 0
/dev/label/growfs_swap none swap sw 0 0
proc /proc procfs rw 0 0
When you are done, type CTRL+X
, followed by 'Y'
for YES, and ENTER
to save the file.
Now you must enable the dbus, which allows for communication between applications. This is done in the /etc/rc.conf
file . This file controls what programs or scripts are executed at system boot, as well as system variables used in the boot process. The easy way to do this is to use the sysrc
command, but you can also do by editing the file using nano
. We will show you how to do this using sysrc
, and verify using nano
. Enter the following command on your command line.
freebsd-rpi% sudo sysrc dbus_enable="YES"
Password:
dbus_enable: NO -> YES
freebsd-rpi%
Use nano to open the /etc/rc.conf file, since you didn’t use sudo, it can only read the file, and not edit it.
freebsd-rpi% nano /etc/rc.conf
The opened file will look like this, and you can use the down arrow key to search for the bus_enable line and it should equal "YES"
.
GNU nano 7.2 /etc/rc.conf Modified
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
growfs_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
defaultrouter="192.168.1.254"
powerd_flags="-a hiadaptive -b hiadaptive"
powerd_enable="YES"
ntpd_flags="-g"
ntpd_enable="YES"
ntpdate_enable="YES"
dbus_enable="YES"
saver="beastie"
ifconfig_ue0="inet 192.168.1.126 netmask 255.255.255.0 media autoselect"
moused_enable="YES"
Next we want to install the display manager LightDM. This is done so you get a login screen, when you start your desktop environment. Use pkg
to install it, and the greeter which is the login screen.
freebsd-rpi%sudo pkg install lightdm lightdm-gtk-greeter
Next you want to use sysrc
to enable lightdm.
freebsd-rpi%sudo sysrc lightdm_enable="YES"
Verify using nano as shown earlier, and scrolling down to the lightdm_enable line and verifying it equals "YES"
Finally you can setup XFCE to start when you call for it. In order to do this, you must edit the X Window System initialization file, found in your account home folder. You can edit it by using nano as follows:
freebsd-rpi%sudo nano ~/.xinitrc
Then add . /usr/local/etc/xdg/xfce4/xinitrc
to the bottom of the file, and save. This will allow you to start the X Window System, but using the startx
command.
The easier way to do this is to use the echo
command and use the redirect command >
to add it to .xinitrc
This is done as follows:
freebsd-rpi% echo '. /usr/local/etc/xdg/xfce4/xinitrc' > ~/.xinitrc
You can access the desktop environment by typing startx
or just reboot to have it start automatically.
Comment
Comments are closed.