What is barrier?
To reduce the number of keyboards and mice you can get a physical KVM switch but the down side to the physical KVM switch is it requires you to select a device each time you want to swap. barrier is a virtual KVM switch that allows one keyboard and mouse to control anything from 2-15 computers and you can even have a mix of linux, Windows or Mac.
Don’t confuse Keyboard, Video and Mouse (KVM) with Kernel Virtual Machine (KVM) they are very different and this article will be covering the former. If the Kernel Virtual Machine topic is of interest to you read through this Red Hat article https://www.redhat.com/en/topics/virtualization/what-is-KVM that provides an overview of the latter type of KVM.
Installing barrier on Fedora Linux (KDE Plasma)
Enter Alt+Ctrl+T to display the terminal screen and you will enter the following to download barrier from the Fedora system repository.
$ sudo dnf install barrier
Installing barrier on Windows and Mac
If you are looking to install on alternate operating systems you can find the Windows and Mac downloads here: https://github.com/debauchee/barrier/releases.
Nuances of version 2.3.3
- barrier does not support Wayland, the default display protocol used in both Gnome and KDE, so you will need to switch your desktop to use the X11 protocol to use barrier.
- If you are unable to move your mouse from the host to a client computer, make sure you do not have scroll lock enabled. If scroll lock is enabled it will prevent the pointer from moving to a client.
- When using more then one Linux machine, verify you are using the same version of barrier on each one (thanks to @ilikelinux for pointing this requirement out). If you need to check your version enter the following at the terminal.
$ dnf list barrier
To use X11 in KDE:
- Select the Fedora icon in the bottom left
- Select Leave on the bottom right of the menu
- Select Log Out
- Select OK
- Select Desktop Session on the bottom left side of the screen and select X11
- Log back in
Set up your barrier host
At the command line type barrier and the main screen will display.
- Select the check box next to Server (share this computer’s mouse and keyboard)
- Click the Configure Server… button
You should now be on the Screens and links tab. Here you will see a recycle icon on the top left and a blue monitor icon on the top right.
To add a client, drag the blue monitor icon to the location you want your monitor to be when you move the mouse from your host to client device. Think of this as how you would want a multi-monitor setup to appear.
If you want to remove one drag the blue monitor to the recycle bin.
After you have setup a client in the location grid, double click the same icon to open the Screen Settings dialog box.
- Fill in the Screen name field with whatever name you would like.
- Under Aliases type a different name and select Add.
At this point, your host is ready to go and you can click the Start button on the bottom right of the screen.
Note: Depending on your current firewall configuration, you might need to add an exception for the synergy service so that network connections to that port (24800/tcp) can get through to your barrier server. You probably want to restrict this access to only a select few source IP addresses (barrier clients).
Set up your barrier client
The barrier client side setup is very simple.
- Start barrier on the client machine.
- Select the check box next to Client (use another computer’s mouse and keyboard)
- From the host computer you can look at the IP addresses field and copy its value to the Server IP field on the client.
- Click Start on the bottom right.
From this point on, you can move your mouse between each computer you added and even copy and paste text back and forth just like they are on the same computer. barrier has numerous options you can use to tweak the program under the Hotkeys and Advanced server settings tabs on the host. Now that you are up and running, go ahead and spend time messing around with different options to see what suites you best.
Note: barrier requires that the each host has a physical display.