SD card on virtualbox

15,685 views
Skip to first unread message

davem...@gmail.com

unread,
Jan 21, 2011, 4:22:17 PM1/21/11
to andro...@googlegroups.com
I've just started using Android-x86 via VirtualBox and thoroughly enjoying it. While trying to install an app I got an error message that I couldn't install the app without an SD card. I saw this lengthy post on setting up a card in VMWare and was wondering if this applies to VirtualBox or if there are any simpler solutions for setting up virtual SD cards?

Thanks for your help!
David

Ikem Krueger

unread,
Jan 21, 2011, 6:11:39 PM1/21/11
to andro...@googlegroups.com
> 2011/1/21 <davem...@gmail.com>:
Try it! And tell us the result! :)

davem...@gmail.com

unread,
Jan 22, 2011, 12:34:55 AM1/22/11
to andro...@googlegroups.com
I gave it a shot, and the SD card mounted! Here are the steps I used for VirtualBox:
  1. Create a new virtual machine with a hard disk.
  2. Launch the Live ISO in Debug mode (I used android-x86-2.2-generic.iso) to get the commend prompt.
  3. "fdisk /dev/sda", then type:
    1. "n" (new partition)
    2. "p" (primary partition)
    3. "1" (1st partition)
    4. "1" (first cylinder)
    5. "xx" (choose the last cylinder, leaving room for a 2nd partition)
    6. "w" (write the partition)
  4. Repeat #3, but call it partition 2, and use the remaining cylinders.
  5. "mdev -s"
  6. "mke2fs -j -L DATA /dev/sda1"
  7. "mke2fs -j -L SDCARD /dev/sda2"
  8. Reboot ("reboot -f")
  9. At the boot menu, choose VESA, then hit TAB and type so that the end of the line reads: "DATA=sda1 SDCARD=sda2".
  10. After booting (and of course disabling mouse integration via the machine menu), the SD card is read as unformatted, but you can format it by going to Settings > SD card & phone settings > Format SD Card, then Mount SD card.
  11. The SD card should now work!
The steps are adapted from this and this posting. I couldn't find cfdisk, but fdisk worked. Are steps 5-7 necessary, since I ended up reformatting the card anyway?

Ikem Krueger

unread,
Jan 22, 2011, 8:28:49 AM1/22/11
to andro...@googlegroups.com
> 2011/1/22 <davem...@gmail.com>:

>
> I gave it a shot, and the SD card mounted! Here are the steps I used for
> VirtualBox:
Awesome! :D

Suman Saraf

unread,
Jan 22, 2011, 8:55:40 AM1/22/11
to andro...@googlegroups.com
Ikem,

Can I please ask you to refrain from sending one word e-mails like Cool, Awesome etc. to the list. If you are so excited and want to compliment the person please do it privately. This group has a wide circulation and people are looking for technical content.

It is ok expressing your delight occasionally, but please don't make that a habit!

Thanks
Suman

--- On Sat, 22/1/11, Ikem Krueger <ikem.k...@googlemail.com> wrote:

> --
> You received this message because you are subscribed to the
> Google Groups "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-x86...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
>
>



Yi Sun

unread,
Jan 22, 2011, 3:15:18 PM1/22/11
to andro...@googlegroups.com
I have added this to
https://sites.google.com/a/android-x86.org/web/documents/virtualboxhowto
Please take a look just in case I made any mistake.
Thanks
Yi

> --
> You received this message because you are subscribed to the Google Groups
> "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-x86...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-x86?hl=en.
>

--
Android-x86
http://www.android-x86.org

Suman Saraf

unread,
Jan 22, 2011, 3:24:19 PM1/22/11
to andro...@googlegroups.com
Just a minor addendum - DevTools application has a MediaScanner which (re)indexes your SD card for cases where you manually copied media over. This ensures that you see new images and/or music in the apps without having to reboot.

If you downloaded it from within android, the application asks the relevant service to index new files.

--- On Sat, 22/1/11, Yi Sun <bey...@gmail.com> wrote:

> From: Yi Sun <bey...@gmail.com>
> Subject: Re: SD card on virtualbox
> To: andro...@googlegroups.com

Yi Sun

unread,
Jan 22, 2011, 3:49:13 PM1/22/11
to andro...@googlegroups.com
Added

Chih-Wei Huang

unread,
Jan 22, 2011, 4:17:09 PM1/22/11
to andro...@googlegroups.com
Thank you for the sharing, though there are
something need to be correct or modify.
See below.

Besides, I think these steps are still too complex for beginners.
I suggest newbies just install android-x86-2.2 to harddisk,
and use the "Create a fake SD card" feature in the installer.
(available when installation finished)

2011/1/22 <davem...@gmail.com>:


> I gave it a shot, and the SD card mounted! Here are the steps I used for
> VirtualBox:
>
> Create a new virtual machine with a hard disk.
> Launch the Live ISO in Debug mode (I used android-x86-2.2-generic.iso) to
> get the commend prompt.
> "fdisk /dev/sda", then type:
>
> "n" (new partition)
> "p" (primary partition)
> "1" (1st partition)
> "1" (first cylinder)
> "xx" (choose the last cylinder, leaving room for a 2nd partition)
> "w" (write the partition)
>
> Repeat #3, but call it partition 2, and use the remaining cylinders.
> "mdev -s"
> "mke2fs -j -L DATA /dev/sda1"
> "mke2fs -j -L SDCARD /dev/sda2"

Format it to vfat by

newfs_msdos /dev/sda2

Also remember the partition type has to
be fat32 (b or c).

> Reboot ("reboot -f")
> At the boot menu, choose VESA, then hit TAB and type so that the end of the
> line reads: "DATA=sda1 SDCARD=sda2".

If you use the vm target, you don't need to do so.
The vm target automatically does the equivalent thing
for you. That's what I called "persistent mode".

But if you use other targets like generic,
you have to add that by hand.

> After booting (and of course disabling mouse integration via the machine
> menu), the SD card is read as unformatted, but you can format it by going to
> Settings > SD card & phone settings > Format SD Card, then Mount SD card.

No need if you format it to vfat.

> The SD card should now work!
> The steps are adapted from this and this posting. I couldn't find cfdisk,
> but fdisk worked. Are steps 5-7 necessary, since I ended up reformatting the
> card anyway?

cfdisk only available in the installer (the last boot item).


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

davem...@gmail.com

unread,
Jan 22, 2011, 5:54:14 PM1/22/11
to andro...@googlegroups.com
Thanks for the modifications and insight!

I'm a newbie to Android-x86 and think maybe a few items could be added to the online howto? From the howto I thought that I had to manually create partitions by command-line before installing to hard disk, but I've now realized that I can just use the installer to create one big partition and then create the fake SD card. When I tried creating an SD card with the default size (ie the size of the partition), it appeared to install fine but then didn't boot (came to a blank grub screen). I'm guessing that the fake disc image overwrote the Android install? I tried again and made a smaller SD card (estimated to be fit within the free space), and now it works.

Chih-Wei Huang

unread,
Jan 22, 2011, 11:31:19 PM1/22/11
to andro...@googlegroups.com
2011/1/23 <davem...@gmail.com>:

> Thanks for the modifications and insight!
> I'm a newbie to Android-x86 and think maybe a few items could be added to
> the online howto? From the howto I thought that I had to manually create

The doc is a little obsolete and needs to be updated.

> partitions by command-line before installing to hard disk, but I've now
> realized that I can just use the installer to create one big partition and
> then create the fake SD card. When I tried creating an SD card with the
> default size (ie the size of the partition), it appeared to install fine but
> then didn't boot (came to a blank grub screen). I'm guessing that the fake
> disc image overwrote the Android install? I tried again and made a smaller
> SD card (estimated to be fit within the free space), and now it works.

Yes. The installer is not smart enough
to detect the free space yet.

littleinthesky

unread,
Feb 16, 2011, 4:25:54 AM2/16/11
to Android-x86

thanks

David King

unread,
Jun 7, 2011, 2:11:56 PM6/7/11
to andro...@googlegroups.com
I too am new at this. I followed the instructions and divided the virtual hard disk (in VirtualBox 4) into 2 partitions, one about 1 GB, the other 7 GB.

The instructions on the website were hard to follow but I did it, only to find that after installing Android to sda1 that there is no more a GRUB menu at boot up, and when accessing the CLI (via pressing ALT F1), I find that the system is read only and thus I cannot edit anything.

I want to have it so that it loads the "fake" SDcard I created and can be used like a normal Android installation as much as possible. I did not see any option to create a fake SDcard during installation, maybe because I was not looking for it. I think the Documentation needs to be updated as currently i am confused about what to do.
Reply all
Reply to author
Forward
0 new messages