(Originally posted on SuperUser here, but posted here due to lack of responses.)
I have Android installed on sda3, and it boots fine when loaded from Grub with the following commands:
set root='(hd0,3)' search --no-floppy --fs-uuid --set=root 977083a6-5762-4064-b860-39429b9e0cf8 linux /kernel root=UUID=977083a6-5762-4064-b860-39429b9e0cf8 initrd /initrd.img
I have tried to load it in KVM using the following:
#Mount the Android partition as read-only so KVM can read its kernel and initrd sudo mkdir /media/android sudo mount -o ro /dev/sda3 /media/android #Command to start the vm sudo kvm -kernel /media/android/kernel -initrd /media/android/initrd.img /dev/sda3
In both circumstances a command line environment appears and configures loads of options quickly, but when booting from Grub the Android operating system proper then appears, whilst when trying to boot it as a vm using KVM it simply loads into a terminal interface. Are there any options I need to add to the KVM command to get this working properly (perhaps using the -append parameter)
(p.s. unsure if I should be posting this on SuperUser or Unix & Linux)
Using Ubuntu 14.10 with an Intel i5-4690K.
I have tried adding the option
-append root=/dev/sda, to no avail. Some of the initialisation process is still visible and includes lines like:
sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: Attached scsi generic sy0 type 0 sda: unknown partition table sd 0:0:0:0: [sda] Attached SCSI disk Detecting Android-x86... found at /dev/sda
When I try to use operations like "mkdir" from the cli, I get told
mkdir failed, Read-only file system.
I managed to get it to run in VirtualBox on Windows installed on a separate hard drive by using a raw disk image of the entire physical hard drive Android is installed on (the same one my Ubuntu partition is on). Trying to create a raw disk image of just the Android partition, in both Windows and Ubuntu, creates a VM that doesn't boot (even when using a custom GRUB 2 ISO that disincludes the inaccessible partitions). When I run
fdisk -l in Ubuntu, I get a warning that "Partition 3 [where Android is installed] is not aligned to logical sector boundary" (or something like that). Could that be the root cause?
The Android partition has no data or apps on it other than what was installed by default, so I will try deleting the partition and re-installing it and report back here.