Install Linux on an Android-Based Lenovo Yoga Book (YB1X90F)

Having a Linux distribution installed on an Android netbook can be the best of both worlds. Leveraging the Linux kernel already running on any Android device, a Linux userspace will be native and fast and come with many tools power users will appreciate. Here are some ways to get the most out of the Linux on Android experience.

Install GNURoot Debian

The app GNURoot Debian comes with everything you need, including a Debian Jessie filesystem image.  The image is installed as app data.  Once installed, packages can be installed and upgraded using normal tools like apt.

Oddities

The major oddity is the filesystem layout.  All files installed by GNURoot are part of the filesystem image, but /home is actually mapped to the Android “sdcard” partition.  This means that since the Android sdcard partition is formatted as VFAT, features such as symlinks and ownership will not function within /home.  This is not necessarily important for the storage of user data, but it can cause Linux software installers expecting Unix filesystem semantics to fail if attempting to install into /home.  Such installations will need to target a location in the GNURoot image itself; for example, /opt.

Also, due to the mismatch between the GNURoot /etc/passwd and Android app UIDs, Unix file ownership will appear odd in general.  You can generally ignore this, but software installers may do some braindead forms of ownership testing that will need workarounds.

Certain things will not work due to the limitations and security measures imposed by the Android Linux kernel.  For example, strace will not work.  Sometimes it takes some effort to find a workaround to accomplish a specific goal.

DNS

Before you can do anything, you must manually configure your DNS server in /etc/resolv.conf if Google public DNS is unreachable from your network.  If this is the case, you can configure multiple DNS servers with failover like so:

nameserver 8.8.8.8
nameserver 10.0.0.1
options timeout:1

This configuration will attempt Google Public DNS first, and then fall back to the local nameserver if no reply is received after 1 second.

Vim

Due to the Android OS intercepting the Yoga Book’s Esc key, it is impossible to use Esc to re-enter command mode in Vim. A workaround is to use Ctrl-C instead.

execstack

Occasionally, shared libraries or other binaries built with the executable stack flag enabled will be distributed in packages. This will not work on Android due to stack protection, and you will get an error such as “cannot enable executable stack”. The fix is to clear the executable stack flag using the execstack command. However, those programs will still crash if they actually attempt to execute code on the stack.

Leave a Reply