Install Debian on Android
I always wanted to have a full Linux on my phone, not just a half-baked one such as Android. Then I saw Lil’ Debi, the Debian installer app for Android.
I decided to give it a try to see how it works. You can grab the pre-built apk file here, or grab the source codes here and build it yourself. I did the later.
First of all, this app does not really install Debian on your mobile device and replace your Android. It will download the different packages, create a Debian disk image, and when you start it up, it will change root and mount the disk image, and then present you a window to run commands as root. So what you have here is a parallel environment.
After installing it on your device, the first first you would see is:
The screen shows that Debian has not been installed yet. This is just a bootstrapping app, and not a full Linux OS. You have to tell it to install Debian.
Depending on how much space you have on you SD card, you can change the disk space to be allocated to the Debian disk image. I allocated 1000MB. Then press on Install button.
The app will now create a container for the disk image, as shown in the following screen:
Depending on how large a space you allocated, this step would take a few minutes to finish.
After creating the container file, it will create the file systems for the virtual disk:
Now it’s going to download the software packages from the net:
This step will also take a while, depending on the bandwidth and latency of your network. You might want to have your device connected to a power source, just in case it runs out of juice in the middle. When everything is done, you would see the following page:
And you are left with the question: now what?
Well, that’s it. Debian is installed, and you have all the commands to work it. You are presented with a small input window to enter the command you want to execute. The middle section is just a scrolling output console. When you run a command, the output will be shown here. Here is the output for listing directories:
You can also install other software packages the Debian way, with aptitude. You can even start up SSH server with the command:
service ssh start
And stop the SSH server with:
service ssh stop
Ok, now that you can run the commands, but how useful is this? Not very. Why? Because this is not an interactive terminal console, that means you won’t be able to interact on the command line. The input box takes your command, send to Android VM to be executed in a separate thread, then pipe the output to the output console above.
It would have been so much more useful if this is a real terminal emulator. Anyway, you got the idea. Therefore, to fully use it, you have to install a terminal emulator, such as the Android Terminal Emulator.
If you have a terminal emulator, start it up, and run
su
first to get a root shell. Then run
/data/data/info.guardianproject.lildebi/app_bin/debian
to setup Debian chroot. Now you are good to go, it’s as if you have a Linux computer in your pocket. There are certain limitations, of course, e.g. you won’t be able to get any information from /proc. But besides that, it is as good as you can get.
The installation went smoothly, and it’s quite intuitive. However, as good as it is, you still feel like it’s not a full Linux environment, not because you can’t run GUI applications, but because of the limitations of the packaging and layout. To have a more complete layout, you have to manually bind mount a few mount points, so that you can access from the chroot Linux environment, including /proc, /mnt/sdcard, etc.
To stop the app, press on the Stop Debian button. It will umount everything, leaving you with the disk image file:
/mnt/sdcard/debian.img
Note that before stopping it, you need to shutdown any service that is running, otherwise, it has trouble unmounting the disk.
That’s it. Have fun. There are other Linux installers out there, I’m going to try out more and report them here.






Thanks for the article! We didn’t know about Ubuntu Installer for Android or Linux Installer when I wrote Lil’ Debi. Its interesting to see the different approaches, hopefully we can work together to have all of the features in one chroot installer and manager.
Our plan for Lil’ Debi is to make it more trustworthy. Right now, it does not verify the packages it downloads in the full Debian way. We have gpgv working for Android, so we just need to integrate it to get proper Debian package verification going. Also, we want to figure out a way to make sure that the system image file on the SD Card cannot be tampered with. Disk encryption is one option.
And I just want to reiterate, Lil’ Debi is alpha software, don’t rely on it for things that need real security.
@Hans-Christoph,
Thanks for the comments. I know it’s alpha, but I had fun with it for a few days, installing all kinds of packages, including gcc/g++, emacs, vim, etc. It was fun, despite all the little issues.
And I also browsed thru the source codes (thanks for releasing it). The Guardian Project has done a lot of great things.
I’ll see if I can help with it a bit
the command “/data/data/info.guardianproject.lildebi/app_bin/debian” DID NOT WORK
Hello There. I found your blog using msn. This is
a really well written article. I’ll be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I will definitely comeback.