Dualboot: Encrypted Ubuntu and android-x86
I want to install additionally to my encrypted Ubuntu (16.10 Gnome) that is already installed an Android-x86.
Both must be on the single hard drive of the convertible; a usb stick is no option for me because the usb ports sometimes loose their connection.
The Installation parallel to any unencrypted operation system is basically described there.
My question is now: how do I do it? More detailed:
- How do I resize the my encrypted Ubuntu to add a new partition at the end of my drive for Android? Do I have to add the grub2 entry for android myself and is there anything special that I have to mind because of ubuntu's encryption?
- Is it possible to install Android-x86 inside the encrypted container and how would I do that? (would be my favorite)
Here my current partition layout:
usr@pc:~$ sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
[sudo] Passwort für usr:
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 465,8G
├─sda5 crypto_LUKS 465,3G
│ └─sda5_crypt LVM2_member 465,3G
│ ├─ubuntu--gnome--vg-root ext4 457,7G /
│ └─ubuntu--gnome--vg-swap_1 swap 7,6G [SWAP]
└─sda1 ext2 487M /boot respectivelyGParted showing the Partition Layout
Thanks for your efforts. :)
51 Answer
In order to run Android-X86 I believe it the code needs to go on a partition directly accessible on the disk - ie not via LVM or Crypt. I imagine what you want to land up with is your Linux OS on an encrypted LUKS partition and Android on its own EXT4 partition which is not part of the LVM.
What needs to be done is - Shrink a filesystem on the LVM (or reduce size of swap or both), then shrink the LVM, then shrink the Luks volume, then shrink the partition, then add a EXT3 new partition, mount it in the appropriate place using FSTAB and install android to that partition.
NOTE THAT THIS IS HIGH RISK AND YOU SHOULD BACK UP FIRST. It may be simpler to back up your data and repartition the drive as desired. Here is a link on how to shrink the LVM - Note that you will need to boot of a USB key or similar to shrink an EXT partition.
In the download for Android (eg ) it tells you how to install android-x86 using a Debian/Ubuntu based system or Redhat/Fedora system. The also gives you a indication as to what directory name you need to mount the partition on in fstab (in the case of this version its /android-7.1-rc1). If you are lucky the setup script should add an Andoid-x86 boot option when you start the system (ie to the Grub bootloader). [ I note that these instructions are different to the ones in your post, and are probably easier to follow ]
The line you would add to fstab would be something like
/dev/sda3 /android-7.1-rc1 ext3 defaults 1 1 (the /dev/sda3 would be replaced with your block ID of your new partition. the directory /android-7.1-rc1 should be created BEFORE you do this, and before you install Android). As I've not tried it, I can't be sure if booting will work - if not, its probably a matter of tweeking the GRUB bootloader to see the appropriate files in the new partition. You might want to install "grub-customiser" to help with this editing process.