What's Up Dock?
Kyle finally has found a replacement for his beloved Nokia N900, but maybe not for the reasons you might suspect.
If you have followed my column during the past few years, you'll know that I am a big fan of having a portable Linux environment with me wherever I go. For years, this took the form of small laptops (like the Fujitsu P series) and most recently the Nokia N900, which took the form factor down to pocket size.
When I got the N900, I thought technology finally had caught up to a dream of mine: the ability to carry my computer in my pocket and, when I'm out walking around, interface with it via the small keyboard and touchscreen. When I get home, I can dock it, and it will expand to a larger display with a proper keyboard and mouse and become my regular computer. The big advantage of this idea is that I can keep my files and environment with me wherever I go.
Where the N900 Fell Short
Unfortunately, as much as I loved the N900, it had two major shortcomings that stopped me from realizing this dream: low-resolution composite video output and slightly underpowered hardware.
Although the N900 display was 800x480 (not great but large enough for a desktop environment), it could output only standard composite video. When I first got the N900, I thought my presentations looked pretty good on it. I had planned to use it for all my conference presentations going forward, but after seeing the low-res results over composite video, I realized that wasn't going to work. I've tried a number of different techniques to work around this limitation—I could set up a local USB network and then see the display over VNC. In fact, I even wrote a previous column talking about how to do this, but although interesting, it ultimately was not the solution I wanted.
The N900 was a reasonably fast device at the time it was released with a 600MHz ARM processor, 256MB RAM and 32GB of onboard storage expandable to 64GB with an extra microSD card. Although those specs are fine for a portable device and really worked pretty well for my usage model (mostly terminals and Web browsing), when on a larger screen, it seemed like the computer should perform a bit faster.
Basically, the N900 was almost there, but not quite. Since a number of phones released after the N900 not only had better hardware specs but also HDMI output, my plan was to wait for the N900+1, whatever that product ended up being, because I assumed it likely would be faster and have HDMI output. Unfortunately, if you've been following the Nokia story, you know that Nokia abandoned its Linux-based phones shortly after the N900, and the follow-on device never really lived up to expectations—the version that had a hardware keyboard wasn't even available for purchase and still had composite out. With the rise and fall of most of the remaining mobile Linux environments and no real platform to go with, I just kept using the N900 and prayed it wouldn't break before I found a successor.
Kyle's Using Android?
I'm about as surprised as anyone that I found the N900's successor in a Droid 4—an Android device. I'll be honest, I don't really like Android. I want a true Linux distribution in my pocket, not a phone OS where you need a special app to do anything. All of the pre-installed junkware you get from your carrier reminds me of Windows desktops. I don't like that you have to sneak around and root the device to use it truly how you want (and to get a halfway usable terminal). I don't like how fragmented Android is and how beholden you are to your carrier to get OS upgrades on your device. I also don't like that all of my favorite Linux apps can't be ported over easily. So when I recently got a Droid 4 from my employer, my plan was just to use it for work e-mail and calendaring and keep the N900 for all my mobile computing.
So, what caused me to get past all of my feelings about Android? It came down to a laptop dock. When I first heard about the Motorola Atrix and the fact that it had a laptop dock that essentially turned it into a Netbook running a strange version of Linux (Figure 1), I was intrigued but not enough to run Android and put down a few hundred dollars for a dock. Recently though, I saw an article on-line that described how someone had used a series of USB and HDMI adapters to connect his Raspberry Pi to the Atrix laptop dock. Because the dock is basically just a dumb (but high-res) display with an integrated USB keyboard and touchpad, if you had the right adapters, you could connect just about any computer to it. Plus, because it had a big integrated battery designed to charge the phone over USB, it even could power the Raspberry Pi. The dock never really took off for its intended use, so he was able to find one for around $70 or so, and combined with a Raspberry Pi, it made a nice little portable Linux environment.
Figure 1. Atrix Dock Promotional Picture from Motorola
I had some birthday money burning a hole in my pocket, so I found an Atrix laptop dock for $65 on-line and decided to see if I couldn't get it working with my Raspberry Pi. When the dock arrived, I hadn't yet ordered all of the various adapters to use it with my Raspberry Pi, so I figured in the meantime, I would try to test it with my Droid 4. Although the micro HDMI and USB connectors were the right size and the right distance apart to work in my Droid 4, unfortunately they were both turned 180 degrees the wrong way. I wasn't the first person who tried to do this, however, and I was able to find a solution on-line and turned the connectors around in about ten minutes.
Once I docked the Droid 4, a special webtop mode kicked in and basically took my regular phone desktop and expanded it to fill the new larger screen (Figure 2). What used to be the notification area at the top of the screen now filled the bottom of the screen like a panel, and mouse clicks acted like touchscreen taps. Many native apps took advantage of the larger space and resized as though I were using a tablet. What I realized then was that if I could figure out a way to get a real Linux environment on this device, I may be able to get close to the dream of that dockable computer I could take with me everywhere.
Figure 2. My Default Docked Desktop
Install Linux on Android
Although the laptop dock was interesting as it was, what I wanted was a real Linux environment. I knew that it was possible to install a Linux environment on Android by taking advantage of a chroot environment combined with VNC. While a chrooted environment was not as nice as native Linux, all I really needed to be happy was a Linux shell environment with all of my favorite command-line tools plus a browser. It turns out that a number of different apps make it easy to set up a Linux chroot environment (some that even inexplicably charge money just for the instructions), but I was able to find a free app called Complete Linux Installer in the Android Market to make the process relatively simple.
The Complete Linux Installer app is from the LinuxonAndroid Project at http://linuxonandroid.org, and it allows you to install a number of Linux distributions including Ubuntu, Debian and Backtrack. The first step is to root your phone, which can vary from phone to phone, so I won't go into that here [see Shawn Powers' article "Pwn Your Phone" in the October 2012 issue for more on that topic]. Then, launch the Complete Linux Installer app and follow the instructions, which involve installing the Terminal Emulator app, the BusyBox app and a VNC client. Once the required software is installed, you then select the distribution you want to install. In my case, I picked Ubuntu 12.04, and I could choose from a small console-only image, a medium-size image with LXDE or a full-size image with a Unity desktop. I went with the medium-size image, and once it downloaded, I was able to launch it from the app.
Linux ends up launching inside a terminal app, and on first boot, it asks
a couple basic questions for account setup and whether to
enable VNC and SSH at boot time. After that, you can use the terminal
like a standard Ubuntu distribution and
apt-get install any software
you want. If you want to access the desktop environment, just start
your VNC client and connect to localhost (Figure 3). Although there's some
lag accessing the desktop over VNC, and you have to deal with redrawing
windows, it's still usable. For my part though, because I mostly need the
desktop for a Web browser, I use the Ubuntu chroot for my console and
use a native Android browser for Web browsing. That way, I get a console
environment the way I want it with a browser that can play multimedia content.
Figure 3. A Customized Green and Black XFCE Desktop
What's nice about this arrangement is I get functionality a lot like a Netbook with a nice screen and an okay keyboard, but after a number of hours when I've used up the laptop dock's battery, I still can undock my now fully charged phone and go on my way. So far, I've tried this with a Droid 4 and a Razr, and both were able to dock and enter webtop mode just fine. Of course, any device with HDMI and USB (like the Raspberry Pi) should be able to use the webtop too, as long as you can track down the right adapters.
How to Make a Raspberry Pi Laptop: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6747
LinuxonAndroid Project Page: http://linuxonandroid.org
Kyle Rankin is a VP of engineering operations at Final, Inc., the author of a number of books including DevOps Troubleshooting and The Official Ubuntu Server Book, and is a columnist for Linux Journal. Follow him @kylerankin.
- The Tiny Internet Project, Part I
- Machine Learning with Python
- SUSECON 2016: Where Technology Reigns Supreme
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Free Today: September Issue of Linux Journal (Retail value: $5.99)
- Bitcoin on Amazon! Sort of...
- Android Browser Security--What You Haven't Been Told
- Securing the Programmer
- The Many Paths to a Solution
Pick up any e-commerce web or mobile app today, and you’ll be holding a mashup of interconnected applications and services from a variety of different providers. For instance, when you connect to Amazon’s e-commerce app, cookies, tags and pixels that are monitored by solutions like Exact Target, BazaarVoice, Bing, Shopzilla, Liveramp and Google Tag Manager track every action you take. You’re presented with special offers and coupons based on your viewing and buying patterns. If you find something you want for your birthday, a third party manages your wish list, which you can share through multiple social- media outlets or email to a friend. When you select something to buy, you find yourself presented with similar items as kind suggestions. And when you finally check out, you’re offered the ability to pay with promo codes, gifts cards, PayPal or a variety of credit cards.Get the Guide