Install a VM With an ISO File
If you don't find a ready-to-use VM disk on the web, you’ll have to create an empty one and install the operating system on it manually.
In our case, we’re going to install the Android operating system onto our VM using its ISO file.
Once you’ve downloaded them, let’s look at what to do next.
Step 1: Assign the Correct Specifications
Create the VM with the following specifications:
![The first step asks you to name and choose the space to save the file.](https://user.oc-static.com/upload/2021/07/26/16272615079027_image7.png)
Step 2: Mount the ISO File
Mount your ISO file on your VM’s IDE controller (insert the installation CD on a physical machine).
![In the storage tab select empty in controller IDE you can select the optical drive and create the disk](https://user.oc-static.com/upload/2021/07/26/16272616646311_image63.png)
Step 3: Install the Virtual Machine
Launch your VM and start installation.
![The Virtualbox app shows that the android virtual machine is running](https://user.oc-static.com/upload/2021/07/26/1627261787346_image41.png)
Troubleshooting Common Problems
This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot - please use a kernel appropriate for your CPU.
Solution: Activate the VT-x or AMD-v option in the BIOS of the host machine.
Solution: In the first window, when creating the VM (where you enter the name and type of VM, i.e., Windows/Linux/Max, etc.), the Version field allows you to choose the exact operating system. Make sure you select 32-bit if the operating system you’re installing is the 32-bit version. The same applies to 64-bit.
Take a Closer Look at Steps 1 - 3
We’ve covered the first part of creating a VM from an ISO disk image. Follow the video below to make sure you understand before moving on:
Step 4: Create a Bootable Partition
Now you need to create your blank disk’s partition table.
1 - Choose Create/Modify partitions.
![There are 2 options to create or modify and detect devices create and modify is selected](https://user.oc-static.com/upload/2021/07/26/16272619205293_image30.png)
2 - Don’t use GPT (this will create an MBR table).
3 - Select New to create a new primary partition with all the space available.
4 - Make this partition bootable by clicking on the Bootable option to allow the VM to start on this partition. Non-bootable partitions are mainly used for storage, but not for installing operating systems.
![The screen has 6 options on the bottom and new is selected](https://user.oc-static.com/upload/2021/07/26/16272620290779_image20.png)
![There are 9 options with bootable selected](https://user.oc-static.com/upload/2021/07/26/16272620541211_image16.png)
5 - Select Write so that you can write to the partition.
![You are asked a yes or no question to check if you want to write to the partition](https://user.oc-static.com/upload/2021/07/26/16272623267048_image67.png)
Step 5: Install the Virtual Machine
Your disk is now partitioned and you can install Android on it.
![The partitioned disk is now available in the available partition menu](https://user.oc-static.com/upload/2021/07/26/16272624330717_image55.png)
1 - Select the file type ext4, which is the file system used by Android 8.
![Select the file type ext4 is selected as the format](https://user.oc-static.com/upload/2021/07/26/16272624849749_image45.png)
2 - Install GRUB, which is the machine’s boot loader script.
![A dialogue box that asks if you would like to install GRUB](https://user.oc-static.com/upload/2021/07/26/16272625139517_image32.png)
GRUB will allow you to access this selection screen at start-up:
![the boot up screen has 2 options android or android debug Android is selected](https://user.oc-static.com/upload/2021/07/26/16272625639647_image6.png)
3 - Make the directory/system rewritable (this will allow you to change the directory later on).
4 - Installation can now begin.
![A download bar that shows the android VM is being installed](https://user.oc-static.com/upload/2021/07/26/16272626403508_image65.png)
5 - And your VM is ready!
![The android VM home screen is launched](https://user.oc-static.com/upload/2021/07/26/16272626680902_image66.png)
Take a Closer Look at Steps 4 - 5
Your Android machine is now operational! Check the short video below to follow my installation steps for the final part of the Android VM creation:
Let’s Recap!
If you cannot find a ready-to-use VM online, you can create a blank one and install the operating system using an ISO file.
You must mount the ISO onto the VM. The installation will begin when the VM is powered on.
To partition the drive correctly (for Android), follow the steps outlined above, making sure the partition is bootable.
Use filetype ext4 and install GRUB to complete the Android OS installation.
Now that you can create VMs, we’ll take a closer look at communication between our virtual machines in the next chapter.