Sometimes it is necessary to use some native Android apps on your PC, and the emulators that exist are not always good enough for all cases. Either because you are a developer and you need to test your apps, or because you need to test Google’s operating system on your PC, one of the best options you have at your fingertips is install Android in Virtualbox.
Here you will learn to do it step by stepIn addition to knowing what the limitations are in terms of Android versions, as well as the basic configuration of the virtual machine in Oracle VirtualBox.
Install VirtualBox on your PC
For install VirtualBox on your PC, the generic steps to follow to have the latest stable version are:
- Go to the official VirtualBox website at download section.
- There you will see a section called VirtualBox Xyz platform packages, Xyz being the last stable version available at the time of download.
- There are several packages that you can download, depending on your operating system. You must choose the appropriate:
- Windows hosts for Microsoft Windows.
- OS X hosts for macOS.
- Solaris hosts for the Oracle Solaris OS.
- Linux distributions for GNU / Linux distributions. Within this there are several types of packages:
- For CentOS and Oracle Linux (rpm)
- For Ubuntu and Debian (deb)
- openSUSE and Fedora (rpm)
- And for all distros (.run)
- Once you have chosen the appropriate package for your version and type of operating system, you must install it as you would any other program.
- When installed, you could also download and install extensions from VitualBox, although this is optional, as they only serve to add some extra functions between the host and guest operating systems.
And I would already be ready to run and be able to create virtual machines.
Caution: VirtualBox is not an emulator
VirtualBox is not an emulator as is BlueStacks, MEmu Play, Genymotion, Anbox, and even Android Studio itself. It is a virtualization software to create a virtual machine with the necessary resources to run the operating system as if it were on a real machine.
By this I mean that it is important to choose the right version for your platform, since you will not be able to use Android for ARM on your x86 PC, nor vice versa, since for that you would need emulation software such as QEMU, etc.
Where to download the right version of Android
To be able to work with VirtualBox on a conventional PC, it is necessary download Android for x86 platform. This is as simple as following these steps:
- Go to this download website official Android x86.
- Click on the blue or green button depending on where you want to download the operating system image from. In either case it is valid.
- Then it redirects you to another download page, and from there you can select the version of Android you want to download. But remember that it must be .iso, don’t download the .rpm there.
- Wait for the download to finish, and you will have it locally. They are usually 800-900 MB in size.
Alternatives: other operating systems based on Android and compatible with your apps
In addition to the official version of the Google Android operating system, you can also use other operating system alternatives that you can also virtualize and that are compatible with Android apps natively or that are derivatives based on Android. Here are some good examples:
Install Android in VirtualBox step by step
Install Android in VirtualBox It can be a simple task for those who are used to using virtual machines and installing operating systems, but not for other users. However, here are the steps explained:
- Once you have VirtualBox installed and you have the Android x86 ISO, the following is run VirtualBox.
- On the main screen, press the button New to create a new virtual machine. And give it a name, for example Android.
- Now the virtual machine setup wizard opens. The first thing it asks you is to enter the version, which you must choose Linux 2.6 / 3.x / 4.x.
- In the section to specify the RAM of the virtual machine, you can choose 2GB or 2048 MB, although 8GB is recommended.
- Create a virtual hard disk also to install the operating system there. Do not fall short in size, since if you are going to install many apps, or have many files hosted, it will be small. Although it can work with just over 1GB, the ideal is to use somewhat more generous sizes, such as 32GB or more.
- Once the virtual machine configuration wizard is finished, said machine will be created. Now you have to make some adjustments. Click on the Android virtual machine that you have created on the main VirtualBox screen and then click on the icon Setting:
- System: in this section you can choose the amount of vCPUs or virtual processors assigned. 1 is the minimum, although you can choose more if you prefer it to be more fluid.
- Screen: Change VMSVGA to VBoxVGA and enable 3D acceleration. If you want, you can also increase the video memory a bit.
- Storage: select the medium with a CD icon and in the attributes you should choose where the Andorid .iso image you downloaded is located.
- Audio: Leave Intel HD Audio, which is natively supported on Android x86.
- Net: In general, you don’t have to do anything, although if you want your Android to not be connected to the Internet, disable the network adapter.
- After that, you can start install Android in VirtualBox. To do this, go back to the VirtualBox main menu and click on Start to start your virtual machine.
- As it is the first time, you must install the operating system from scratch. The next times you start your machine, it will already be installed and when you start up, the Android desktop will appear directly. On the main screen you will see several options:
- LiveCD It is used to test Android x86 without installing.
- The option of Installation will install it. In this case, if you want to use a specific resolution, press tab and change vga = 788 to another of the available modes. You can use vga = ask to see which ones you have to choose from.
- If you have chosen to install Android in Virtualbox, then now you must choose Create / Modify partitions. If you want an easy installation, just create an ext4 formatted partition. Although if you want to create other partitions you can also.
- Then it will continue with the installation of the manager GRUB boot, choose to make the / system partition read and write, and finally the installation will complete. Then close or restart the virtual machine.
- It is important that you go back to Settings of your Android virtual machine and from there remove the ISO from the virtual CD, since otherwise the installer will come out again.
- Start your virtual machine again and Android will start up with the setup.
Keep in mind that the resources assigned to the virtual machine (virtual RAM, virtual CPUs, storage space, etc.), are limited by the hardware of your PC.
Now already you can do anything you would do on an Android installed on a real device, such as installing or uninstalling apps, running them, accessing the Internet, making adjustments, etc.
Even easier: avoid installing Android in VirtualBox
For some who do not want to complicate your life and have an Android already installed in VirtualBoxYou can also skip the steps in the section on how to install Android in VirtualBox and download the virtual machine already created so that you simply have to start it from the virtualizer. Can find these machines on this web.