Tux Education Our New Education Channel Please Share And Subscribe It...

How to Dual Boot Ubuntu on Your Android Device


Canonical has been developing Ubuntu for Devices for a while. Unfortunately, it hasn't exactly been easy to play around with it. However, if you've wanted to try it (and own a recent Nexus device), it's never been easier to dual boot.

Recently, Canonical announced an update to its Ubuntu Dual Boot app—which allows you to run Ubuntu and Android side by side—that makes it easier to update Ubuntu for Devices (the name for the phone and tablet version of Ubuntu) directly on your device itself. This means that not only can you try out Ubuntu without ruining your phone, but you can see all the sweet new changes as they happen without much fuss. Sounds like a win-win for tinkerers.

Disclaimers: Ubuntu for Devices is still in a Developer Preview right now. As such, it is probably not feature complete enough to be your daily driver. Hence why we're dual-booting. Naturally, you should expect some bumps in the road. Additionally, Ubuntu uses HTML5 for its apps, but many "apps" on the platform are actually just the regular mobile sites. Even some of the included ones (like Twitter). At the time of this writing, some "apps" prompt you to install an Android app when you first run them. Don't do this. Ubuntu is not built on Android and Android apps won't run on it. Attempting to install them—or even opening a link to the app—can break things.

What You'll Need

To get started installing Ubuntu Dual Boot (and subsequently Ubuntu itself), here's what you'll need:

  • A Nexus 4, Nexus 7 (2013), or Nexus 10: These three are currently the only officially and actively supported Android devices. If you don't have one of these phones or tablets, you can check out the list of unofficially supported devices in the user-ported section here. Our guide, however, will focus on these three. They must also be running Android 4.4.2, so if you haven't updated yet, now's a good time.
  • Root access: Before you install Ubuntu, you'll need to make sure your phone or tablet already has root. Fortunately, the three Nexuses we're looking at can all use the fastboot oem unlock method. If you're not rooted first, take care of that and come back.
  • An Ubuntu installation (Not a Live CD): In order to install Ubuntu Dual Boot, you'll need desktop Ubuntu installed on your computer. Unfortunately, the Live CD version won't allow you to install the necessary components. However, if you have around 25GB of free on a spare drive, you can install it relatively painlessly.
  • ADB: You're going to need ADB installed to set up dual boot (and to root your device, if you haven't yet). Fortunately, in most modern Linux distros, you can do so with a simple command. In Ubuntu, open up a terminal and enter the following:
                                                 sudo apt-get install android-tools-adb 
  • Around 2.7GB of free space on your device: Ubuntu for Devices is going to need about 2.7GB of space for the OS and related files. If you're low on space, clear some out before you begin.

Once you've got everything set up, you're ready for the main event.

How to Install Ubuntu Dual Boot


Canonical has created a (relatively) simple script to install the requisite dual boot app on your Android device. Once you've covered all your bases in the last section, fire up Ubuntu and perform the following:

Enable USB Debugging

First, you'll need to enable USB debugging on your phone or tablet, if it's not already. Here's how to do so:

  1. On your tablet, open the Settings app and select "About tablet."
  2. Tap "Build number" seven times to enable developer mode.
  3. Go back to the main Settings menu.
  4. Tap the newly-accessible Developer options.
  5. Enable USB debugging.
Once that's complete, connect your tablet to your computer with a micro USB cable.

Install the Ubuntu Dual Boot App

Next, download the Ubuntu Dual Boot installer script from here to your home directory. Then follow these instructions:

  1. Open a Terminal window (Ctrl+Alt+T).
  2. Run the following command to make the script executable: chmod +x dualboot.sh
  3. Execute the script by running this command: ./dualboot.sh

Note: In my tests with a Nexus 7 on a clean Ubuntu install, the script got caught in a loop attempting to execute a curl command (as seen below). If this happens to you, close the Terminal window, open a new one, and run the following command to install the package: sudo apt-get install curl   This will install the necessary component. Once that's done, run the dual boot installation script again.

Download and Install Ubuntu for Devices

The script will run automatically and reset your device several times. Once it's done, your phone or tablet should boot back up to the Android home screen. From there, open the new Ubuntu Dual Boot app from your app drawer. Then:
  1. Tap "Choose channel to install."
  2. Select a download channel (Canonical recommends "utopic").
  3. Tap "Grant" when asked for superuser access.
  4. Once Ubuntu is finished downloading and installing, tap Reboot to Ubuntu.
Congratulations! You now have Ubuntu running on your phone or tablet. Now you just need to access it.

How to Switch Between Android and Ubuntu


Unlike many other dual boot solutions, you don't choose which operating system you want at startup. Instead, once you've booted into Android, open the Ubuntu Dual Boot app and tap "Reboot to Ubuntu". Your device will then restart into Ubuntu. No matter which OS you're in, however, a hard reset will always boot to Android. This is usually performed by holding down the power button for about ten seconds. There's also a Dual Boot app in Ubuntu for switching back to Android if you prefer.
You can also update Ubuntu from either the Ubuntu Dual Boot app in Android, or from the system settings in Ubuntu. However, both methods require you to be in Android to actually install the update, so it's probably best to just boot into Android first when it's time to update anyway.


Advanced Linux Programming



Download Advanced Linux Programming

Do not use a download accelerator to download these files.
To view and print the book, you will need a Portable Document Format (PDF) viewer application, such as
Some web browsers have problems with inline PDF files. Try saving the file to your local filesystem before opening with a stand alone PDF viewer. If you still have problems viewing the file, make sure you have downloaded the entire file and the md5 checksum matches.
TitleFileFilesizemd5 checksum
The Entire Advanced Linux Programming Book in One Filepdf12733615e722dc5dfcde263ea06fa193e9f61b4
Front Matter and Table of Contentspdf1273361fe0c601b919879e93d79d25a78818b5c
Chapter 01 - Advanced Unix Programming with Linuxpdf2358355923f2a5d7fb4f941fe905fbe45be196
Chapter 02 - Writing Good GNU/Linux Softwarepdf28032644c823c1240c7f70a6dc9dbfddbe03fa
Chapter 03 - Processespdf24175887b5d98ba5b5933cf2ad1dbcf37641aa
Chapter 04 - Threadspdf29241911f392b44c073498e9ec9b3f718e54e7
Chapter 05 - Interprocess Communicationpdf2898530de9b56476a0e6e536fbac68e09b02d2
Chapter 06 - Mastering Linuxpdf268821ab8940fbcc40018d72bd2016e662afba
Chapter 07 - The /proc File Systempdf258582b3fe701f67a37ad7ba7233bcdc3f5d90
Chapter 08 - Linux System Callspdf261352583182dc09bc8b3c3773ba6d0fc710f2
Chapter 09 - Inline Assembly Codepdf204992c226e58fc7bf544df477d8ae96b680ed
Chapter 10 - Securitypdf288441fc340b97e9c7f3fc2f5fe4dd71132ffd
Chapter 11 - A Sample GNU/Linux Applicationpdf29821550a205644e441ae26d2041567d131b82
Appendix A - Other Development Toolspdf27237709a9a79a3c3abe6869df3f1ab5b39b14
Appendix B - Low Level I/Opdf2527553eaa0f0bbd103e1cc7872663e227a14b
Appendix C - Table of Signalspdf1778793b02a6abb38877580b743392b98c3290
Appendix D - Online Resourcespdf148074372964ff1eb4f85aca3985736a06cc48
Appendix E - Open Publication License Version 1.0pdf1765965b1ddb8d38b6a44b357345ba6c25010e
Appendix F - The GNU General Public Licensepdf228793e207c51489e6f3cfafba5b13bb5e3bd9
Indexpdf1253094004eefcfc2c6dca9a21233e748b81f35





Area & Volume

/* Find Area Of Equilateral Triangle */



// Compiler : Dev-C++ 4.9.9.2


#include<stdio.h>

#include<math.h>

int main()

{
    float a;
    float area;

    printf("Enter Size Of Side Of The Equilateral Triangle : ");

    scanf("%f",&a);

    area = sqrt(3)/4*(a*a);


    printf("\n\nArea Of Equilateral Triangle Is: %.3f",area);

    
    getch();
    return 0;
}

/* Find Area Of Rectangle */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    float l,w;
    float area;

    printf("Length : ");
    scanf("%f",&l);
    printf("\n\nWidth : ");
    scanf("%f",&w);

    area = l * w;
    printf("\n\n\nArea Of Rectangle : %.3f",area);
    
    getch();
    return 0;
}

/* Find Area Of Right Angled Triangle */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    float h,w;
    float area;

    printf("Height : ");
    scanf("%f",&h);
    printf("\n\nWidth : ");
    scanf("%f",&w);

    area = 0.5 * h * w;

    printf("\n\n\nArea of Right Angled Triangle Is: %.3f",area);
 
    getch();
    return 0;
}


/* Find Area Of Trapezium */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    float b1,b2,h;
    float area;

    printf("Base A : ");
    scanf("%f",&b1);
    printf("\n\nBase B : ");
    scanf("%f",&b2);
    printf("\n\nHeight : ");
    scanf("%f",&h);

    area = 0.5 * ( b1 + b2 ) * h ;

    printf("\n\n\nArea Of Trapezium Is: %.3f",area);
    
    getch();
    return 0;
}

/* Find Area Of Any Triangle */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>
#include<math.h>

int main()
{
    float a,b,c;
    float s,area;

    printf("Side A : ");
    scanf("%f",&a);
    printf("\n\nSide B : ");
    scanf("%f",&b);
    printf("\n\nSide C : ");
    scanf("%f",&c);

    s = (a+b+c)/2;
    area = sqrt(s*(s-a)*(s-b)*(s-c));

    printf("\n\n\nArea Of Triangle Is: %.3f",area);
    
    getch();
    return 0;
}

/* C Program To Find Out Surface Area & Volume Of A Cone */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>
#include<math.h>

int main()
{
    float r,h;
    float surface_area,volume;

    printf("Radius : ");
    scanf("%f",&r);
    printf("\n\nHeight : ");
    scanf("%f",&h);

    surface_area = M_PI * r * (r + sqrt(r*r + h*h));
    volume = (1.0/3) * M_PI * r * r * h;

    printf("\n\n\nSurface Area Of Cone Is: %.3f",surface_area);
    printf("\n\n\nVolume Of Cone Is : %.3f",volume);
    
    getch();
    return 0;
}

/* C Program To Find Out Surface Area & Volume Of A Cube */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    float a;
    float surface_area,volume;

    printf("Edge : ");
    scanf("%f",&a);

    surface_area = 6 * (a * a);
    volume = a * a * a;

    printf("\n\n\nSurface Area Of Cube Is: %.3f",surface_area);
    printf("\n\n\nVolume Of Cube Is : %.3f",volume);
    
    getch();
    return 0;
}


/* C Program To Find Out Surface Area & Volume Of A Cuboid */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    float w,l,h;
    float surface_area,volume,space_diagonal;

    printf("Width : ");
    scanf("%f",&w);
    printf("\n\nLength : ");
    scanf("%f",&l);
    printf("\n\nHeight : ");
    scanf("%f",&h);

    surface_area = 2*(w*l + l*h + h*w);
    volume = w * l * h;
    space_diagonal = sqrt(w*w + l*l + h*h);

    printf("\n\n\nSurface Area Of Cuboids Is : %.3f",surface_area);
    printf("\n\n\nVolume Of Cuboids Is : %.3f",volume);
    printf("\n\n\nSpace Diagonal Of Cuboids Is : %.3f",space_diagonal);
    
    getch();
    return 0;
}

/* C Program To Find Out Surface Area & Volume Of A Cylinder */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>
#include<math.h>

int main()
{
    float r,h;
    float surface_area,volume;

    printf("Radius : ");
    scanf("%f",&r);
    printf("\n\nHeight : ");
    scanf("%f",&h);

    surface_area = 2 * M_PI * r * (r + h);
    volume = M_PI * r * r * h;

    printf("\n\n\nSurface Area Of Cylinder Is: %.3f",surface_area);
    printf("\n\n\nVolume Of Cylinder Is : %.3f",volume);
    
    getch();
    return 0;
}

/* Find Area Of Circle */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>
#define PI 3.141

int main()
{
    float r, a;
    printf("Radius: ");
    scanf("%f", &r);
    a = PI * r * r;
    printf("%f\n", a);
    
    getch();
    return 0;
}

/* C Program To Find Out Surface Area & Volume Of A Sphere */



// Compiler : Dev-C++ 4.9.9.2


#include<stdio.h>
#include<math.h>

int main()
{
    float r;
    float surface_area,volume;

    printf("Radius : ");
    scanf("%f",&r);

    surface_area =  4* M_PI * r * r;
    volume = (4.0/3) * M_PI * r * r * r;

    printf("\n\n\nSurface Area Of Sphere Is : %.3f",surface_area);
    printf("\n\n\nVolume Of Sphere Is : %.3f",volume);
    
    getch();
    return 0;
}

Frequently Asked C Programs

/* HCF (Highest Common Factor) Program With Two Numbers */


// Compiler : Dev C++4.9.9.2

#include<stdio.h>

int main()
{
    int a,b;
    printf("A : ");
    scanf("%d",&a);
    
    printf("\n\nB : ");
    scanf("%d",&b);
    
    while(a!=b)
    if(a>=b-1)
    a-=b;
    else
    b-=a;
    
    printf("\n\nH C F : %d",a);
    
    getch();    
    return 0;
}

/* HCF Program With Multiple Numbers In C */


// Compiler : Dev C++4.9.9.2

#include<stdio.h>

int main()
{
    int x,y=-1;
    printf("\n\nTo Exit Insert Zero...\n\n\nInsert Numbers : ");
    while(1)
    {
            scanf("%d",&x);
            
            if(x<1)
            break;
            else if(y==-1)
            y=x;
            else if(x<y)
            y=gcd(x,y);
            else
            y=gcd(y,x);
    }
    
    printf("\n\nHCF : %d",y);
    
    getch();
    return 0;
}

int gcd(int x, int y)
{
    int i;
    for(i=x; i>=1; i--)
    if(x%i==0 && y%i==0)
    break;
    
    return i;
}

/* LCM Program In C With Multiple Numbers */


// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int lcm(int, int);

int main()
{
    int a,b=1;
    
    printf("\t\t\tNumbers Should Be Positive...\n\n\t\t\tTo Quit Press Zero...\n\n\nEnter Numbers : ");
    
    while(1)
    {
            scanf("%d",&a);
            
            if(a<1)
            break;
            else if(a>b)
            b=lcm(a,b);
            else
            b=lcm(b,a);
    }
    
    printf("LCM : %d",b);
    
    getch();
    return 0;
}

int lcm(int a, int b)
{
    int temp=a;
    
    while(1)
    {
            if(temp%b == 0 && temp%a == 0)
            break;
            
            temp++;
    }
    
    return temp;
}

/* Program To Find Multiplication Table */


// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    int r,i,j,k;
    
    printf("Range : ");
    scanf("%d",&r);
    
    for(i=1; i<=r; i++)
    {
             for(j=1; j<=10; j++)
             printf("\n%d * %d = %d",i,j,i*j);
             
             printf("\n\n");
    }
    
    getch();
    return 0;
}

/* LCM Program In C With Two Numbers (Other Logic) */


// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int lcm(int, int);

int main()
{
    int a,b,l;
    
    printf("\t\t\tNumbers Should Be Positive...\n\nA : ");
    scanf("%d",&a);
    printf("B : ");
    scanf("%d",&b);
    
    if(a>b)
    l=lcm(a,b);
    else
    l=lcm(b,a);
    
    printf("LCM : %d",l);
    
    getch();
    return 0;
}

int lcm(int a, int b)
{
    int temp=a;
    
    while(1)
    {
            if(temp%b == 0 && temp%a == 0)
            break;
            
            temp++;
    }
    
    return temp;
}