Ubuntu Dual Boot Installer is provided as a tech preview for developers who want to run Ubuntu and Android on a single device. It is not intended to be used by regular users, neither at this point nor as its ultimate goal. Those developers installing it should be familiar with the Ubuntu and Android partition layouts and should also feel at home with manually flashing partitions in case something goes wrong.

Ubuntu Dual Boot Installer was born as an internal skunkworks project some Canonical Engineers dedicated a limited amount of their time to. Seeing the good progress, it was decided to release this preview for the developer community to test, study and contribute to.

Dual boot is not part of the regular Ubuntu release.

What to expect after installation

Requirements

To install dual-boot, you'll need:

Include: Nothing found for "StartDeviceSetup"!

Include: Nothing found for "EndDeviceSetup"!

Dual boot installation or upgrade instructions

The procedure at this point is effectively the same for both new installations and upgrades of an existing dual boot installation.

Installing the Ubuntu Installer app in Android

Ubuntu Note: if you had installed a previous version of Ubuntu dual boot, please make sure to uninstall Ubuntu from the Android app before upgrading to the new Ubuntu dual boot. You can keep the user data, only uninstallation of the base system is recommended.

  1. On your computer, download the dual boot installation script into your home directory from: http://humpolec.ubuntu.com/latest/dualboot.sh

  2. Open a terminal on your computer pressing the Ctrl+Alt+T key combination
  3. Make the installation script executable by running this command:

    chmod +x dualboot.sh
  4. Ensure that your device:
    • has booted normally into the Android user interface
    • has USB debugging enabled
    • has an unlocked bootloader
  5. Connect your device via USB to your computer
  6. Install dual-boot by running this command on a terminal:

    ./dualboot.sh

After installation, the phone will reboot several times. Once finished, it will boot into Android and you will find the dual boot app as “Ubuntu Dual Boot” in the Apps section.

Optionally, for alternative ways of using the installer script, check out the installer reference >.

Now follow the instructions below to install Ubuntu from Android.

Installing Ubuntu from Android

Note: 2.7GB of free memory space is required on your device for the Ubuntu installation.

  1. Optionally, on your desktop, and while your device is still connected via USB, issue the following command on the terminal to free up space (say "Yes" if you are asked to grant permissions on the device):

    adb shell "su sh rm -rf /cache/*"
  2. On the device, press the apps button in Android to bring up the list of apps
  3. Browse the apps to find the Ubuntu Dual Boot icon and press it to start the app

  4. When the app launches, press on Choose channel to install and choose a channel to download from (the recommended channel is utopic). Make sure you tick on the "bootstrap" option.

  5. Once download is completed you need to Grant SU permissions to the application for the install to be successful. Press the Grant button, when prompted.

  6. Press the Reboot to Ubuntu button to boot to Ubuntu.

  7. A standard phone reboot with the hard key will always boot to Android.

Notes:

Additional notes

Updating to a new Ubuntu image

The rule of thumb for dual boot is:

This effectively means there are two possible ways to upgrade your Ubuntu image:

To update Ubuntu to a newer version, On the android Ubuntu dual boot application, Once Ubuntu has been uninstalled, follow the same installation step to download a newer version of Ubuntu.

Dual boot installer command reference

For the majority of cases, running the installer script in auto mode with no arguments will suffice. For more advanced usage, additional commands can be used.

dualboot.sh

dualboot.sh full

dualboot.sh update

dualboot.sh channel $CHANNEL

{{{dualboot.sh push ubuntu.tar.xz device.tar.xz version.tar.xz

The script also takes a device ID in case there are more devices connected to the computer. The device ID is the first parameter passed to the script. If it is not provided first connected device is used. E.g.

dualboot.sh <device-id> channel devel-customized

Using a custom image server

If you need to use a custom image server that provides ported images for those devices outside of the officially supported, you can use a custom image server with the Dualboot app. To do so, open a terminal, and with your device connected over USB, issue the following command (replacing $CUSTOM_SERVER_URL with the URL or your custom server):

adb shell "su sh 'cd /data/data/com.canonical.ubuntu.installer/files/ && echo $CUSTOM_SERVER_URL > custom_server &&  chmod 777 custom_server'"

The next time you start the Dualboot app on Android, it will use that server to fetch and install images instead of the official Ubuntu one.

If something goes wrong

If something goes wrong after the dual boot installation and you cannot boot either into Ubuntu or Android, you can revert the Android installation to the status it was before dual boot by reflashing the original boot and recovery images. Only the recovery partition is actually modified by dual boot, but you can choose to reflash the boot partition just in case.

  1. Download the Android firmware you are running on your device onto your PC.
  2. Open a terminal with Ctrl+Alt+T
  3. Extract the firmware tarball and cd to its directory.
  4. Run the following command to reboot into the bootloader

    adb reboot bootloader
  5. Once in the bootloader, run this command to reflash the boot partition:

    fastboot flash boot boot.img
  6. Without exiting the bootloader, run this command to reflash the recovery partition:

    fastboot flash recovery recovery.img
  7. After flashing, reboot and your phone should start into Android:

        fastboot reboot

Contributing

The dual boot project, as with the rest of Ubuntu is open source and open for participation, you can help making it better too!

FAQ

How does dual boot work?

An Android-based phone has multiple partitions which serve different purposes. Those relevant for dual booting are /boot, /recovery, /system and /data.

Ubuntu uses partitions in a slightly different way:

In order to enable the user to choose their own flavour of Android, the Android boot image cannot be modified, as the original kernel needs to be preserved. Thus the recovery partition is used to boot into Ubuntu.

Which versions of Android does dual-boot work with?

Which devices does dual-boot work for?

Dual boot has been tested to work with the following devices:

Which Ubuntu releases does dual-boot support?

Dual boot supports the same channels that phablet-flash supports.

How is the user data partition shared between Android and Ubuntu?

The user data partition hosts also the Ubuntu system image at /data/system.img which is around 2 GB.

The Ubuntu swap file is also present in the data partition at /data/SWAP.img (around (540 MB)

The Ubuntu user and system data are also present at:

The Android data partition usage is unchanged.

Is booting into recovery no longer possible when dual-booting?

The recovery partition when dual booting is currently used by the Ubuntu boot image. This means that when booting into recovery mode, Ubuntu will boot.

Access of the recovery will be resolved in future releases. However when the Ubuntu image is uninstalled, the original (Android stock or CWM) recovery is restored by the Ubuntu Install android app.

How can I do an Android upgrade with dual boot installed?

If there is an Android system upgrade available (e.g. from Android 4.4.2 to 4.4.3), extra steps should be taken to ensure it works correctly and that dual boot is functional after the upgrade.

  1. Use the "Prepare for Android update" option in the Dual boot app menu on Android. This will recover your original Android recovery partition, ready for the Android upgrade. User data and the previous Ubuntu installation will be preserved.
  2. Do the Android update
  3. Download and re-run the dualboot.sh script to ensure the SuperSU app is reinstalled (as Android upgrades tend to remove it) and thus the Ubuntu Dual Boot app can be executed. Make sure to run dualboot.sh full to make sure SuperSU is installed
  4. To reboot to your previous Ubuntu installation, go to the Ubuntu Dual Boot app as usual.

Note: if you simply want to restore your original recovery partition on Android, you can always uninstall the Ubuntu installation from within the Dual Boot app. While you are doing this, you can also choose to remove its user data.

Can I uninstall dual boot?

Yes, when Ubuntu is uninstalled from the Android side via the dual boot app, the original Android recovery partition is restored to the original state before dual boot was installed.

Uninstalling Ubuntu also deletes the Ubuntu system image and swap file. Optionally, also the Ubuntu user data can be deleted.

The dual boot app installs a copy of the the SuperUser app. Can I use another SuperUser app instead?

Yes indeed! The supplied SuperUser app is only for those who don't have it installed yet.

However, one word of caution: tests were only performed only with the SuperUser app version from the CyanogenMod build and with the one installed by dualboot.sh script. But as long as you own SuperUser app behaves in similar way of those two tested, you should be fine.

When installing Ubuntu, can I switch channels without deleting user data?

Yes you can, but this is something that hasn't been thoroughly tested. Therefore some applications might not function properly. The same applies for switching between different versions.

Can I make boot to Ubuntu the default and move the Android boot to the recovery partition?

Right now swapping the default boot OS is not possible. However, this is something we might look to support if there is demand for it.

Why do you use the recovery partition to boot Ubuntu, rather than a combined boot image for Android and Ubuntu?

One of the initial principles when designing dual boot was not to tie it to a particular Android flavour and version and leave the user the flexibility to use their own choice. Thus the Android boot image and the kernel it contains are left untouched.

The choice was then to reuse the recovery partition, and instead focus on restoring it back to its original state if it's necessary to go back to single boot with Android.

I already have CWM recovery installed and know how to use it, can I use a zip file and flash manually instead?

Absolutely, we provide dualboot.sh to make it easy to install the apps and the custom recovery. If you prefer to install the recovery manually yourself, it's also possible. Check out the source code for the dualboot.sh script to see exactly what it's doing.

Why does the Ubuntu Installer app need to be installed to the system partition via recovery?

The Ubuntu Installer app needs to be installed as an Android (preinstalled) system app. Unlike use-installed apps, which live in the data partition, system apps always live in system partition and are granted additional privileges on top of the standard permissions set available to 3rd party applications.

The extra permissions that the Ubuntu installer app needs are just two: cache partition write access to store the downloaded files for Ubuntu installation and power management capability to reboot the system.

Touch/DualBootInstallation (last edited 2014-07-03 13:48:50 by 84)