In my last post, I explained how to install Android under VirtualBox. Today, I’ll explain how you can change the screen resolution.

Michael Pietroforte

Michael Pietroforte is the founder and editor of 4sysops. He is a Microsoft Most Valuable Professional (MVP) with more than 30 years of experience in IT management and system administration.

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).

Win the monthly 4sysops member prize for IT pros

Share
1+

Related Posts

20 Comments
  1. […] Change the screen resolution of an Android VirtualBox VM – 4sysops. […]

    0

  2. Ricardo 3 years ago

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

    0

  3. Michael Pietroforte 3 years ago

    Ricardo, thanks!

    0

  4. Tommit 3 years ago

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

    0

  5. Michael Pietroforte 3 years ago

    Tommit, can you find “video="? What do you see?

    0

  6. Tommit 3 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

    0

  7. Tommit 3 years ago

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

    0

  8. Michael Pietroforte 3 years ago

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

    0

  9. Bill 3 years ago

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

    0

  10. mrdeep 3 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.

    0

  11. tom 3 years ago

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

    0

  12. Jibraan 3 years ago

    Machine stuck at "Detecting Android-x86......"
    what to do?

    0

  13. Emmanuel 3 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?

    1+

  14. Sreenivasa Rajiv 2 years ago

    Thanks Dude !!! U r awesome

    0

  15. Tony 2 years ago

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

    0

  16. peer 2 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=1280x800
    Then the line becomes:
    ..........android _x86 video=-16 UVESA_MODE=1280x800 SRC=/android-4.4....
    And it works for me!!

    0

  17. Nataly 2 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.

    0

  18. Sigitas 2 years ago

    Thanks. Super!

    0

  19. Mahabubul Alam 2 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

    0

  20. Kevin 1 year ago

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

    Running the VM in a windows 7 environment.

    Any ideas?

    0

Leave a reply

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

*

CONTACT US

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

Sending
© 4sysops 2006 - 2017

Log in with your credentials

or    

Forgot your details?

Create Account