Monday, October 21, 2013

Getting the Nexus 7 in touch with it's Linux Roots

On a whim, a plugged a USB Host OTG into our Nexus 7 and attached my IOGear wireless keyboard and trackball to it. After furiously clicking the reset button on both the keyboard and USB dongle the most amazing thing happened, the keyboard Just Worked.

That's right, a little mouse pointer appeared on the screen when I moved the trackball and the keyboard, well, keyboarded.

I then installed Terminal IDE (no rooting needed) and suddenly I was in Linux-land. I could access files, use vim and generally do anything BusyBox would allow. Even a number of keyboard shortcuts worked, including Alt-Tab to switch among windows.

Of course, I wanted to do more. From my reading, I see that emacs should totally be possible (whoo!), but I've yet to try it. A little testing to get opkg and a number of additional Linux programs to run on the device was a flop (the instructions call for running wget over adb.exe shell, but that command isn't found), so I've still got work to do.

Apparently, if I'm feeling up to it, I can go as far as turning the Nexus 7 into a full blown Linux box. Two options I've found: (a) run Debian alongside Android or (b) boot up Ubuntu instead of Android on the device. (a) requires root access and (b) requires a factory reset, so both options are somewhat extreme. But still, good to know they are out there.

In the mean time, I'm weighing whether or not I should get a tiny bluetooth keyboard so that I can make the setup a whole lot more portable. I'm also wondering how much of this I can do on my Galaxy S3. If I had the right set of Unix tools on my cellphone and a keyboard to access them, there may be times I could get away with not bringing along my Netbook when I travel. I usually do this as an insurance policy in case I need to fix some broken code, but with vim, svn and a few other utilities I may be able to do that from my phone. One can dream, right?


  1. yes it works with the GalaxyS3. I haven't played much with the OTG on my S3, but I've tried a keyboard once and it worked. I mostly just use it to transfer pictures from the camera that doesn't have an eyefi card in it

  2. Sweet. So tempting to turn my Galaxy S3 into a baby unix box.

  3. Nice to know; I'm setting up Debian alongside Android on my Nexus 7 right now. I'll be interested to see how usable it will be. That might be the argument in favor of adding on a decent BT keyboard...

  4. Just use it to SSH into your *NIX box and you are set.

  5. > Just use it to SSH into your *NIX box and you are set.

    I've used various ssh clients on my cell phone for years now, and they are awesome. There's nothing cooler than pulling out my phone, ssh'ing into a server, editing a config file, restarting a server, and saving the day!

    Still, if I had just a few local tools (vim, subversion, ftp) I could do even more development on the device and not be so dependent on having a high quality network (which ssh effectively needs).

    > Nice to know; I'm setting up Debian alongside Android on my Nexus 7 right now.

    The instructions (if you don't mind a factory reset) look amazingly simple. I'd be really curious how it works for you.

  6. Anonymous10:24 AM

    Deja vu: brings back memories of my Nokia N900, a lovely little Linux based phone with built-in keyboard. Nothing I've had since comes close to giving me what I had then. The power of a full Linux (vim, Emacs, ssh, unison, rsync, etc.) in your pocket with the ability to connect to large systems elsewhere.

    I have tried a bluetooth keyboard with my Nexus 4 (and 7) but was less than satisfied. I will need to try a USB based solution given your positive experience!

  7. ericsfraga - I actually hope to have more to say on this topic. I've picked up a bluetooth keyboard and am actually pretty dang impressed with the setup. I want to play with it some more before I review it, but there may actually be something to be said for a tablet + keyboard arrangement.