[maemo-developers] How VNCVIEWER can bring non maemo applications onto the N800

From: Aaron Levinson alevinsn at aracnet.com
Date: Wed Feb 21 05:34:00 EET 2007
On Tue, 20 Feb 2007, Neil Jerram wrote:

> Detlef Schmicker <d.schmicker at physik.de> writes:
> > Hello,
> >
> > the last weeks I played around a little with setups, which allow to run
> > applications on N800, which are not ported to maemo. The main problem
> > using this kind of applications is the missing keyboard, if they are
> > cross compiled. 
> In penguinbait's experiments, I believe he uses xkbd to solve this.
> Presumably that would work with your approach too?
> > vncviewer (http://vncviewer.garage.maemo.org/ ) can handle this, as
> > easily is tested connecting to a debian linux machine and trying all the
> > applications availible.
> Oh I see, that is clever!  (I guess xkbd is still possible, but the
> vncviewer keyboard is much more convenient.)

Well, technically, it's not "vncviewer's keyboard", it's the standard 
virtual input method keyboard that is used for all maemo applications.  
Plus, you have the advantages of the special keypresses provided by VNC 
viewer (i.e. Ctrl-Alt-Del, etc.).  For the next release of VNC viewer, 
Detlef is making some changes that will provide the ability to configure 
the behavior of the + and - keys.  They will basically become modifier 
keys (i.e. hold down the - key and click to get a left-click, if the - key 
is configured to act this way).  I think the + and - keys will also work 
as modifier keys for other hardware keys (namely the directional keys), 
ala chords.  This wasn't easily done on the 770 because it wasn't possible 
to have two keypresses at the same time (only the first took), but it 
appears that this problem has been remedied on the N800.

> > Have a look at the screen shot at http://physik.de/770/ with debian /
> > testing runnin on a N800 within chroot and vncviewer.
> Very nice!  To check that I've understood correctly:
> - Are you saying that everything from the debian/testing arm port will
>   run without needing recompilation?

That's my understanding from conversations with Detlef, but I haven't 
personally tried this yet, so I don't know from personal experience.

> - Am I right in thinking that the chroot is only needed so as not to
>   mix up the debian/testing distribution with the maemo?  (In other
>   words, it's not required by something about how Xvnc and vncviewer
>   work?)
> > I tried three different setups (all are working, but none is enduser
> > ready:-)
> >
> > 1.) I compiled Xvnc using the source from debian/testing within bora.
> > This was running on N800. Than I started Xvnc for display :8 (from
> > xterm) set the display variable and started the crosscompiled but
> > unported version of e.g. rdesktop. Than vncviewer was started to view
> > this localaly.
> How does a bora-compiled Xvnc differ from Xvnc in debian/testing?  Is
> it just which libraries (libc etc.) it links to?
> >
> > This way one can use cross compiled version of linux software.
> >
> > 2.) I installed the debian armel port within a chroot environment,
> > installed the vncserver package within this port and did basicaly the
> > same as in 1.)
> > what to be done for setup this:
> > I have debian / armel port running on N800 on a 512 internal flash.
> >
> > I had to format it with ext3 filesystem (I think ext2 would have been
> > OK)
> > I had to insmod mbcache and ext2 module
> > I mounted it
> > I unpacked the rootfs from
> > http://lists.debian.org/debian-arm/2007/01/msg00034.html
> >
> > I installed chroot and chrooted to the directory
> >
> > (I installed a new version of tar (compiled from sources), as the
> > busybox does not support bz2 files)
> >
> > Now I do a gpt-get update within chroot ...
> >
> > This way all packages within this debian armel port seem to be usable on
> > the N800
> Cool.  So, comparing (1) and (2), one basically has a choice between
> cross-compiling and chrooting - right?
> > 3.)
> > I did basically the same but with debian / testing for the arm platform.
> >
> > I compiled debootstrap for maemo, used it to install debian / sarge into
> > a chroot environment. Than I configured /etc/apt/sources.list to use
> > debian testing within the chroot. Did a apt-get update and apt-get
> > dist-upgrade (if I remember correctly I had to remove apt-get first and
> > install the version from debian / stable download dpkg -i), installed
> > vncserver and icewm (window manager) and two init scripts:
> > /root/init.sh with on N800 to start the chroot environment
> > #!/bin/sh
> > insmod /mnt/initfs/lib/modules/2.6.18-omap1/mbcache.ko
> > insmod /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko
> > mount /dev/mmcblk0p1 /media/mmc2
> > chroot /media/mmc2/sid-arm /root/init.sh
> As you say, this seems effectively identical to (2).
> > and within the chroot environment there was
> So this is /root/init.sh, is it?
> > #!/bin/sh
> > Xvnc -depth 16 -geometry 800x600 :8&
> > export DISPLAY=:8
> > icewm&
> > mount proc /proc -t proc
> > mount devpts /dev/pts -t devpts
> > xsetroot -solid "rgb:00/00/30"
> > /bin/bash
> >
> >
> > And up was the debian testing on the N800.
> Well I've already said it, but I'll say it again: very nice!
> And in my view this is a nicer solution than penguinbait's, because it
> means you can have maemo and non-maemo sessions (actually, any number
> of them!) up simultaneously, and switch at will between them.
> (Does VNC Viewer already allow multiple instances of itself?)

Not yet, but now there is a good reason to add this support.  It's
probably relatively simple to do (perhaps it requires multiple views as
with Opera?  It would be preferable to have separate processes, in my
opinion, since that would be considerably less work--of course, you could
just launch VNC viewer from VNC viewer, well, the non-maemo one, at least
:-) )

> > Thus anybody discussing, helping ... to get (I would love the debian /
> > testing) setup enduser ready? A 300 MByte root fs I do not want to
> > deliver, which would be the easiest way :-)
> Is 300Mb the size of the minimal debian/testing system (that includes
> chroot and Xvnc)?  I would hope that a minimal system could be smaller
> than that.
> Once people have the minimal system installed, they can apt-get
> install anything else they want, so it will be OK to trim the starting
> package really down to the absolute minimum.
> > Or getting the first setup developer ready, so that they may easily
> > crosscompile an launch application they love. How to pack this for maemo
> > (dependence an vncviewer and Xvnc server (not x11vnc as in 2006
> > application list :-)
> In my view this option is not so interesting, because apt-get install
> is a lot more fun than cross-compilation.

As Detlef mentioned to me in one conversation, with the cross-compilation
option, this necessitates a developer to build a package.  There is a
possibility for this to be done by MUD, but based on the MUD
documentation, it appears that MUD is currently best suited for building
command-line applications, and the VNC viewer solution is best suited
towards GUI applications.  So, it seems that using apt-get is probably the
best approach.

I think that this use of VNC viewer will be beneficial to many users, not 
just the hardcore users, but it's going to have to be simple to install 
and update ala the application manager.  I think we are going to need a 
custom application that does all the work and allows the user to select 
the packages of interest.  That is, I think such an application is needed 
if this solution is going to be available to the multitude of users out 

Also, in case anyone gets the wrong impression, this was all Detlef's
idea.  I was skeptical at first, but it's good that my suspicions of poor
performance were incorrect.  This technique can provide users with a
significantly larger application base to play with.  Certainly, it's not
as ideal as a truly maemoized version of an application, but depending on
the application, that can be a challenging porting job for a developer. 
This technique provides users with a solution that should be satisfactory
in many cases, especially when going full-screen without the toolbar or
scrollbars in VNC viewer.

> Regards,
>      Neil

Aaron Levinson

More information about the maemo-developers mailing list