How to Fix Android Screen Resolution in VirtualBox

You can change the window size with a few commands

After learning how to install Android within VirtualBox, the one thing you may notice is the window that runs Android is quite small. This guide shows you how to increase the screen resolution. It isn't as easy as flicking a switch, but by following these instructions, you can change it to something that works for you.

There are two main parts to amending the screen resolution. The first is to change the VirtualBox settings for your Android installation, and the second is to tweak the boot menu option within GRUB to reset the screen resolution. We show you how.

The instructions in this guide apply to Windows 10, Windows 8.1, Windows 7, and Linux.

Android Screen Resolution

How to Fix the Virtualbox Screen Resolution for Android

Follow these steps to add a custom screen resolution in Virtualbox for Android:

  1. Open a command prompt. How you do this depends on what operating system you use:

    • In Windows 10, type command into the search bar, and select the Command Prompt app.
    • In Windows 8.1, right-click the Start button and select Command Prompt.
    • In Windows 7, press the Start button and type cmd.exe into the Run box.
    • In Linux, open a terminal window. In Ubuntu, press the super key and type term into the dash. Then, select the terminal icon. In Mint, open the menu and select the terminal icon within the menu (or press Ctrl+Alt+T at the same time).
  2. In Windows, run the following command: cd "c:\program files\oracle\virtualbox"

    This assumes you used the default options while installing VirtualBox.

    In Linux, you don't have to navigate to the folder for VirtualBox since it's part of the path environment variable.

  3. In Windows, run this command: VBoxManage.exe setextradata "WHATEVERYOUCALLEDANDROID" "CustomVideoMode1" "desiredresolution"

    In Linux, the command is similar except you don't need the .exe part of the command: VBoxManage setextradata "WHATEVERYOUCALLEDANDROID" "CustomVideoMode1" "desiredresolution"

    Replace WHATEVERYOUCALLEDANDROID with the name of the virtual machine you created for Android and replace the desired resolution with an actual resolution such as 1024x768x16 or 1368x768x16.

  4. Open VirtualBox, then start your Android virtual machine. 

  5. Select the Devices menu, and choose CD/DVD devices. If the Android ISO appears, place a checkmark next to it. If the Android ISO doesn't appear, select Choose a virtual CD/DVD disk file, and navigate to the Android ISO you downloaded previously.

  6. Select Machine, then choose Reset.

  7. Choose the Live CD - Debug Mode option.

  8. A load of text zooms up the screen. Press the Enter key until you're at a prompt that looks like this:

    • /Android #

    Type the following lines into the terminal window:

    mkdir /boot

    mount /dev/sda1 /boot

    vi /boot/grub/menu.lst

  9. The vi editor takes a bit of getting used to if you haven't used it before, so here's how to edit the file and what to enter.

    First, note the appearance of four blocks of code, all starting with the following text:

    • title Android-x86 4.4-r3

    The one you want in is the first block. Use the arrow keys on the keyboard to move the cursor down to the line just below the first title, Android-x86 4.4-r3.

  10. Use the right arrow, and place the cursor after the bit that reads:

    • kernel /android-4.4-r3/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 src=/android-4.4-r3
  11. Press the letter I on the keyboard, and enter UVESA_MODE=yourdesiredresolution.

  12. Replace yourdesiredresolution with the resolution you wish to use. For example, UVESA_MODE=1024x768.

    The line should now look as follows:

    • kernel /android-4.4-r3/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 UVESA_MODE=1024x768 src=/android-4.4-r3
  13. Press Escape to exit insert mode. Then, press : (colon) on the keyboard, and type wq (write and quit).

  14. Before resetting your virtual machine, remove the ISO from the virtual DVD drive. To do this, select the Devices menu, then choose CD/DVD Devices. Clear the Android ISO check box.

  15. Reset the virtual machine. Select Machine, then choose Reset.

When you start Android the next time, it automatically resizes to the new resolution as soon as you choose the menu option within GRUB. If the resolution isn't to your liking, follow the instructions above again and choose a different resolution where required.

Now that you have tried Android within VirtualBox, why not try Ubuntu within VirtualBox? VirtualBox isn't the only virtualization software. If you use the GNOME desktop, use Boxes to run virtual machines.