> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Share Your Keyboard and Mouse Between Linux and Raspberry Pi
- URL: https://itsfoss.com/keyboard-mouse-sharing-between-computers/
- Published: 2019-08-16T08:36:39.000Z
- Updated: 2024-12-02T04:05:18.000Z
- Description: This DIY tutorial teaches you to share mouse and keyboard between multiple computers using open source software Barrier.
- Author: Abhishek Prakash
- Tags: Raspberry Pi

I landed in a situation where I had two monitors connected to my laptop and I wanted to use a Raspberry Pi in the mix.

Since I only needed to use the Pi occasionally, it made no sense to get a dedicated keyboard for it. And thus I decided to share my keyboard and mouse between the two devices.

Actually, there are two ways to handle this issue:

- **Hardware:** Get a keyboard mouse pair that can switch between devices. Some keyboards allow you to switch between 3 devices using RF and Bluetooth combination. You may always use KVM switch to change the output device.
- **Software:** You use a tool like Barrier or its fork Input Leap (both explained in detail in this article).

📋

If you could, go for a keyboard mouse pair that allows connecting/switching between multiple devices. That will be a convenient option. The software method takes some effort but it could be a solution when you want to learn something new and don't want to spend on new hardware.

If you cannot go for the hardware solution, try the software based approach to share the keyboard and mouse between computers.

## The set-up

[Barrier](https://github.com/debauchee/barrier?ref=itsfoss.com) used to be the go-to software for this kind of approach but it has not seen new development in years. An earlier version of this tutorial used Barrier, and the instructions can still be [followed in the PDF here](https://itsfoss.com/content/files/2024/12/itsfoss-share-keyboard-mouse-barrier.pdf).

I used **Input Leap**, a fork of another open-source project called Barrier. The architecture of this setup is simple. You setup Input Leap in server mode on the system where keyboard-mouse is attached. And then you setup Input Leap or Barrier in client mode. Why Barrier? I'll discuss it later in the tutorial.

![Sharing keyboard mouse with KVM software Input Leap and Barrier](https://itsfoss.com/content/images/2024/12/Input-Leap-setup.png)

The process involves this:

- Installing the Input Leap software on all the devices you want in this sharing setup
- Setting up the software on the system with keyboard-mouse in server mode
- Setting up the software on the system(s) without keyboard-mouse in client mode
- Using the software to switch between the devices

💡

Did I mention that you can even share clipboard and thus copy paste text between the computers using Input Leap? That's awesome, isn't it?

Let’s see how to share the mouse and keyboard with multiple computers using this method.

## Installing Input-leap on Debian (using pre-built releases)

The developers of Input Leap have kindly provided pre-built releases on their [GitHub page](https://github.com/input-leap/input-leap/releases?ref=itsfoss.com). This is the easiest way to get started.

#### Download the Pre-Built Package

Visit the [GitHub releases page](https://github.com/input-leap/input-leap/releases?ref=itsfoss.com) and download the `.deb` file that matches your system’s architecture (e.g., `amd64`).

![input-leap github release page](https://itsfoss.com/content/images/2024/11/input-leap-github-downloads.png)

#### Install the Package

```bash
sudo dpkg -i input-leap-*.deb
```

![installing input-leap from terminal](https://itsfoss.com/content/images/2024/11/input-leap-debian-cli-install.png)

#### Start Input Leap

Run the Input Leap server on your device:

![running input-leap for the first time, initial welcome screen](https://itsfoss.com/content/images/2024/11/input-leap-welcome.png)

Now you are ready to start input-leap:

![configuring input-leap as a server on deb-vm](https://itsfoss.com/content/images/2024/11/ksnip_20241114-162912.png)

That’s it! Your Debian system is ready to share its keyboard and mouse. 

![once input-leap is running, you can close the application and it will work in the background.](https://itsfoss.com/content/images/2024/11/input-leap-background-process.png)

Configure the client on your secondary device(s).

## Building input-leap from source (for Raspberry Pi)

If you can’t find a suitable pre-built release, or you’re using a platform like Raspberry Pi, you’ll need to build Input Leap manually from source. 

🚧

Building from source could be intimidating and often not worth the effort. If it scares you, you can try installing barrier on Raspberry Pi as it is available in Debian repositories. Input Leap as server and Barrier as client works fine, too. 

If you still decided to [go for source code installation](https://itsfoss.com/install-software-from-source-code/), here are the steps.

#### Install build dependencies

Ensure your system has all the necessary tools and libraries installed:

```bash
sudo apt-get install -y \
                  cmake \
                  g++ \
                  git \
                  libavahi-compat-libdnssd-dev \
                  libcurl4-openssl-dev \
                  libice-dev \
                  libsm-dev \
                  libssl-dev \
                  libxinerama-dev \
                  libxrandr-dev \
                  libxtst-dev \
                  libxkbcommon-dev \
                  libglib2.0-dev \
                  ninja-build \
                  qtdeclarative5-dev \
                  qttools5-dev \
                  meson
```

![installing input-leap dependencies](https://itsfoss.com/content/images/2024/11/input-leap-dependency-install-1.png)

#### Clone the repository

Fetch the source code:

```bash
git clone --recursive https://github.com/input-leap/input-leap.git
cd input-leap/
```

![cloning input-leap git repository](https://itsfoss.com/content/images/2024/11/input-leap-git-clone.png)

#### Build the project

First, create a build directory and configure the build system:

```bash
cmake -S. -B build

```

![configuring the build files in the build directory](https://itsfoss.com/content/images/2024/11/input-leap-cmake.png)

Then, compile the project:

```bash
cmake --build build
```

![compiling the build from source](https://itsfoss.com/content/images/2024/11/input-leap-build.png)

#### Install Input Leap

Finally, install the compiled binaries:

```bash
sudo make install
```

![installing input-leap after compilation](https://itsfoss.com/content/images/2024/11/input-leap-make-install.png)

## Set up Input Leap as the server

📋

You do it on the computer that has keyboard and mouse attached to it.

Once you build and install Input Leap, you won’t find its icon in the main menu bar. To access it, simply type:

```bash
input-leap
```

This will launch Input Leap in GUI mode, and a welcome window will pop up, guiding you through the initial setup.

![to run input-leap for the first time, it requires typing it in the terminal](https://itsfoss.com/content/images/2024/11/input-leap-welcome-rpi-1.png)

Next, it will prompt you to select a role as either a server or client. Choosing a server means your device will share its keyboard and mouse with other systems, while selecting client allows the device to receive inputs from the server.

![select the role of your input-leap: as a server or a client](https://itsfoss.com/content/images/2024/11/input-leap-config-rpi-1.png)

And voila! You should see an IP address and an SSL fingerprint. It’s not entirely done because you have to configure the server a little. Click on Configure Server option.

![configuring the input-leap as server on raspberry pi](https://itsfoss.com/content/images/2024/11/input-leap-initial-setup-rpi-3.png)

In here, you should see your own system in the center. Now you have to drag and drop the computer icon from the top right to a suitable position. The position is important because that’s how your mouse pointer will move between screens.

![server configuration, drag and drop pane to add clients](https://itsfoss.com/content/images/2024/11/input-leap-server-config-rpi.png)

I have my Acer laptop connected and a Debian virtual machine as a client. 

Do note that you should provide the [hostname](https://itsfoss.com/change-hostname-ubuntu/) of the client computer. In my case, it was ACER and deb-vm. It won’t work if the hostname is not correct. 

Don’t know the client’s hostname? Don’t worry, you can get it from the client system.

🚧

Input Leap does not support ****Wayland**. If your system uses Wayland, you’ll need to switch to X11 or consider alternatives like Barrier. I learned this the hard way after extensive testing.

## Set up the client

On the second computer, start input-leap and choose to use it as client.

![selecting role of input-leap as a client](https://itsfoss.com/content/images/2024/11/input-leap-config-client.png)

You need to provide the IP address of input-leap server. You can find this IP address on the input-leap application running on the main system, in my case on my Raspberry Pi (see the screenshots in previous section).

![adding the ip address of the server to the client input-leap menu](https://itsfoss.com/content/images/2024/11/input-leap-client-config.png)

If you see an option to accept secure connection from another computer, accept it.

![accepting ssl prompt to connect the client to the server](https://itsfoss.com/content/images/2024/11/input-leap-ssl-prompt.png)

You should be now able to move your mouse pointer between the screens connected to two different computers running two different operating systems. How cool is that![ ](https://itsfoss.com/content/images/wordpress/2019/08/setup-barrier-client-800x400.jpg)

## Mix-and-match: Using input leap and barrier together?

During my initial attempts, I couldn’t get input-leap to build successfully on my Raspberry Pi. As a workaround, I used Barrier on the Pi and Input Leap on my Windows PC. 

Surprisingly, this setup worked flawlessly! Both tools use the same protocol, making them interchangeable in many scenarios.

## Conclusion

An earlier version of this tutorial used Barrier in the complete setup. If you want to do that, the older tutorial instructions are available in this PDF. 

[Share Keyboard Mouse using BarrierOld tutorial that used Barrier in both server and client modeitsfoss-share-keyboard-mouse-barrier.pdf408 KBdownload-circle](https://itsfoss.com/content/files/2024/12/itsfoss-share-keyboard-mouse-barrier.pdf "Download")

Input Leap is a powerful tool for managing multiple devices with ease, but it comes with some caveats, particularly for Wayland users. 

If you’re comfortable building software from source, Input Leap offers a seamless experience. 

For those encountering challenges, Barrier provides a reliable fallback. With this guide, you can simplify your workflow across Linux, Raspberry Pi, and Windows systems. Happy tinkering!