This howto explains how to configure ubuntu to be remote controlled using x2x.

Remote controlling ubuntu with x2x

Using x2x with SSH

This method is simpler and much more secure than other methods commonly described.

In this example we will use the names 'workstation' for the computer you want to use your mouse/keyboard on, and 'laptop' for the one you want to control. We will also assume that the workstation is to the left of the laptop.

First, on the laptop (the machine you want to control), install x2x and the ssh server:

sudo aptitude install x2x openssh-server 

Then, start an X11 session (log in) locally on the laptop. Finally, on the workstation (where you want to use the mouse and keyboard from), login through ssh to the same user account on laptop and launch x2x:

ssh -XC user@laptop  x2x -east -to :0.0

Type in the password for the user on the laptop when it asks. And that's all: you should be able to move the mouse smoothly from the workstation monitor to the laptop screen and back.

Next, you can create a launcher on the desktop to make it easy to start it up: right click on the desktop, select 'Create Launcher...', and copy the ssh line from above into the 'Command' section.


If you get an error when running x2x:

x2x - error: can not open display 

Make sure you included the '-X' bit on the ssh command. Next, you need to make sure 'X Forwarding' is enabled. This is enabled in ubuntu by default, but if for some reason it's not, you need to edit /etc/ssh/sshd_config and uncomment the line that says:

X11Forwarding yes

One additional caveat: If you are using a login manager such as gdm, you must enable remote TCP connections to the X server. In Ubuntu 8.04.1 run the command

sudo /usr/sbin/gdmsetup. 

Select the Security tab and uncheck the "Deny TCP connections to the Xserver" checkbox.

Or, just edit /etc/gdm/gdm.conf-custom and add DisallowTCP=false under [security] section.



Using x2x

You can change '-east' to '-west', '-north' or '-south' to change which side of the workstation opens up to the laptop, depending on your setup.

For more x2x options, consult the man page of x2x(1):

man x2x

X2xHowto (last edited 2012-09-28 15:53:09 by p5DCD0B2E)