NX on Android

by cs

Before anyone gets excited: I’m cheating here. This is not a native NX client for Android (more on that at the end of this post). I’m running ubuntu in a chroot environment under Android. It works surprisingly well though.

NX on chroot on Android

An NX session running in a chroot environment on Android


Ubuntu on Android
Installing Ubuntu in a chroot environment is not the scope of this post. Complete Linux Installer from the Google Play Store makes the process relatively pain-free. Go for Ubuntu 12.04 with the LX Desktop Environment that comes with the “Small Ubuntu Image”.

Complete Linux Installer

Complete Linux Installer simplifies setting up a chroot environment


NX client
Installing an NX client is unfortunately a bit harder than I would have hoped. QtNX is part of the standard Ubuntu repositories, but the Qt widgets didn’t seem to work properly – not sure whether it’s a problem with LXDE or with the VNC client, but the controls (dropboxes etc.) simply didn’t render. Therefore we’ll resort to OpenNX. Binary Debian packages are only available for x86 so that we’ll have to build from source. Launching your newly installed Ubuntu will get you to a root terminal within your chroot environment. First, you’ll have to install some build dependencies:

apt-get install libwxgtk2.8-dev libssl-dev libjpeg-turbo8-dev libpng-dev g++ make libx11-dev libxmu-dev

We’ll get nxssh and nxproxy directly from NoMachine’s open source site (the fixed IPs might change over time!):

cd ~
tar -xzf nxproxy-3.5.0-1.tar.gz
tar -xzf nxcomp-3.5.0-2.tar.gz
tar -xzf nxssh-3.5.0-2.tar.gz
cd nxssh
CFLAGS="-I/root/nxcomp" ./configure
cp nxssh /usr/local/bin/
chmod 755 /usr/local/bin/nxssh
cd ../nxproxy
cp nxproxy /usr/local/bin/
chmod 755 /usr/local/bin/nxproxy

Then we’ll build OpenNX:

cd ~
wget http://downloads.sourceforge.net/project/opennx/opennx/CI-source/opennx-
tar -xzf opennx-
cd opennx-0.16
make install

Some permissions for key files need to be fixed:

chmod 755 /usr/local/share/keys
chmod 666 /usr/local/share/keys/server.id_dsa.key

That’s it. Open a VNC connection to localhost:5902, select “Run” from the start menu and launch opennx.

Native NX client for Android
It should be pretty straightforward to build a native NX client connecting to a native X server. I’ve already ported most of the dependencies for another project. Let me know if there’s any interest.