Remote display

From OLPC
Revision as of 19:40, 27 January 2011 by 71.184.121.181 (talk) (→‎client: Windows: minor copy edit)
Jump to navigation Jump to search
This describes how to control/display your XO-computer from a non-XO PC or Mac or Linux box, or how to hook up the XO to an external VGA monitor or projector. To display another computer's output on your XO's screen, see Reverse remote display

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). Three methods are described below. The first method lets you run a remote Sugar session on the display computer. Using the second method, the current Sugar session is cloned to the display computer. The third method (which isn't actually using the network) requires a soldering iron.

First method: direct output, via USB or VGA

USB display adapters require software

There are USB -> VGA adapters available that support plugging in a second display. However, this hardware requires special device driver software. Adding USB SVGA has instructions for using such adapters that work with the sisusbvga driver.

There is also the wikipedia:DisplayLink USB technology, however according to their FAQ as of December 2007, "DisplayLink does not currently support the Linux operating system."

Hacking into the on-board 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!)

Caveats :

  • 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.

Second method: remote and cloned Sugar sessions

Remote Sugar session (using X11)

Preparations

Note: This method of access can be very slow

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.

To assign a password to the laptop user, obtain a console window, either through the debugging interface accessed by alt + "=", or by bringing up a console with ctl + alt + Mesh key f1 small.png (ctl + alt + F1 on a PC keyboard). Become root and change the password by typing:

su
passwd olpc
exit

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

cd /home/olpc
cp /usr/bin/olpc-session 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:

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

Cloning a current Sugar session (using VNC)

Note: These methods do not allow mouse or keyboard input on the remote display (unless you explicitly enable it as per below).

The easy way: VNC Launcher activity

The easiest way to do this is using the VNC Launcher activity, which effectively is the process below wrapped into an activity. See the VNC Launcher activity page for download links. Or, if you really want to do it manually, read on.

Note that VNC Launcher stops accepting clients after one connection, so you may want to modify the vnclauncher.py script as follows:

replace the line

 cmd = "/home/olpc/Activities/VncLauncher.activity/x11vnc"

with

 cmd = "/home/olpc/Activities/VncLauncher.activity/x11vnc -many -shared"

You may want to read about other options here http://pwet.fr/man/linux/commandes/x11vnc

Starting VNC over SSH

Once VNC Launcher is installed, you can start a VNC server via SSH with the following command: (This is useful if the XO is in a remote location.)

     /home/olpc/Activities/VncLauncher.activity/x11vnc -auth /var/tmp/olpc-auth/.Xserverauth -many -shared

Manually

x11vnc is known to work, does not require messing with passwords, and will allow mouse movement input, but still no mouse buttons or keyboard (but see end of section on how to enable these). This can be achieved as follows:

 rpm -i ftp://rpmfind.net/linux/dag/fedora/7/en/i386/RPMS.dries/x11vnc-0.9.3-1.fc7.rf.i386.rpm

You can search for the latest x11vnc package at [rpmfind.net] Note, if rpm gets an unexpected error in the middle, you may have too many activities running (not enough memory?). Try closing everything but the Terminal window.

After the yum and rpm steps complete successfully, simply running 'x11vnc' as user olpc (don't forget an 'su - olpc' if you're still root from before!) on the XO (e.g., via terminal or through ssh session) will open a password-less VNC session to which to connect with vncviewer.

[UltraVNC] works well for Windows, and it's Resize option is helpful to display the XO's 1200x900 on an e.g. 1024x768 laptop screen to project during a demo.

One problem is that the mechanism to show the "border" (the activities launcher at the bottom and Home etc. icons on top) does not show when you move the mouse pointer in vncviewer to the sides/corner... at least with x11vnc; I haven't tested yet if this better with vncserver; update this if you do.

Alternatively

Install and run x0vncserver on the XO computer. The display computer runs a vncviewer that clones the XO display. (Note that this method will not work yet when the laptops are in mesh mode—we need to do packet-forwarding on the School Server to enable the vnc connection. Until then, put the laptop in infrastructure mode by using an access point for your network access. If you want to project from a machine running Linux with a recent kernel, you can compile the Marvell driver on it and add an 8388 dongle in mesh mode to communicate with XOs in the mesh.)

Preparations

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

 rpm -i -v --nodeps ftp://rpmfind.net/linux/fedora/core/updates/6/i386/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 and create a password for vnc sessions.

 cd /home/olpc
 vncpasswd

Create an activation script for the x0vncserver, still as olpc user, using vi or nano or cat:

 File: ~/x0server
#!/bin/sh
nice -19 x0vncserver PasswordFile=/home/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 leaves no room for other processes to run. The last two options of the x0vncserver (AcceptPointerEvents and AcceptKeyEvents) runs the server in a "view only" mode.

Don't forget to make the script executable.

 chmod a+x /home/olpc/x0server
Just before the presentation

The XO computer and the display computer should be on the same Wifi network (or, depending on the Wifi network there, stability may be better off connecting via Ethernet: XO - USB ethernet adaptor - ethernet cable - USB ethernet adaptor - other laptop hooked up to projector). You will need to know the IP of the XO computer (run /sbin/ifconfig eth0 if you don't know it). Now, from within Sugar, open a console (Alt-0 or Alt-=), and run the /home/olpc/x0server script you have prepared in advanced.

 /home/olpc/x0server

It will write to the console; then you can close the console.

 main: XTest extension present - version 2.2
 main: Listening on port 5900

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

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

or, on some clients,

 vncviewer xxx.xxx.xxx.xxx -fullscreen -viewonly

Where xxx.xxx.xxx.xxx is the XO computer IP address.

In order to close the vnc viewer, press F8 in the displaying computer. This is the escape key which gives you a context menu with various options. You can change the full-screen mode, exit the viewer, and set other options 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.

Enabling Keyboard and Mouse

By default, the XTEST extension is disabled for security reasons. To enable keyboard and mouse usage through a VNC connection, you can enable the XTEST extension by modifying /etc/X11/xorg.conf, changing the line:

 Option "XTEST" "Disable" # Mostly a debugging tool

either by commenting it out:

 # Option "XTEST" "Disable" # Mostly a debugging tool

or explicitly enabling it:

 Option "XTEST" "Enable" # Mostly a debugging tool

Be sure to omit the '-viewonly' option to vncviewer when connecting.

Simple emulation (no XO required)

Given a proper network (fast DSL/LAN) and a fast qemu server your presentation can be fast and authentic.


Server side

First start the qemu session on the host:

  qemu -kernel-kqemu -vnc 0 -k en-us olpc-redhat-stream-development-devel_ext3.img

The flag -vnc 0 tells qemu to direct the VGA output to the VNC session 0.

Next connect with a proper VNC viewer on your laptop/PC which has the VGA output .

client: Mac OS X

On Mac OS X Chicken of the VNC can not properly handle the VGA output of the qemu emulation. So, instead use VNCviewer Direct VNCViewer to your host running the qemu instance and set it to fullscreen. Voila! You should have a much faster remote access possibility than with X11 forwarding.

client: Windows

Use UltraVNC:

Uvncpic.png


Please note that sometimes with UltraVNC you have to play around with the speed settings so that the screen does not refresh all the time too fast.

client: Linux

you know your stuff anyway. Use vncviewer from apt or yum --AaronKaplan 21:45, 17 June 2007 (EDT)