In this guide, you will learn how to control multiple devices with one mouse and keyboard, using a free program called Barrier.
Barrier is one of many ways you can control multiple computers using a single mouse and keyboard. There are other paid software solutions, like Synergy, and physical KVM switches, which let you swap between devices by pressing a button. Depending on your use case, a cheap USB switcher may suffice.
Barrier works best on a local home network, where the same two devices are always connected to the same network. If you’re using VPNs, plan on using this at work, or are at a coffee shop, you will probably encounter networking issues and this probably won’t be a good option for you.
Note that Barrier may be used on Windows, Mac, and Linux. You can use it to share hardware across any combination of these devices and have more than two devices as well. Barrier may be a little difficult to set up compared to paid options.
The main advantage of using software tools like Barrier or Synergy comes with using multiple monitors – one for Apple‘s macOS and one for Microsoft Windows. It allows you to seamlessly move your mouse to the edge of one screen, and the mouse continues onto the screen of the other computer, behaving almost as if you had a single PC with multiple monitors connected. They also support basic copy/paste operations, so you can transfer the clipboard between devices immediately. If you only use a single monitor and manually switch input modes to go from Mac to Windows, it’d probably be easier to just buy a USB switcher.
If you are using Logitech Devices, many of them support connectivity to one of three different “channels”. If you set up channel 1 for your PC and 2 for your Mac, all you need to do is press the little button on the bottom of the mouse, or the corresponding button on the keyboard, to switch between devices. You can also try setting up Logitech’s “Flow” feature using Options+
Unfortunately, it only works well if all your devices support it. It’s purely software, but Logitech restricts it to only their devices. So you can’t use a Logitech mouse and a Razer keyboard. Only the mouse would be able to go back and forth! Damn commercial companies!!!
Getting Started
Begin by downloading and installing Barrier on both of your devices. The installer files may be found on the Releases page in Barrier’s GitHub repo.
Barrier Releases Page (Download Here)
Download the installer from the latest release (the one at the top). They’re in the “Assets” section. Download the executable .exe file for Windows and the disc image .dmg file for Mac.
Install
Open the installer files and install the software like you would any other application.
On Windows, accept the terms without reading them (as is tradition) and click next until it’s installed.
On Mac, open the Applications folder in Finder. Then open the .dmg file and drag Barrier into the Applications folder.
Now we can start configuring Barrier.
Set Up Windows
Before configuring anything, determine which computer you want to function as the server, and which will be the client. The server is the computer that your mouse and keyboard are hooked up to. It’s the computer that controls the others. This should be whichever computer you use the most. In my case, I use Windows first and Mac on the side. So I will set up my Windows machine as the server and the Mac machine as the client.
Barrier will walk you through some setup steps when you run it for the first time. Pick your language and set the computer as your server or client.
Then click Finish.
A popup should appear asking if you want to install Bonjour. Click yes. This allegedly makes it easier for Barrier to make connections to the clients with less configuration on your part.
Wait for Bonjour to finish installing. Then switch to Mac
Set Up Mac
Setting up Barrier on Mac requires a few extra steps. Since Apple thinks you are dumb, they will not allow you to run Barrier without creating an exception in your system’s security settings. When you open Barrier, you will get a scary warning. Do not move Barrier to the trash.
Instead, open Mac’s Settings and open the “Privacy & Security” section. An option to “Open Anyway” should appear. If it does not, leave settings open and try opening Barrier again.
Now Barrier should be allowed to open, but there’s another step. We need to grant Barrier permission in Mac’s accessibility settings.
Open System Settings, or if they’re still open, go to “Privacy & Security” – “Accessibility”. Toggle Barrier’s switch to the on position.
Open Barrier again and it should finally let you pick your language, client, or server, and take you to the main window. This part should look just like on Windows.
Select if Mac is going to be your server or client. This should be the opposite of whatever you selected on your Windows device. Since my Windows PC is the server, my Mac will be the client.
Client Config
On whichever computer you’ve chosen to be your client, open Barrier. Note that Barrier may already be open even if you don’t see it. On Mac, you will see Barrier running in the Mac Menu bar. In Windows, it may be running in the System Tray (bottom right next to the clock – you may need to click the up arrow to see the icon). Be warned, Barrier does not check if it is already running. So it’s easily possible to accidentally open multiple instances of Barrier without meaning to.
On the client, navigate to Change Settings. On Mac, this is in the menu under Barrier – Change Settings. On Windows, this is in the same spot (but at the top of the Barrier window).
This window has a few important settings. First, change your screen name. This is optional, but picking an easy-to-remember and type name will be useful in a moment. The screen name is how your server will identify the client.
Also optional – select Start Barrier on startup if you plan on using this program all the time.
Finally, deselect the “Enable SSL” option. Note that this makes Barrier less secure. However, configuring an SSL certificate is a bit more complicated and may require additional software. I just want to show you how to get this working, for now. We can try this out later. So disable SSL and click OK when done.
Configure Server
Do the same thing you just did on the client with the server. Set the settings and disable SSL. You don’t need to set a screen name for your server but you do you.
Next, still on the server, hit the “Configure Server” button under configure interactively.
This opens a window where you add your client screens to the server. The server is in the middle. On my physical desk, my Mac (client) monitor is to the right of my Windows (server) monitor. So I will drag and drop a monitor to the right of the one in the center. This will represent the Mac.
The new monitor will be labeled “Unnamed” by default. We need to change this to match the screen name of the client computer. Double-click the screen you just added.
Now make sure the screen name matches the name you picked on your client and click OK.
Note that this screen also has options for modifier keys and fixes. If you have input issues, you may want to come back and change these later. For example, if you want to swap the super (start) and control keys or something since you’re going between a Mac and Windows machine.
You should now see your server in the center and your client next to it – with the proper screen names. Click OK again to close the server configuration window.
Start Barrier
Now you can try starting Barrier. Start it on your server first, then on your client. If it works, you should see a message saying the connection was established, and the client should say “Barrier is running.” If that works for you, then great! However, in many cases, it may get stuck saying “Barrier is starting.”
If you get stuck at “Barrier is starting” for more than like 15 seconds something went wrong. Most likely, we need to manually specify an IP address on the client.
There are different formats your network uses for local IPs. On my Windows server, the server is actually listed with 3 different IPs. The client probably doesn’t know what IP to connect to.
Examine Barrier on your server. Mine has 3 different IPs listed (each separated by a comma). Because reasons, on my network, only the last IP address will work – the one that starts with 10. The first one in bold does not work for me.
Return to your client. Uncheck the “auto config” button under the client area and manually type in the IP address of the server.
You will not be able to type the IP unless you uncheck “Auto config” first.
Now try starting the server and the client again. If it says Barrier is running on both the server and the client, you should be good to go! Try moving your mouse between the screens.
If it worked, your mouse should appear on the left side of your client when you move it off the right side of your server (or whatever direction you chose when you set up the screen layout). Your keyboard should control whichever computer your mouse is currently on.
Note that not all keyboard inputs may be transferred to the client. Certain special keys may only work on the server. You should keep a spare keyboard in a drawer somewhere.
Common Issues / Troubleshooting
- Connection Problems / Stuck on “Barrier is starting”
- Make sure the server is running before trying to start the client.
- Make sure both server and client are connected to the same network (not different WiFi networks).
- Ensure any VPN software is turned off.
- Make sure the screen name on the server – under “Configure server” window matches the screen name it says on the client.
- Make sure SSL is disabled on both the server and the client.
- If the server displays multiple IP addresses, try entering the other IPs (one at a time). And then start the client to test each time.
- Make sure you are not running multiple instances of Barrier.
- Still not working?
- There may be an issue with network security settings on your server or client.
- Check which port Barrier is using under the “Change settings” menu option. The default seems to be 24800.
- It is possible (though relatively unlikely) that another program is using port 24800 for something. Try another port number. I’d suggest picking a random number between 10,000 and 30,000. Make sure the port number is the same on both devices. Then reload the server and start the client again.
- If that does not work, allow the port through your firewall. Make sure Barrier is allowed under your Firewall. How to do this will vary based on the firewall you are using. If you’re using Windows and its included firewall, review this guide from Windows Central. Note that the port type is TCP, not UDP.
- If you’re using a different firewall, check with their documentation/support.
- Restart both computers and try again.
- Threaten your computer with violence.
- Getting help
- Open “Show Log” under the barrier menu. This may provide more details as to what is going wrong. If you’re not a very technical person, the output may be confusing.
- As a free, open-source tool, it will be difficult to get support for this software. Barrier is based on an older version of Synergy, the paid alternative. You can fork over the $30-$60 and see if they’ll help you.
- You may post a comment at the bottom of this page. I’ll try to help but there’s probably not much I can do if everything above didn’t work.
- Give up and buy a KVM switch off Amazon, or invest in devices like Logitech which supports multiple connections per input device.