Use Android on your computer using Android-x86

By Rahul Pandit

Posted on Saturday, 30 May 2020

Is there an Android app that you want to check out but the app seems kinda sketchy and it requires some risky permissions? Do you hate carrying around a smartphone but still need to use some apps because of family or work reasons? Or perhaps your Android phone is broken and you are left without your favorite apps.

To solve all these problems, you can try installing Android on your computer. You can, of course, dual boot and install it alongside existing operating system(s). Or, as I will show in this post, you can install Android in a virtual machine so it runs within your current OS without much hassle. One more thing, if you are not a fan of surveillance capitalism, this can be a good way to limit data collection done by tech companies because, unlike your phone, I hope the virtual machine won't be running 24-7 and I believe you will install apps judiciously.

Get Android-x86

Android-x86 project is more than a decade old, open source project. Go to official Android-x86 download page and download the latest 64-bit Android-x86 ISO file. File would be named something like android-x86_64-X.Y.iso (X and Y are major and minor version numbers) and its size would be around 900 MB.

Install Virtualbox

Install Virtualbox on your computer. I'm assuming you're running Ubuntu or Debian or one of their derivative distros. You can do this on Windows too but Virtualbox installation instructions will differ.

sudo apt update
sudo apt install virtualbox

Create a virtual machine

Open Virtualbox and click on New button. Give a name to the virtual machine. Something like 'My Android VM' would do. Choose Linux as its type and Linux 2.6/3.x/4.x (64-bit) as its version. Click Next.

Allocate at least 3072 MB memory to the virtual machine. click Next.

Choose Create a virtual hard disk now option and click Create.

  • Keep the default option VDI (VirtualBox Disk Image) as the hard disk file type and click Next.
  • Select dynamically allocated option so not all 8 gb will be taken up at the start. Disk space will be used as required. Click Next.
  • The default size of 8 gb is enough for Android OS plus a couple of apps. You can of course increase the size if you want. Click Create. Virtual machine will now be created.

Setup the virutal machine

Select the newly created virtual machine and open Settings dialog box.

  • Go to System section and then Processor tab. If you have a quadcore processor, increase CPUs for virtual machine to 2 and if you have an octacore processor, increase CPUs for virtual machine to 4 for smooth operation.
  • Go to Display section and then Screen tab. Select VBoxVGA as graphics controller. If you have Virtualbox guest additions installed, you can enable 3D acceleration but it's optional.
  • Go to Storage section. In the list of storage devices, click on the Empty CD option. Then on the Attributes side, click on the CD button with the downward arrow and select Choose a disk file.... Now select the ISO file that you downloaded.
  • Go to Audio section. Select Intel HD Audio as the audio controller.
  • Click OK to save all the settings.

Install Android-x86 in the virtual machine

Start the virtual machine. On the initial boot screen :

  • Select Advanced Options....
  • Select Auto_Installation - Auto Install to specified harddisk.
  • Choose yes when asked confirmation to erase /dev/sda and install Android-x86 in it.
  • After installation completes, reboot.
  • As you can see, you have booted into the live ISO again.
  • Right click on the CD icon on the status bar of the virtual machine and select Remove disk from virtual drive.
  • Close the window and when virutalbox asks what you want to do, select Power off the machine option and press OK.

Boot Android-x86

Start the virtual machine again. Virtual machine will now boot Android! Follow the steps given below to complete Android installation.

  • Select your language.
  • On Connect to wifi screen, click on See all wifi networks, then select VirtWifi which is your host computer's internet connection.
  • Copy apps and data step is optional. You can skip it if you want.
  • Unless you want to use Google Play store, don't sign into your google account. It's optional anyway. If you do want to use play store, I would recommend creating a new account.
  • Check whether date and time are set correctly and click next.
  • Disable all location use. Disable wifi and bluetooth scanning. Disable Send usage and diagnostic data option too. Read Google's privacy policy and terms of service, and if you agree, click Accept.
  • Set a pin or a password to protect your Android OS.
  • Select Quickstep as your default home app.

That's it! You have successfully installed Android on a virtual machine and can now start installing apps.

Install Apps in Android-x86 virtual machine

As an example, I will show you how easy it is to install Whatsapp in the virtual machine. If you added a google account while finishing up Android-x86 setup, you can just open up Google Play and install WhatsApp from there. If you didn't add a google account, open a browser and go to official Whatsapp APK download page then download and install WhatsApp.apk from there. Now you may delete that app from your phone. You'll have to repeat this step when you want to install newer versions of WhatsApp.

How to transfer data

To transfer files from host computer to virtual machine and vice versa, you can create a shared folder in Virtualbox or access USB flash drive from Virtualbox or use a secure file transfer service like Firefox Send or if you know some programming, you can self-host a Nextcloud instance and access it from the virtual machine or you can create a simple file upload/download server in your favorite language and run it from your host machine and access it from the virtual machine.



Cover Picture Credit : Photo by Rami Al-zayat on Unsplash


Tags : Open Source




Recent Posts

Deploy Vaultwarden password manager, Portainer, Nginx and Certbot in Docker


Good Pi-hole blocklists that stop online ads, trackers and malware


Block online ads, trackers and malware with Pi-hole, WireGuard, DoT and DoH servers


Free third-party DNS for blocking ads and trackers


My Chess Notes