IntroductionThe following are instructions on how to run Android-x86 inside VirtualBox. Note: For optimal performance, make sure you have enabled either VT-x or AMD-V in your host operating system's BIOS.
DownloadingDownload an ISO of Android-x86 from here.Caution: If you are using Android-x86 for debugging purposes, some binaries (gdb for example) are built for 32-bit architectures and will not support debugging 64-bit binaries such as the Android app host. Download a 32-bit distribution instead. Create a new VMIf you have not already created a VirtualBox virtual machine for Android-x86 yet, do so as follows:
Your virtual machine has now been created. It still needs to be initially installed at this point. SettingsTested on VirtualBox 64-bit for Windows, version 5.2.0. Android-x86 version 6.0-r3, both 32-bit and 64-bit.Select your machine, then click the Settings button and refer to the below recommended configuration to make sure your settings match.
InstallClick the green Start arrow to power-on your virtual machine. You'll be presented with a list of options. Use the arrow keys to pick which one you want, then press Enter once the one you want is selected. If you don't want to install Android-x86 yet and just want to test it, pick one of the Live CD options (except for Debug mode). Pick the Installation option if you want your system to be installed to the virtual hard drive. If you want to use higher resolution, you can edit the boot option by pressing TAB, change vga=788 (800x600) to vga=791 (1024x768) or vga=794 (1280x1024), and press Enter. You can also use vga=ask to see all available modes. But please note Android will only work under 16-bit mode. PartitionWhen you are prompted to Choose a partition, you'll want to Create/Modify partitions. Do not use GPT! This will cause the GRUB installation to fail later. You may partition your disk however you see fit. If you just want a simple installation, create one partition taking up the entire disk and format it as ext4. Continue through the installation. You should install GRUB when it prompts you do so. You may also leave /system as read and write when prompted. Once the installation is complete, reboot your virtual machine and remove the ISO from the virtual CD drive. Once Android-x86 has loaded, you can perform the Android setup and begin using your machine. AdvancedCustom partitions, SDCardWhen booting Android-x86, you may specify which partitions represent the data and sdcard. On the boot menu, select an entry you would like to boot from, press TAB, then add the following as it suits your needs: DATA=sda1 SDCARD=sda2 Press Enter to boot. These options specify user data (your setting, your uploaded applications, ...) go into /dev/sda1, and data saved in sdcard go into /dev/sda2. If you build the ISO from source, you can add these options to bootable/newinstaller/boot/isolinux/isolinux.cfg. Here is a note from David when using fdisk:
Note: for the step 7, if you want to format to vfat only, then you can do :
newfs_msdos /dev/sda2
Also remember the partition type has to be fat32 (b or c). By using vfat, the step 10 is not needed. 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. Playing musicThis section describes two ways to upload music files into Android running on a vbox so you can play them by the Music app. Of course, you can save the files to the virtual disk mounted at /sdcard, as described above. Upload files by adbAdb is Android Debug Bridge, a tool to debug Android system. If you compile from source, it is located in out/host/linux-x86/bin/adb. Otherwise you can get it from Android SDK. Suppose the network of your vbox is OK, you can upload a file from your host by $ ADBHOST=<ip of vbox> out/host/linux-x86/bin/adb push <a music file> /sdcard You need to know the ip of your vbox. You can get it by Alt-F1 and netcfg. You may also need to reboot Android to see the uploaded files. Of course in this way you have to mount /sdcard to a virtual disk partion. For complex network settings of the VirtualBox VM, you should refer to Debug Howto on how to connect adb to the VM. Upload files by wgetYou can also upload files by wget in the debug mode. In the debug mode shell, before entering Android, # cd /android/sdcard Then type exit to enter Android. |
Documentation >