Reverse remote display: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎VNC: -f sets to background after login, "tail" keeps the session on forever.)
Line 36: Line 36:


First, connect to your ssh server and set up the tunnel:
First, connect to your ssh server and set up the tunnel:
ssh -L 5900:''target.ip'':5900 -l ''user'' ''target.ip''
ssh -fL 5900:''target.ip'':5900 -l ''user'' ''target.ip'' tail -f /dev/null
where ''target.ip'' could be the ip address of your target machine or a domain name, or a name you have set up using dyndns.org or the like. You will need to type in your password at this point, of course.
where ''target.ip'' could be the ip address of your target machine or a domain name, or a name you have set up using dyndns.org or the like. You will need to type in your password at this point, of course.


Connect through the tunnel to the VNC server:
It would be nice if we could use & at the end to make the command run in the background, so we could continue in the same terminal window with the next step, which is to connect through the tunnel to the VNC server:
vncviewer ''target.ip'':5900
vncviewer ''target.ip'':5900


However that doesn't work, since the ssh task needs to be in the foreground when it asks you for a password. If anyone knows how to background the ssh process once you have logged in, please add the info here. In the meantime, you'll just need to start a second terminal activity to run the vncviewer command.


If you want to connect without an encrypted tunnel, you should be able to do so simply with the same vncviewer command as above.
If you want to connect without an encrypted tunnel, you should be able to do so simply with the same vncviewer command as above.

Revision as of 01:31, 5 August 2008

This describes how to control/display your non-XO-computer via your XO. To display the XO's screen on another monitor, see Remote Display

You currently have two options:

X11 forwarding

This will allow you to have the most realistic experience.

First, stop sugar by executing the following as root (via sudo, su, or a vterm):

init 3

You can either run your desktop environment (KDE, GNOME etc) or a single application.

Desktop environment

This will bring the XO down to either a login prompt (Stock 656 and lower builds) or a "Press enter to login" prompt (Update.1-690 and later). In the former case, log in as "root" with no password; in the latter case press the enter key.

Execute the following commands:

su - olpc
xinit -c "ssh -XCnf user@ip gnome-session; xterm"

user should be your username on your target box.
ip should be your machine's IP (something like 192.168.1.5) or hostname (like "merlin").
You can replace gnome-session with whatever command you use to start your session, like startkde.

X will start and xterm will ask you for your password (unless you set up key authentication) and then, after starting your DE will give you a second Xterm on your XO with which to play with the local machine.

This is only if you wish to run the entire session on your XO. For individual apps...

Single applications

This does not require you to kill sugar. Simply run the following command in the terminal activity:

ssh -XCnf user@ip command

VNC

You should first set up an ssh server on your target machine which should allow you to run your VNC session through an encrypted tunnel. You can find information on setting up the ssh & VNC servers elsewhere. Here we assume you already have both running, along with any port forwarding you might need to do if your target machine lives behind a NAT router. You can find many good resources elsewhere for how to set this up.

First, connect to your ssh server and set up the tunnel:

ssh -fL 5900:target.ip:5900 -l user target.ip tail -f /dev/null

where target.ip could be the ip address of your target machine or a domain name, or a name you have set up using dyndns.org or the like. You will need to type in your password at this point, of course.

Connect through the tunnel to the VNC server:

vncviewer target.ip:5900


If you want to connect without an encrypted tunnel, you should be able to do so simply with the same vncviewer command as above.

Note that if you have your VNC server set up to listen on a differnet port for incoming connections, you should alter the above commands accordingly. You may be able to leave out the port number from the vncviewer command if you use the default value of 5900.