What is Barrier?
If you use multiple computers (laptops, desktop PCs) at the same time and position switching peripherals and screens can be a hassle. Using a single input and output seems to be a way easier solution but you need to have a KVM switch in order to do that. Cheaper KVM switches however provide only a limited set of connections, like VGA only (no HDMI), a limited amount of USB ports, or even PS/2 instead of USB. An alternate solution can be a software version of the KVM switch. This is the goal of Barrier: with its server-client architecture, you are able to connect multiple machines to each other and able to control all of them from one main computer. While Barrier of course doesn’t provide an HDMI nor VGA port, you can still use the screen of all the computers you’re working with, in a similar way like you set up a multi-monitor workflow.
With a KVM switch, you need to press a physical button to switch the I/O between your systems, with Barrier the only thing you need: move the mouse pointer from one computer to another (or use some keybindings). Of course this can be a caveat as well if you wan’t to use the same display for all machines like if you have a desktop and a clamshell mode laptop. I use three laptops with one external display and an iPad Air 4 as an additional small external display and I have arranged the equiptment that I’m able to see all the displays all the time.
How to set it up
The most important thing to know is what kind of systems do you have. For me it’s easy, I have a Windows for work, a MacBook Pro M1 Max for my game dev life and also I have a Linux laptop loaded with Arch Linux which takes part in a future project. My goal is to have the MBP act as a server as my favorite keyboard and mouse are connected to this one via Bluetooth and the Windows and Linux machines are supposed to be the clients.
For Windows and Mac you’ll need to download the package manually and install it. I used the Github page for Barrier. Here you want (most probably) to download the latest release. A good rule of thumb however if you have a Linux machine in the picture, check if your distro has an up-to-date package, if there’s no recent version, you might want to download the same version for the rest of your machines.
After you’ve downloaded the .dmg archive from the release page, mount the .dmg. It will have a single file which is the app itself. For whatever reason, there’s no link there to the Application folder but don’t let this turn down our smile: open another Finder window/tab, navigate to the Applications folder and copy the app there. When you start the app, you will receive the usual security notice from the system that this app was downloaded from the Internet but if you trust the app (it’s Open Source), set your direction towards System Settings/Security and allow the app. I wanted to set the Mac as the server so I selected the checkbox for the Server mode, and used the Configure Server… button. Here there’ll be an important step: set all your desktop names and position them where you want your “virtual” desktops. Setting the name seems to be required in order to have a successful connection between client and server. After the configuration, you can press the Start button on the main window.
Easy as (almost) every other app: you’ll download an executable installer that will simply install all the necessary files. After the installation you can start the app from the Start Menu. My Windows computer is added as a Client. Here the only important two settings are:
- Remove the check from the Auto config
- Set the correct IP address for the server
If everything is correct, clicking on the Start button on the main screen should connect your Windows client to your Server instance. You’ll first receive a message from the client, after closing it you can already play with the server keyboard and mouse.
Barrier is available on many Linux distributions, also available on Arch which is the one I’m using. For me a simple pacman install did the trick.
pacman -S barrier
After the install is done successfully you can run barrier from Terminal and also if you have a DE you’ll find it in your launcher menu.
Configuring as a client is the same as in windows since all platform has the same GUI (thankfully). On Linux you also have the option to use the non-gui variants, but I haven’t used them so I can’t really say anything on those.
The setup was done in prep for the first workday in 2022 so I don’t yet have a long-term experience with this setup. What I can already say is that I already see some benefits:
- Magic Mouse on Win/Linux never works (for me at least) the same way like on my MacOS computer, like the natural scrolling, or the horizontal scrolling. With this setup my mouse behaves the same way on all platforms.
- Keyboard and Mouse works perfectly
- Shared clipboard is working perfect and seamless
Where this setup will evolve? I’ll definitely post updates whenever there’ll be something useful.