Ubuntu Linux on Nexus 7: First Look

Linux on Nexus 7

My OTG (“On the Go”) cable arrived after three weeks of languishing in the postal service so I finally had what I needed to plug a USB keyboard into the Nexus 7. The procedure looked fairly safe, and I was willing to gamble. I say gamble, because I’m not a serious hacker and if the instructions were to deep-six my system, I’d be screwed. But I figured there’d be some way to restore it, so, to pursue my abiding interest in things Linux, I took the plunge.

Unlocking the Nexus

The first step was completely new to me: Unlocking the Nexus 7. I’m guessing this is the equivalent of jailbreaking an iThing, but more up front. In fact, Google makes it easy to do. You simply power off the device, then power it back on while holding down the power button and the volume down button. What you get onscreen is cute little Android figure with the hood to its insides open and a big Start button on the top. If you press Start the unit boots back up normally. But when attached to another computer, the ROM can be flashed via the USB port. This state is called “fastboot mode.”

Courtesy: https://wiki.ubuntu.com/Nexus7/Installation?action=AttachFile&do=get&target=bootloader.pngNexus bootloader mode

I used my Ubuntu Linux 12.04 laptop (Dell Inspiron 1520) to do the procedure, but I understand it can also be done from Windows or OS X. I had already installed ubuntu-nexus7-installer and was ready for the next step:

$ sudo fastboot oem unlock

I then followed the directions on the Nexus “Unlock Bootloader?” screen, restarted the unit, and it came back up, still in Android mode, but unlocked.

The next step was so easy it was liking riding in a robotic car. I returned the Nexus 7 to fastboot mode, located the graphical Ubuntu Nexus 7 installer program on my laptop, clicked on it, and waited for it to finish.

Courtesy: https://wiki.ubuntu.com/Nexus7/Installation?action=AttachFile&do=get&target=dash3.png
Ubuntu LInux Nexus 7 Installer

Test Drive

When the installer finished, I was looking at Ubuntu’s Unity graphical interface and a virtual keyboard. At this point I should say that I wasn’t expecting it to be a finished product. In fact it’s a long way from alpha, much less beta. But I wanted to see how far the team had come in getting Linux onto a tablet, which is a remarkable feat. While Microsoft is spending millions getting full Windows 8 onto a tablet, here is a team of people on the Internet building the equivalent on their own dime, simply for the good of the community. These people have my profound respect, as well as thanks.

So, performance was about what I expected. I’d touch an icon, say for Gedit, a text editor, and there would be a several-seconds wait before it appeared. I touched the Terminal program icon and it, too, appeared in a few seconds. Not instantly as in Android or iOS. I typed a few commands in the terminal using the virtual keyboard, cd’ing around the sytems and ls’ing the directories to see what was around. The virtual keyboard got old fast. Because it’s such a full keyboard, without numeric and special symbols modes like an Android or iOS virtual keyboard, everything has to be on Ubuntu’s virtual keyboard. That makes for very tiny keys and circumspect typing.

Next I hooked up an external USB keyboard. I touched the text editor, exited the virtual keyboard, and tried typing. Worked like a charm! I typed at full speed and didn’t detect any lag onscreen. I tried it in the Terminal window too, and it was great. However, the pesky virtual keyboard kept popping up whenever I touched the screen. It got to be highly annoying. It would be a good idea if the virtual keyboard could be suppressed if the system detects an external keyboard.

Installing Linux on Nexus 7

Still amazed at how far the team had come, I looked for, and found, a Screen Capture program. It’s what I used to capture the image at the top of this blog posting. It too worked a treat, but I wondered how I could get the captured image out of the, I guess I can’t call it the Lexus 7, so I’ll say the Ubunexus 7. (Doesn’t have the same ring, does it?)

I removed the USB keyboard and attached an SD card reader with SD card inside. The folder viewing app detected it right away so I thought I’d just do a copy and paste using the app. Unfortunately, every time I started to get somewhere with it, the app would cause the system to freeze and I’d have to reboot. To reboot when you don’t have any control of the system, just push the power button on the Nexus 7 and the reboot/shutdown options appear. After a few rounds of this I gave up and went to the terminal window where I typed something like (I forgot to write down the exact command):

$ cp screenshot01.png /mnt/ubuntu/SDCARD01

What a delightful sight it was to see the green light blip on the card reader. If that hadn’t worked, I’d have tried rsync or something, but I had what I needed.

Aside: This simple copy to the SD card impressed me to no end because in Android 4.2 I CANNOT get the OS to see any card or memory stick I attach. All the tips I’ve seen on the Net simply say, attach with an OTG cable. Done that, been there, tried two different readers and two different cables. No joy. Yet Ubuntu Linux mounts it intelligently. Piece of cake.

Back to Android 4.2

Bottom line: I’m impressed with how far the team has come with the touchscreen interface, and the port to the ARM processor. Much work still needs to be done. For instance, you can’t yet use finger gestures to enlarge the screen, something that will make using the tiny icons and fonts more tolerable for pudgy fingers. And there will be, I’m sure, many bugs to be fixed. Great work!

As nice as it was to visit, however, it’s still under construction, not ready for occupancy. Eventually I’ll move in, but for now it was back to Android. The installation procedures also give instructions for downloading the current install image for Android 4.2. Once it’s fetched, gunzipped, and untar’d, you put the Nexus back in fastboot mode and type (depending on the image version)

$ cd nakasi-jro03d/
$ sudo ./flash-all.sh

At this point the Nexus 7 is returned to Android. All your customized settings are lost, of course, but if you’ve been autobacking your system to Google (recommended), Google restores all the apps you’ve loaded. You need to retweak the interface to your taste.

And if you wish to relock the OS, there’s one final step. Return the Nexus 7 to fastboot mode and type

$ sudo fastboot oem lock

I’ll leave mine unlocked so I can try out the distribution again when it reaches another plateau, without fussing with the Nexus lock. I’ll admit I’m looking forward to the next trial. This is great stuff. Cheers to the development team and all the testers!