This is a write up on how to run barrier
(the synergy-core fork) on a headless raspberry pi. It's based on the work of hishamk, describing how to do the same thing for the original synergy.
If you're running multiple machines, none of them being the primary one, and you don't want to have the server machine running all the time just to share mouse and keyboard, this guide might be for you.
The keyboard still sends keys to the host system. I have to look into how to disable that.
I've read on some forums, that running barrier as service with root privileges is dangerous. So use at own risk.
I'm no linux expert. I just customized what I found over at hishamk's repo. For more technical details, please visit his repository.
Raspberry Pi 3B, 16GB SD card, Raspberry Pi OS Lite (Debian 12 / bookworm) 32-bit. "Lite" OS is no desktop environment, command line only.
- Boot up and allow to configure itself for the first time; login.
sudo apt update
sudo apt upgrade
- Compile barrier. See their wiki for instructions.
- Note, the "libqt4-dev" package it references is not available anymore, and can be omitted from the package list when installing -- it's not used.
- It's important that you compile using the Release build configuration. Edit clean_build.sh, change line 12 from -Debug to -Release.
sudo apt install xorg xserver-xorg-video-dummy
git clone https://github.com/yozzozo/barrier-headless.git ~/barrier-headless
- Ensure /etc/hostname reflects the name of the server appropriately.
- Create barrier config (i.e. on another machine) and copy it to
/etc/barrier.conf
- Ensure you convert the line endings to LF if you used a Windows machine to create the file. For some reason barrier didn't like CRLF.
- Ensure the config file has the new server hostname in it, in the screens and links sections
- Following barrier's steps, start creating an SSL configuration. First create the directory hierarchy:
mkdir -p ~/.local/share/barrier/SSL/Fingerprints
- Then create the SSL config PEM (key pair):
openssl req -x509 -nodes -days 365 -subj /CN=Barrier -newkey rsa:2048 -keyout /home/<USER>/.local/share/barrier/SSL/Barrier.pem -out /home/<USER>/.local/share/barrier/SSL/Barrier.pem
- Generate an SSL config fingerprint for the server:
openssl x509 -fingerprint -sha1 -noout -in ~/.local/share/barrier/SSL/Barrier.pem
- Copy the output fingerprint (long hex string separated by colons) into ~/.local/share/barrier/SSL/Fingerprints/Local.txt
- Copy the ~/.local/share/barrier dir hierarchy to /root (ensuring owner is root for all copied files/dirs)
- Copy X config file:
sudo cp barrier-headless/xorg_dummy.config /etc/X11/xorg.conf.d/
- Copy X service file:
sudo cp barrier-headless/x_dummy.service /etc/systemd/system/
- Copy barrier service file:
sudo cp barrier-headless/barrier.service /etc/systemd/system/
- Change owner:
sudo chown root:root /etc/systemd/system/barrier.service /etc/systemd/system/x_dummy.service
- Add execute flag (not sure if needed):
sudo chmod uog+x /etc/systemd/system/barrier.service /etc/systemd/system/x_dummy.service
- Reload systemd:
systemctl daemon-reload
- Start X dummy service:
systemctl start x_dummy
- Check its status:
systemctl status x_dummy
- Start barrier server:
systemctl start barrier
- Check its status:
systemctl status barrier
- Enable both services to start persistently:
systemctl enable x_dummy.service; systemctl enable barrier.service
reboot
Note: it may be necessary to modify connecting clients' SSL trusted hosts file, if the server is being reused with a new certificate.