One mouse and keyboard to rule them all

Goal

Control your computers with one mouse and keyboard so that you can use your favorite keyboard and mouse across multiple computers.

Problem

WFH (work from home) is a norm these days due to the pandemic situation. If you are a developer, there is a high possibility that you are using multiple computers for your work.

You need to switch from one computer to another. It’s a hassle to shift from one set of keyboard and mouse/touchpad to another.

Solutions

These are:

  1. Hardware KVM switches: These switches provide hardware interfaces for connecting one and mouse and keyboard with multiple computers. The main problem with this option is to have separate hardware and wires + purchase of a KVM switch. One benefit, it works in most of the scenarios https://en.wikipedia.org/wiki/KVM_switch. ❌

KM: Keyboard and Mouse

KVM: Keyboard, Video, and Mouse

We will look into one of the free open-source software switches called Barrier which will enable us to use the same keyboard and mouse across all the computers.

Why Barrier? Let’s compare:

Comparison of Softwares. Barrier is free and supported on Windows, Mac and Linux operating systems
Comparison of Softwares. Barrier is free and supported on Windows, Mac and Linux operating systems

I wanted to use my Keyboard and Mouse across 3 different platforms: Windows, macOS, and Ubuntu (Linux). That means the right fit for my requirement was either Barrier or Synergy. Since Barrier was free, it was naturally my first choice.

Minimal Setup Requirements

  • Computers on the same local network (home/office wifi/LAN)

Time needed

Less than 30 minutes

Required Skills

  • Install the software and change the configurations

Barrier — Setup

Barrier application only works with computers running on the same local network. The main reason is, one computer works as a Server and other computers work as a Client that connects with the Server over the network.

The computer which connects with Keyboard and Mouse need to be the Server. To set up the Barrier Server and Clients, we need to download the Barrier application.

⬇️ You can download the Barrier application from the Assets section of the releases page: https://github.com/debauchee/barrier/releases

Download the platform-specific Barrier application on each computer.

Barrier Installation

macOS

  • In my case, I wanted to use my MacBook Pro as the main computer so that I can share its keyboard and touchpad (or, Mouse) with other computers.

If you receive the error, grant the permission to open it anyway. Go to System Preferences > Security & Privacy > Allow apps Downloaded from: “Barrier” was blocked from use because it is not from an identified developer.

When you click on the button “Open Anyway”, you may see the Accessibility Access dialog. Provide Accessibility permissions to the Barrier application.

Ubuntu (Linux)

  • Run the following command on the terminal
sudo apt update
sudo apt install barrier
  • Or, open Ubuntu Software and search for barrier. Install it.
  • Open Barrier application. Open the menu and click on the “Change Settings” option.
  • We will look at the remaining configuration in the Client setup section. Note: You can use your Linux computer as a Barrier Server too. It will have a very similar configuration as macOS.

Barrier Server Setup

  • Linux/macOS/Windows: Open Barrier application. macOS: You can open it from the Applications folder if it is not already running.
  • Default settings are enabled to start it as a Client. Don’t worry, we will change the settings to make it a Barrier Server.

Don’t change the settings mentioned under the Networking section unless you know what you are doing. Click the OK button and return back on the main screen.

  • Check the Server (share this computer’s mouse and keyboard) option. You may see a warning indicating that the Barrier application will accept the incoming connections. Click the Allow button. After that, click the Start button.
  • Note down the IP address of your Barrier Server which is also displayed on the main window of the application. For example, in my case, it is 192.168.86.22. We will use this information while setting up the Barrier Client.

Barrier Client Setup

Now, the Barrier Server is ready let’s set up the Client.

  • On your client machine, start the Barrier application.
  • Note down the Screen name which should be the same as the name that you set while setting up the Client.

Connect the Server & Client

  • Open the Barrier Server on the computer that will share its keyboard and mouse to be used across other computers running Barrier Client.

If you place the Client computer icon to the right side of Server computer, it would mean that when your mouse’s cursor crosses the right-side boundary of Server computer’s screen; it would start to appear on the Client’s screen.

If you place another Client computer on left side, it would let your cursor appear on Client’s screen when the cursor crosses the left boundary of the screen.

  • Note: you can delete any computer that was either mistakenly placed or for reconfiguration by dragging it to the Trash/Bin icon.
  • You may also configure more than one Client.
  • Go back to the Client computer. By this time, we have already set the configurations. Click the Start button on Client. It may show a Security question dialog. Click the Yes button. In case if Client is already running, you can also simply click the Reload button.
  • You would notice Barrier is running on Server and Client computers.

You are ready to use the Server computer’s mouse and keyboard on the Client computer.

Move your mouse cursor beyond the screen’s edges of your Server computer and it should transition your cursor on the Client’s computer screen. Open a notepad-like application and then type something while the cursor is on the Client computer and you would notice characters being typed on the Client computer.

Congratulations!