How to use Barrier in Linux to share keyboard and mouse between multiple teams

Introduction to Barrier

Barrier is an open source tool that allows you to share a single keyboard and mouse between several computers, working as a virtual KVM. Originally known as Synergy, Barrier has evolved to offer a more stable and multi-platform experience, including excellent Linux support. In this post we will see how to install it, configure it and make the most of it in a work environment with multiple Linux stations, improving productivity and reducing peripheral disorder.

What is Barrier

Barrier acts as a server and one or more customers that connect through the network. The computer that has the keyboard and the mouse physically connected works as the server, while the other machines act as customers and receive the server input when the cursor crosses the edge of the screen. This architecture allows the control to flow naturally, as if all monitors belonged to a single extended desktop. In addition, Barrier supports the shared paper portfolio, which makes it easier to copy and paste text or images between machines without the need for external services.

Previous requirements

Before installing Barrier it is necessary to ensure that all machines have a stable network connection, preferably by Ethernet cable to minimize latency. In addition, each team must run a recent Linux distribution with access to official repositories or Snap / Flatpak packages. It is recommended to have the firewall enabled to allow traffic in the port TCP 24800, which is the default port that Barrier uses for communication between server and customers. Finally, it is useful to have a desktop environment that supports X11 or Wayland, as Barrier is based on the input extensions of these systems.

Installation in main distributions

Installing Barrier in Linux is easy thanks to its presence in the repositories of most distributions. In Ubuntu and Debian, just run sudo apt update and then sudo apt install barrier. In Fedora, the command is sudo dnf install barrier, while in Arch Linux you use sudo pacman -S barrier. For those who prefer universal packages, Snap offers sudo snap install barrier and Flatpak provides flatpak install flathub org.barrier. Barrier. After installation, check the version with barter -version and make sure the executable is in your PATH.

Server settings

To set up the server, open the barter application from the application menu or run barter & in a terminal. A window with a grid representing the monitors will appear. Drag and release the icons to position them according to their physical disposition; for example, if you have a monitor to the right of the server, move the client icon to the right of the central picture. Define a name for the server (by default use the hostname) and choose the authentication method: none, password or TLS. Click Apply and the server will start listening in TCP 24800 port.

Customer configuration

In each client, start barter and choose Client. In Server IP type the server IP; if you are on the same subnetwork, use the host name via mDNS or / etc / hosts. Make sure the authentication method matches that of the server (same password or TLS). Save the settings, press Start and the client will connect; then the cursor will move without interruption from the server screen to that of the client when touching the corresponding edge.

Daily use and tricks

Once the connection is established, working with Barrier feels like using a single extensive desktop: you can drag windows between monitors, copy text with Ctrl + V and paste it into another machine with Ctrl + V, and the shared paper holder will do the rest. You can also assign keyboard shortcuts to quickly change the focus between screens by barrictl or the tray icon. To pause sharing, click on the barrier icon and select Disable. Advanced users can create profiles that are automatically loaded according to the detected network, ideal for laptops that change from office to home.

Common problem solution

If the customer does not connect, check that the 24800 port is open in the server firewall (sudo ufw allow 24800 / tcp in Ubuntu). Confirm that there are no duplicate IP and that the server is listening with sudo netstat -tlnp | grep barber. If the cursor stays on the edge, check that the arrangement of the monitors in the barrier interface exactly matches its physical position; even a pixel of difference can block the pass. Finally, if you notice delays, use a wired connection and prioritize the barter traffic in the router using QoS.

Conclusion

Barrier is presented as a light, free and multi-platform solution that transforms several teams into a single cohesive working environment. Its simple Linux configuration, along with features such as shared clipboard and optional authentication, makes it an attractive alternative to KVM commercial solutions. By adopting Barrier in its daily flow, it will reduce peripheral disorder, gain flexibility and improve its productivity without additional hardware. We invite you to try it and share your experience in the comments so that the community continues to grow. In addition, its open source allows it to be customised according to the specific needs of each environment.

This work is under aCreative Commons License Attribution 4.0 International for Francesc Roig francesc @ vivaldi.net.

EnglishenEnglishEnglish