How I can run ubuntu in chroot on Android?

You can't really run upstart itself in a chroot. For it to work, you'd need something like an LXC container. Unfortunately most Android kernels don't have the required options to allow LXC to work.

Without LXC, the way of getting a chroot on your phone is to run:

  • sudo debootstrap --foreign --arch=armhf precise precise
  • then copy precise/ to your phone
  • then on your phone (as root): chroot precise debootstrap/debootstrap --second-stage

That will give you a standard Ubuntu chroot on your phone, that you can then chroot into with "chroot precise /bin/bash".

You'll then need to mount /proc and /sys for it to be somewhat usable.

Should you be lucky enough to have a phone where the kernel and userspace works with LXC and can get it manually installed on your phone, the following should work:

  • lxc-create -t ubuntu -n my-container -- -r precise -a armhf
  • lxc-start -n my-container

This will create an Ubuntu 12.04 armhf container and start it, you'll then get the usual login prompt (login/password is ubuntu/ubuntu by default).