In my last post, I explained how to install Android under VirtualBox. Today, I’ll explain how you can change the screen resolution.
Latest posts by Michael Pietroforte (see all)

The display resolution after the installation is a bit unusual for tablets and phones. For testing apps, it is better to use a screen size with a typical portrait aspect ratio. It gives you a better impression of how end users experience a certain app, and you can create screenshots in the typical format of mobile devices if you have to send instructions to a user.

In this guide, I used a resolution of 360x640. Depending on the size of your screen, you might choose another format. Unfortunately, changing the resolution of an Android VM is not as easy as with a Windows VM.

VirtualBox Android resolution configuration

  1. Add a custom screen resolution to your VirtualBox VM by opening a command prompt, navigating to your VirtualBox installation folder, and entering the following command:
    VBoxManage setextradata "Android" "CustomVideoMode1" "360x640x16"
    Custom screen resolution
    I assumed here that the name of your VM is Android.
  2. Start the VM and, when the GRUB boot menu appears, select the Debug mode.
    Debug mode
  3. Wait until the Linux boot process is completed, and then press Enter.
    Linux boot up
  4. At the Linux prompt, enter the following commands:
    mkdir /boot
    mount /dev/sda1 /boot
    vi /boot/grub/menu.lst
    Edit GRUB menu.lst
  5. Move the cursor to the first line that begins with kernel /android. In this line, search for “video= -16”.
    menu.lst
  6. Press the i key (enables insert mode in the vi editor), and then type UVESA_MODE=360x640.
    UVESA_MODE=360x640
  7. Press ESC and then SHIFT+ZZ to save the new GRUB boot menu.
  8. Clean up and then restart the VM.
    umount /boot
    rmdir /boot
    reboot –f
    Reboot

From now on, your Android VM should use the new screen resolution.

Android on VirtualBox with changed resolution

Android on VirtualBox with changed resolution

If you want to work with different resolutions, you just have to add the corresponding entries to the GRUB boot menu. Don’t forget to add a custom screen size to the VirtualBox virtual machine (step 1).

23 Comments
  1. Ricardo 9 years ago

    Very useful, android on Vbox is the only way to debug

  2. Ricardo, thanks!

  3. Tommit 9 years ago

    Can’t find -16 string in new virtualbox version grub menu…. should this be added or has logic changed in new version?

  4. Tommit, can you find “video=”? What do you see?

  5. Tommit 9 years ago

    Will make a copy tomorrow… currently at customers site but there’s no video and no -16 anymore using virtualbox 4.3.20

  6. Tommit 9 years ago

    Can I send a PM with two small screenshots of menu.lst?
    or to a info@4sysops ?

  7. Tommit, you can such questions in the forum. You can also upload screenshots there.

  8. Bill 9 years ago

    running latest 4.4RC2 when I go into debug mode there is no /dev/sda1. Any ideas?

  9. mrdeep 9 years ago

    hi dear,
    I have tried this hundreds of times but resolution remaied same.
    when I enter commad “unmount /boot”
    messages displayed is “unmount: not found”
    and when I enter next command “rmdir /boot”
    message is ” ‘/boot’: Device or resource busy”

    see the error here http://i61.tinypic.com/xm72ap.png
    Please help.

    • BayuAH 6 years ago

      Use umount, not unmount.

      avatar
    • rdz 4 years ago

      It's umount and it's not a typo.

  10. tom 9 years ago

    when I enter commad “unmount /boot”…
    Not unmount -> umount without n

  11. Jibraan 8 years ago

    Machine stuck at “Detecting Android-x86……”
    what to do?

  12. Emmanuel 8 years ago

    looks like the 16 set the color to a lower level that the original one … How to reduce the resolution but keep the color nice and sharp?

  13. Sreenivasa Rajiv 8 years ago

    Thanks Dude !!! U r awesome

  14. Tony 8 years ago

    Worked like a charm. Awesome easy guide. Thank you!

  15. peer 8 years ago

    The textfragment ” video=-16″ was not there (android 4.4r3). I looked for the suggested line
    ……….android _x86 SRC=/android-4.4….
    then I put the cursor just before the letters SRC and inserted: video=-16 UVESA_MODE=1280×800
    Then the line becomes:
    ……….android _x86 video=-16 UVESA_MODE=1280×800 SRC=/android-4.4….
    And it works for me!!

  16. Nataly 8 years ago

    Hello! Thanks for the article, it very helpfull, but I still need some help there~ Is there any chance to set bit depth to 24 bit? When I set 480x720x24 or 480x720x32 in VirtualBox, android even don’t load :c only with x16 bit depth.

  17. Sigitas 8 years ago

    Thanks. Super!

  18. Mahabubul Alam 7 years ago

    Hello, I installed android on virtualbox but after installation i turned off the machine. T he problem is when i again go to open the device it asks for installation again. Plz solve the problem. Thanks

  19. Kevin 7 years ago

    Odd, when I follow the instructions it changes my screen not to 360×640 but to 1024x768x16, but only on the line I altered.  The debug one remained the original size of 720×400 (note the missing x16)

    Running the VM in a windows 7 environment.

    Any ideas?

  20. Donald Duck 4 years ago

    This doesn't work for me. Without VGA, it won't boot, and with VGA, I can't get it to use portrait screen resolutions.

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account