I want to carry around an Android OS install on a USB so I can have a Google Authenticator with me everywhere I go since I don't own any mobile devices. The idea being that I can run Android through VirtualBox on the computers I use.
So I first partitioned my 8 GB USB drive using gparted
into a fat32
file system for portability.
Then I created a VirtualBox disk associated with the fat32
partition on the USB drive at /dev/sdd1
:
$ sudo su -
root@ckleinlx:~/.VirtualBox/HardDisks# VBoxManage internalcommands createrawvmdk -filename /root/.VirtualBox/HardDisks/usbdisk.vmdk -rawdisk /dev/sdd1
RAW host disk access VMDK file /root/.VirtualBox/HardDisks/usbdisk.vmdk created successfully.
Then I downloaded the android-x86 iso, and attached the iso and newly created usbdisk.vmdk
as storage on a new VM in VirtualBox.
Then I boot up the VM and start the installer.
I formatted the partition again as fat32
and marked it Bootable
, then started the install. When asked if I want to install GRUB
I confirm, installation completes, and I select "Reboot", then shut down the VM.
At this point I remove the Android install disk from the VM, leaving only usbdisk.vmdk
, which has Android installed on it now. However, when I boot, I just get this:
Android and grub are both clearly installed on the usb:
root@ckleinlx:~/.VirtualBox/HardDisks# mount /dev/sdd1 /media/usb
root@ckleinlx:~/.VirtualBox/HardDisks# ls /media/usb
android-4.3-test grub
And here's what the USB stick looks like in gparted
Why can't Android be booted from this USB? Everything seems to be installed correctly, but virtualbox complains that it can't read the boot medium.
Best Answer
Here are a few things that I changed to make it work:
vmdk
disk from the device (/dev/sdd
), not the partition (/dev/sdd1
)