Ubuntu dual boot android

Содержание
  1. How To Dual-Boot Android-x86 And Ubuntu (With GRUB 2)
  2. How to dual-boot Android-X86 and Ubuntu
  3. How to install Android-x86 from Ubuntu? | Dual-boot
  4. Introduction:
  5. Pre-cautions:
  6. Requirements:
  7. Creating a bootable drive:
  8. Creating partition for Android-x86:
  9. Installing Android-x86 from bootable drive:
  10. Adding GRUB menu entry:
  11. Using GRUB bootloader:
  12. Ubuntu Wiki
  13. DualBootInstallation
  14. What to expect after installation
  15. Requirements
  16. Dual boot installation or upgrade instructions
  17. Installing the Ubuntu Installer app in Android
  18. Installing Ubuntu from Android
  19. Additional notes
  20. Updating to a new Ubuntu image
  21. Dual boot installer command reference
  22. Using a custom image server
  23. If something goes wrong
  24. Contributing
  25. How does dual boot work?
  26. Which versions of Android does dual-boot work with?
  27. Which devices does dual-boot work for?
  28. Which Ubuntu releases does dual-boot support?
  29. How is the user data partition shared between Android and Ubuntu?
  30. Is booting into recovery no longer possible when dual-booting?
  31. How can I do an Android upgrade with dual boot installed?
  32. Can I uninstall dual boot?
  33. The dual boot app installs a copy of the the SuperUser app. Can I use another SuperUser app instead?
  34. When installing Ubuntu, can I switch channels without deleting user data?
  35. Can I make boot to Ubuntu the default and move the Android boot to the recovery partition?
  36. Why do you use the recovery partition to boot Ubuntu, rather than a combined boot image for Android and Ubuntu?
  37. I already have CWM recovery installed and know how to use it, can I use a zip file and flash manually instead?
  38. Why does the Ubuntu Installer app need to be installed to the system partition via recovery?

How To Dual-Boot Android-x86 And Ubuntu (With GRUB 2)

Author : Andrew | Posted: March 05, 2012

Notes:

  • All Android-x86 supported filesystems should work (ext2, ext3, fat32 and ntfs)
  • It may work with other Linux distributions that use GRUB 2, but I’ve only tested it with Ubuntu. Some parts of the instructions below may be different for other Linux distributions. Also, the Android-X86 version used in my test was 4.0 Ice Cream Sandwich RC1.

Firstly, here’s a video with all the required steps to dual-boot Android-x86 4.0 and Ubuntu:


(direct video link)

How to dual-boot Android-X86 and Ubuntu

And at the bottom of the file, add this:

There are some changes you’ll need to make to the above menu entry (code above):

  • If you didn’t create an sdcard image, remove the «SDCARD=/data/sdcard.img» part from the 3rd line (make sure you don’t remove anything else!)
  • The above menu entry uses «eeepc» for androidboot.hardware, but you can replace it with your hardware, depending on the ISO you’ve downloaded (use «asus_laptop» for the ASUS Laptop ISO, etc.) or use «generic_x86».
  • If you haven’t installed Android-x86 4.0 RC1 but some other version, replace the lines containing «android-4.0-RC1» with your version.
  • For Android-x86 versions older than 4.0, use «androidboot_hardware» instead of «androidboot.hardware»

Once you make these changes, save the file.

2. Now let’s make the file executable and update GRUB 2:

Источник

How to install Android-x86 from Ubuntu? | Dual-boot

Introduction:

In this blog post, you will get an idea about how to install Android-x86 on your Linux computer. Android-x86 is an android project which allows you to experience Android right on your computer. And the best thing is that you can install it alongside with other operating systems. This is called dual-booting as you can use two OS installed on the same computer. Android-x86 can be installed from a Windows computer or a Linux computer. But this article will focus on installation process from a Linux (Ubuntu) system using Grub2 bootloader.

Pre-cautions:

  • Dual-booting is sometimes tricky and you may end up with a dead computer and all your data lost. Although, this will not happen if you have a bit of early knowledge or follow this article step by step.
  • It good to backup your important data to an external hard drive, USB device or cloud storage before proceeding.

Requirements:

  • Android-x86 image file (ISO). To download go to the official site. Select one of the two mirror file hosting sites. I would suggest to choose from Download from Fosshub. Now, download the appropriate Android-x86 ISO file according to your system architecture.
  • A bootable flash drive (atleast 2GB).

Creating a bootable drive:

We will be using pre-installed Startup Disk Creator to create a bootable Android-x86 drive. In case, you don’t have it installed, type the following command in Terminal to install it: (type you admininstrator password)

I have prebuilt, so it says its the newest version.

  1. Open Startup Disk Creator.
  2. Select the ISO image file you downloaded, browse it from Other… button.
  3. Insert you flash drive. And the flash drive should display in Disk to use section.
  1. Select the flash you want, and choose Make Startup Disk. Select Yes.

Startup Disk Creator

Creating partition for Android-x86:

You can install Android-x86 on your same Linux partition, but preferably one should create a partition for another operating system.

To create partitions, we will use an pre-installed Ubuntu application named GParted. If not installed in your system, type the following command in Terminal:

Now, open GParted. And then, to create a new partition, right click on the required partition and select Resize/Move, then enter the amount of space you want (about 16GB will be good). Type 16384 in New Size(MiB). Then select the green right tick to apply all changes.

As you can see, I have 3 partitions, /dev/sda1 has Linux installed on it. And other two have almost not data in it. So, I just named the /dev/sda3 as Android-x86 without creating partition. You can just create a 16GB partition and that’s it.

Installing Android-x86 from bootable drive:

Now, shut-down your computer. And, then switch the power button. After that you have to open Boot-Menu by pressing suitable key combination.

  1. Now, insert the flash drive. And select it from the boot menu, using Up and Down Arrow keys, then by pressing Enter.
  2. Your, Android-x86 setup should open up. Select Install Android-x86 to harddisk from the menu.
Читайте также:  Mercedes gl x164 android

  • Choose the 16GB partition you have created from the menu.

Choose ‘Do not re-format’ to keep existing data. Otherwise, choose a filesystem type to format the data in your partition.

Then, you will be asked to install GRUB bootloader. Select Yes.

Then the installer will ask if you want to install /system directory as read-write. If you want to modify the system for some purposes (e.g., debugging), select Yes. Now, the installation process will begin.

Now, once completed, select Reboot. As we have to manually add GRUB menu entry at startup for the installed Android-x86.

If after reboot, GRUB menu appears, select the first option Ubuntu from it.

Adding GRUB menu entry:

Now, after rebooting to your Ubuntu system. Open Terminal.

After that Gedit Editor open, type the following to add a menuentry:

The file should look like somewhat like the image below:

Now, before continuing you have to change (hd0,3) with that of yours. It represents /dev/sda3. Open GParted and see what is the partition where Android-x86 is installed. If you have /dev/sda6 then change (hd0,3) to (hd0,6).

Change android-9.0-r2 with the name of the version you have downloaded. Open Files, then Other Locations and the the partition where Android-x86 is installed. And then copy the name as found there and replace in the file with the name.

Now, type the following commad to apply all changes and update bootmenu entry:

Now, you have successfully created a bootmenu entry.

Using GRUB bootloader:

Now reboot your computer and then press Left Shift to display GRUB bootloader. And at last you will find the menu entry you have created, select it and you will successfully boot into Android-x86. Now everytime you boot your computer just hold down Shift key and select Android-x86 to open it.

Источник

Ubuntu Wiki

DualBootInstallation

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

  • A single device with the ability to switch between fully functional Android and Ubuntu images
  • On Android: an Ubuntu Installer app to install Ubuntu, as well as to boot into Ubuntu

On Android: the Super User app to grant permissions to the Ubuntu Installer app

  • On Ubuntu: an Ubuntu Dual Boot app to boot into Android
  • Ubuntu system updates are not yet supported from the Ubuntu side, but they can be done via the Android app
  • Requirements

    To install dual-boot, you’ll need:

    A Nexus 4 device (other supported Nexus devices should in theory work but have not been tested at the time)

    Android 4.4.2 or higher running on the device, either stock firmware or based on Cyanogen Mod or AOSP.

    2.7GB of free storage on the device to install Ubuntu

    ADB tools running on your desktop computer

    The device needs its bootloader to be unlocked and USB debugging enabled. Follow steps 1 to 3 below to do this, or alternatively, if your device is already unlocked and has USB debugging enabled, you can skip to the installation process >

    Include: Ничего не найдено по регулярному выражению «StartDeviceSetup».

    Include: Ничего не найдено по регулярному выражению «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

    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.

    On your computer, download the dual boot installation script into your home directory from: http://humpolec.ubuntu.com/latest/dualboot.sh
    Open a terminal on your computer pressing the Ctrl+Alt+T key combination

    Make the installation script executable by running this command:

  • Ensure that your device:
    • has booted normally into the Android user interface
    • has USB debugging enabled
    • has an unlocked bootloader
  • Connect your device via USB to your computer

    Install dual-boot by running this command on a terminal:

    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.

    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):
    On the device, press the apps button in Android to bring up the list of apps

    Browse the apps to find the Ubuntu Dual Boot icon and press it to start the app

    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.

    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.

    Press the Reboot to Ubuntu button to boot to Ubuntu.

  • A standard phone reboot with the hard key will always boot to Android.
  • All channels supported by the phablet-flash tool are also supported by the Ubuntu Installer on Android

    When selecting an Ubuntu channel, the bootstrap checkbox lets you wipe user data from Ubuntu, otherwise it is kept between installations. Since you’re installing for the first time now, it won’t make a difference

    When selecting an Ubuntu channel, unticking the latest version checkbox will let you select a particular image number. Otherwise, if checked it will default to the latest image.

    If during installation the Ubuntu download finished while the phone was locked or when the Ubuntu Installer app was not on the foreground, the installation button will change to Resume install. This will resume installation to the point where Super User permissions are requested.

    Additional notes

    Updating to a new Ubuntu image

    The rule of thumb for dual boot is:

    • Installation of a new Ubuntu version needs to be done from the Android side via the Dualboot app
    • Download of a new Ubuntu version can happen on either the Ubuntu or Android side

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

    If you are running Android, use the Dualboot app to check and install new versions of Ubuntu by selecting «Uninstall Ubuntu» from the menu options. Next you will be asked if you want to keep the user data from Ubuntu. If you do want to keep the data, contacts, installed applications, pictures, background settings and such will be kept across Ubuntu installations. Additionally, every time there is a new Ubuntu version available, you’ll get an Android notification:

    • For stable channels, the app polls for new versions every 2 days
    • For proposed channels, the app polls for new versions every 10 hours

    If you are running Ubuntu, use the standard upgrade mechanism to download new images via System Settings, but do not choose to install the image after having downloaded it. Instead, once the dowload has finished, reboot to Android and the Dualboot app there will resume the installation. Once finished, you can then reboot to Ubuntu.

    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.

    Auto mode: it detects if the SuperUser app installation is required and instals or updates the Dualboot application on Android

    Full mode: it installs the SuperUser and Dualboot apps on Android

    dualboot.sh update

    • Update mode: it installs or updates the Dualboot app on Android

    dualboot.sh channel $CHANNEL

    • Sideload mode: it downloads the latest from the specified Ubuntu $CHANNEL and sideloads the files to the phone. It then starts the Dualboot app on Android to resume the Ubuntu installation with the sideloaded files.

    <<

  • Sideload push mode: it sideloads the downloaded files passed as a parameter and it starts the Dualboot app to resume installation with them on the Android side.
  • 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 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.

    Run the following command to reboot into the bootloader

    Once in the bootloader, run this command to reflash the boot partition:

    Without exiting the bootloader, run this command to reflash the recovery partition:

    After flashing, reboot and your phone should start into Android:

    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!

    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.

    The boot partition is loaded by the bootloader during a normal boot. The boot image in that partition is a combination of the kernel and a ramdisk. In short, the bootloader unpacks the boot image, creates a ramdisk and copies the content of the boot image’s ramdisk into it. Then the kernel is started by executing the init process from ramdisk.

    The recovery partition contains the recovery image, which is just a different kind of boot image. It also includes a kernel and a ramdisk, where the init binary is replaced by a recovery binary inside the ramdisk.

    The system partition holds all the read-only system files (except the ones in ramdisk), and it is mounted by the init process.

    The data partition is then a writable partition used by the system for user data.

    Ubuntu uses partitions in a slightly different way:

    The boot and recovery partitions have the same functionality as in Android

    The system image holds the Android part of the system which is executed inside the LXC.

    The data partition contains the Ubuntu system under /data/ubuntu/

    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?

      Stock Android or AOSP 4.4.2 or higher.

    Cyanogen Mod (based on Android 4.4.2 or higher).

    Which devices does dual-boot work for?

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

    • Nexus 4
    • Nexus 7
    • Nexus 10

    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 (последним исправлял пользователь julia-palandri 2014-07-03 13:48:50)

    Источник

    Читайте также:  Android tv несколько пользователей
    Оцените статью