Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I'm accessing my Pi via SSH.

My network is too slow to actually forward the Pi's desktop back to my laptop, so I have a monitor connected to my Pi. When I startx through Putty, I see the desktop on my Pi. All is good.

However, I cannot do anything with this desktop, as all I have is the mouse and keyboard of my laptop.

How can I forward the mouse and keyboard input from my laptop to the desktop on my Pi?

share|improve this question
    
If you're connecting a monitor anyway, why not connect a keyboard and mouse? You normally use ssh when you when you dont have access to the PI itself. –  Ash Burlaczenko Dec 31 '12 at 18:59
    
@Ash I don't have a keyboard. I know they're cheap and everything, but it would make it easier... –  ACarter Dec 31 '12 at 19:16
    
If you only have a single keyboard and mouse, it might make sense to get a KVM switch so you can go back and forth. –  Kibbee Jan 1 '13 at 0:18
    
I'm sure I've written about this before somewhere. –  Jivings Jan 1 '13 at 13:35
    
@Kibbee I thought you couldn't use a KVM switch with a laptop? –  ACarter Jan 1 '13 at 14:30

4 Answers 4

synergy can do this quite well

Synergy lets you easily share your mouse and keyboard between multiple computers on your desk, and it's Free and Open Source. Just move your mouse off the edge of one computer's screen on to another. You can even share all of your clipboards. All you need is a network connection. Synergy is cross-platform (works on Windows, Mac OS X and Linux).

share|improve this answer
    
How did you build it for the Pi? –  HeatfanJohn Jan 1 '13 at 15:56
    
@HeatfanJohn, raspbian has it in the repo –  John La Rooy Jan 1 '13 at 20:19
    
Ah, sudo apt-get install synergy ... cool! –  HeatfanJohn Jan 1 '13 at 22:52

You can use a great tool called x2x. This essentially treats the monitor connected to the remote device (the Raspberry Pi) as a second X screen to you existing session as if you had two monitors connected.

Install x2x on both devices:

sudo pacman -S x2x         # Arch Linux
sudo apt-get install x2x   # Debian/Raspbian 

Configure SSH:

On the Raspberry Pi edit /etc/ssh/sshd_config and add/uncomment the following line:

X11Forwarding yes

Then restart the ssh server.

SSH to the Pi from your other device and run x2x:

ssh -X 192.168.0.70 'x2x -east -to :0'

Replace the IP with the address of your Raspberry Pi.

Now you should be able to move your mouse between the two X sessions by moving your mouse off the screen to the right (east).

share|improve this answer
    
When doing this on both Windows and Ubuntu, I'm getting an error similar to x2x - error: can not open display :0. I've installed x2x on the Pi and Ubuntu, and SSH is set up on the Pi. –  ACarter Jan 1 '13 at 15:00
    
@ACarter I don't think you can involve Windows (unless your using xming) as it needs an X session running at each end. –  Jivings Jan 1 '13 at 15:38
    
Do I need to explicitly start the X session on Ubuntu then? –  ACarter Jan 1 '13 at 16:30
    
@ACarter Yes, it treats the connection as an extension of your existing X session. –  Jivings Jan 1 '13 at 20:26
1  
@ACarter I'm sorry about that. It could be something to do with the DISPLAY variable. Try typing echo $DISPLAY in a terminal and replace the :0 in the x2x command with that output. –  Jivings Jan 1 '13 at 23:29

A quick google eventually led me here and after a quick test this worked for me.

In short you need to setup xrdp

sudo apt-get install xrdp

Once install it will set the rdp service to start on boot, so restart your RPi. When your RPi has finished booting you will be able to connect to your RPi through Windows built-in (or any other third party) remote desktop application.

share|improve this answer
    
Thanks for your answer, that's a neat remote solution, but the idea is that I see the desktop on the screen connected to the Pi, but I can input to this desktop from my laptop's keyboard. –  ACarter Jan 1 '13 at 14:33

Old thread... I know.

I've written a utility I call fauxcon, which forwards your keyboard (and soon, mouse) to the console of another computer you're ssh'd into.

This allows you to view your RPi's display (for instance) on a TV or monitor, and type as if you were logged into the physical device with a keyboard.

Considering everything in my house is wireless, it's rather neat to sit on the couch with laptop and type away, seeing it happen on the big screen on the RPi.

Feedback welcome,

fauxcon - Github - https://github.com/lornix/fauxcon

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.