Remote display: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
If you are trying to project the user interface of an XO laptop, this page is for you. It describes how to bring up the user interface of an XO laptop across the network on another computer running X11 (the <b>display</b> computer).
If you are trying to project the user interface of an XO laptop, this page is for you. It describes how to bring up the user interface of an XO laptop (the '''source''' computer) across the network on another computer running X11 or Windows (the '''display''' computer). Two different methods are described below. The first method let you run a remote Sugar session on the display computer. Using the second method, the current Sugar session is cloned to the display machine.


= First method: remote Sugar session =
=Changes to the XO (the forwarding or source computer)=
== Preparations ==


There are some harmless changes to the '''XO''' which only need to be done once. You will need to assign a password to the olpc user, and create the script which is remotely executed to start [[Sugar]].
There are some harmless changes to the '''OF'' which only need to be done once. You will need to assign a password to the olpc user, and create the script which is remotely executed to start [[Sugar]].


To assign a password to the laptop user, obtain a console window (through the debugging interface accessed by alt + "=", or by bringing up a console with ctl + alt + F1/Eye). Become root and change the password by typing:
To assign a password to the laptop user, obtain a console window (through the debugging interface accessed by alt + "=", or by bringing up a console with ctl + alt + F1/Eye). Become root and change the password by typing:
Line 17: Line 18:
chmod a+x remotedisplay
chmod a+x remotedisplay


=Stopping Sugar on the XO=
== Stopping Sugar on the XO ==


Due to current limitations of Sugar, there can only be one copy of Sugar running on any given XO. This will mean that you need to shut down Sugar and X on the XO from which you want to forward the user interface. There are several ways you can do this, but the simplest (and temporary) way is to first change to the console, by typing control + alt + F1 (Eye). Log in as root, then change the runlevel of the XO to runlevel 3 by typing:
Due to current limitations of Sugar, there can only be one copy of Sugar running on any given XO. This will mean that you need to shut down Sugar and X on the XO from which you want to forward the user interface. There are several ways you can do this, but the simplest (and temporary) way is to first change to the console, by typing control + alt + F1 (Eye). Log in as root, then change the runlevel of the XO to runlevel 3 by typing:
Line 25: Line 26:
After doing this, the XO should still be associated with any wireless network it already found, but it will have forgotten about its IP address. You need to manually request an address using:
After doing this, the XO should still be associated with any wireless network it already found, but it will have forgotten about its IP address. You need to manually request an address using:


dhclient eth0
ifup eth0


If this doesn't work because you aren't associated with a wireless network, you can manually bring up the network using:
If this doesn't work because you aren't associated with a wireless network, you can manually bring up the network using:


iwconfig eth0 essid "some local wifi SSID"
iwconfig eth0 essid "some local wifi SSID"
dhclient eth0
ifup eth0


You can get a list of the local WiFi networks using iwlist.
You can get a list of the local WiFi networks using


iwlist s eth0
Remember the network address assigned to the XO by DHCP, you will need it for the next steps.


Check the network address assigned to the XO by DHCP, as you will need it for the next steps.
=Bringing up the display remotely=

ifconfig eth0

== Bringing up the display remotely ==


At this point, you will need a version of X on the display computer which is running bare (no display or session manager). The easiest way seems to be to create a new user on the display computer, and give them an .xinitrc (or .xsession file under Debian) which consists simply of:
At this point, you will need a version of X on the display computer which is running bare (no display or session manager). The easiest way seems to be to create a new user on the display computer, and give them an .xinitrc (or .xsession file under Debian) which consists simply of:
Line 46: Line 51:
ssh olpc@xo-ip-address -C -X /home/olpc/remotedisplay
ssh olpc@xo-ip-address -C -X /home/olpc/remotedisplay


= Second method: cloning the current Sugar session =
=Caveats=

The trick is to install RealVNC, and run x0vncserver on the XO computer. The display computer, runs a vncviewer that clones the XO display.

== Preparations ==

You have to fetch and install the vnc-server on the XO computer. Login as root to a shell, and run the following:

cd /tmp
wget ftp://rpmfind.net/linux/fedora/core/updates/6/i386/vnc-server-4.1.2-9.fc6.i386.rpm
rpm -i -v --nodeps vnc-server-4.1.2-9.fc6.i386.rpm

You can search for a newer package at [http://rpmfind.net/linux/rpm2html/search.php?query=vnc-server&system=fedora&arch=i386 rpmfind.net].

Now, login as an olpc user, create a password for the vnc sessions.

cd ~
vncpasswd

Create an activation script for the x0vncserver, again in the olpc user account.

{{Box File|~/x0server|
<pre>
#!/bin/sh
nice -19 x0vncserver PasswordFile=~olpc/.vnc/passwd AcceptPointerEvents=0 AcceptKeyEvents=0 &
disown
</pre>
}}

The x0vncserver must run very very nicely (<tt>nice -19</tt>), since otherwise it takes all available CPU and leave no room for other processes to run. The last two options provided to the x0vncserver (<tt>AcceptPointerEvents</tt> and <tt>AcceptKeyEvents</tt>) runs the server in a "view only" mode.

Dont forget to make the script executable.

chmod a+x ~/x0server

== Just before the presentation ==

The XO computer and the display computer should be on the same Wifi network. You will need the IP of the XO computer (run <tt>ifconfig eth0</tt> if you don't know it). Now, from within Sugar, open a developer console (Alt-0), and run the <tt>~/x0server</tt> script you have prepared. It will start writing some staff, and you can close the console.

In the display computer, run the vnc client/viewer.

vncviewer 192.168.xxx.xxx FullScreen=1 ViewOnly=1

Where 192.168.xxx.xxx is your XO computer IP address.

In order to close the vnc viewer, press F8 in the displaying computer. You will get a context menu that provides you the options to change the full-screen mode, exit the viewer, and change other settings as well.

= Caveats =


==Modifying WiFi==
== Modifying WiFi ==
Whatever you do, don't click on the WiFi signal strength when using the remote display. Even if you select the network you are already using, you will freeze the display.
Whatever you do, don't click on the WiFi signal strength when using the remote display. Even if you select the network you are already using, you will freeze the display.


==Screen Resolution==
== Screen Resolution ==
The vnc server dies when the resolution is changed. You will have to restart the server and the client if the screen orientation is changed.
It is unclear what the effects of different display computer screen resolutions will have on the remote display.


=Using a Laptop's VGA output=
== Using a Laptop's VGA output ==


While on Gen1 XO laptops (the B1/B2/B3/C1/MP builds) it will continue to be possible to attach a VGA connector to the XO motherboard, making use of it requires soldering a jumper (pins 1 and 3 of CN18) and cutting the laptop case to make room for it. In B3/C1/MP versions, additional required passive components will not be populated on the motherboard (but are easier to obtain than the required VGA connector!)
While on Gen1 XO laptops (the B1/B2/B3/C1/MP builds) it will continue to be possible to attach a VGA connector to the XO motherboard, making use of it requires soldering a jumper (pins 1 and 3 of CN18) and cutting the laptop case to make room for it. In B3/C1/MP versions, additional required passive components will not be populated on the motherboard (but are easier to obtain than the required VGA connector!)
Line 60: Line 112:
One problem with this approach (on B2, but not B3/C1/MP machines) is a weird gamma correction currently applied by software to fix a hardware wiring error.
One problem with this approach (on B2, but not B3/C1/MP machines) is a weird gamma correction currently applied by software to fix a hardware wiring error.


An additional problem is that many displays are very unhappy with the 1200x900 resultion
An additional problem is that many displays are very unhappy with the 1200x900 resolution video output by default by the XO laptop.
video output by default by the XO laptop.

Revision as of 14:10, 19 April 2007

If you are trying to project the user interface of an XO laptop, this page is for you. It describes how to bring up the user interface of an XO laptop (the source computer) across the network on another computer running X11 or Windows (the display computer). Two different methods are described below. The first method let you run a remote Sugar session on the display computer. Using the second method, the current Sugar session is cloned to the display machine.

First method: remote Sugar session

Preparations

There are some harmless changes to the 'OF which only need to be done once. You will need to assign a password to the olpc user, and create the script which is remotely executed to start Sugar.

To assign a password to the laptop user, obtain a console window (through the debugging interface accessed by alt + "=", or by bringing up a console with ctl + alt + F1/Eye). Become root and change the password by typing:

su
passwd olpc

Now go to the laptop user's home directory, and create the script which will start sugar:

cd /home/olpc
echo "#\!/bin/sh" > remotedisplay
cat .xinitrc >> remotedisplay
chmod a+x remotedisplay

Stopping Sugar on the XO

Due to current limitations of Sugar, there can only be one copy of Sugar running on any given XO. This will mean that you need to shut down Sugar and X on the XO from which you want to forward the user interface. There are several ways you can do this, but the simplest (and temporary) way is to first change to the console, by typing control + alt + F1 (Eye). Log in as root, then change the runlevel of the XO to runlevel 3 by typing:

init 3

After doing this, the XO should still be associated with any wireless network it already found, but it will have forgotten about its IP address. You need to manually request an address using:

ifup eth0

If this doesn't work because you aren't associated with a wireless network, you can manually bring up the network using:

iwconfig eth0 essid "some local wifi SSID"
ifup eth0

You can get a list of the local WiFi networks using

 iwlist s eth0

Check the network address assigned to the XO by DHCP, as you will need it for the next steps.

 ifconfig eth0

Bringing up the display remotely

At this point, you will need a version of X on the display computer which is running bare (no display or session manager). The easiest way seems to be to create a new user on the display computer, and give them an .xinitrc (or .xsession file under Debian) which consists simply of:

exec xterm

Log in as the new user, and from that single xterm, you should be able to bring up the display remotely using:

ssh olpc@xo-ip-address -C -X /home/olpc/remotedisplay

Second method: cloning the current Sugar session

The trick is to install RealVNC, and run x0vncserver on the XO computer. The display computer, runs a vncviewer that clones the XO display.

Preparations

You have to fetch and install the vnc-server on the XO computer. Login as root to a shell, and run the following:

 cd /tmp
 wget ftp://rpmfind.net/linux/fedora/core/updates/6/i386/vnc-server-4.1.2-9.fc6.i386.rpm
 rpm -i -v --nodeps vnc-server-4.1.2-9.fc6.i386.rpm

You can search for a newer package at rpmfind.net.

Now, login as an olpc user, create a password for the vnc sessions.

 cd ~
 vncpasswd

Create an activation script for the x0vncserver, again in the olpc user account.

 File: ~/x0server
#!/bin/sh
nice -19 x0vncserver PasswordFile=~olpc/.vnc/passwd AcceptPointerEvents=0 AcceptKeyEvents=0 &
disown

The x0vncserver must run very very nicely (nice -19), since otherwise it takes all available CPU and leave no room for other processes to run. The last two options provided to the x0vncserver (AcceptPointerEvents and AcceptKeyEvents) runs the server in a "view only" mode.

Dont forget to make the script executable.

 chmod a+x ~/x0server

Just before the presentation

The XO computer and the display computer should be on the same Wifi network. You will need the IP of the XO computer (run ifconfig eth0 if you don't know it). Now, from within Sugar, open a developer console (Alt-0), and run the ~/x0server script you have prepared. It will start writing some staff, and you can close the console.

In the display computer, run the vnc client/viewer.

 vncviewer 192.168.xxx.xxx FullScreen=1 ViewOnly=1

Where 192.168.xxx.xxx is your XO computer IP address.

In order to close the vnc viewer, press F8 in the displaying computer. You will get a context menu that provides you the options to change the full-screen mode, exit the viewer, and change other settings as well.

Caveats

Modifying WiFi

Whatever you do, don't click on the WiFi signal strength when using the remote display. Even if you select the network you are already using, you will freeze the display.

Screen Resolution

The vnc server dies when the resolution is changed. You will have to restart the server and the client if the screen orientation is changed.

Using a Laptop's VGA output

While on Gen1 XO laptops (the B1/B2/B3/C1/MP builds) it will continue to be possible to attach a VGA connector to the XO motherboard, making use of it requires soldering a jumper (pins 1 and 3 of CN18) and cutting the laptop case to make room for it. In B3/C1/MP versions, additional required passive components will not be populated on the motherboard (but are easier to obtain than the required VGA connector!)

One problem with this approach (on B2, but not B3/C1/MP machines) is a weird gamma correction currently applied by software to fix a hardware wiring error.

An additional problem is that many displays are very unhappy with the 1200x900 resolution video output by default by the XO laptop.