1

I have 64-bit Android 7.1.2, obtained from android-x86_64-7.1-rc1.iso. I installed it on VirtualBox (latest version, 5.1.2.8) with UEFI mode. (The host is 64-bit Linux Lubuntu 16.04.)

The installation all works fine apart from the fact that the screen is fixed at 1024×768. The various sizes given in the VirtualBox menu > View > Virtual Screen 1, which range from 640×480 to 1920×1200, are all greyed out.

I would like to be able to resize the Android screen, making it both smaller and larger, and even full-screen if possible. Sadly, the usual method, Guest Additions, isn't supported on Android.

I've tried following various instructions. The vast majority seem to be valid only for non-UEFI installations, although I tried them anyway. The only one for UEFI that I found doesn't work for me.

The methods that I have found include:

  • Issue the command:
    vboxmanage setextradata Android CustomVideoMode1 1152x864x32
    (this obviously would work only for that one resolution).

  • Adding various commands to Grub, either at boot or permanently in EFI/boot/grub/grub.cfg:

    • set gfxpayload=keep
    • set gfxpayload=1152x864x32
    • vga=ask
    • vga=834

I am at a total loss how to proceed. Can you help, please?

1 Answer 1

1

The following steps should resolve the issue, although I can't test on VirtualBox.

Temporarily:

  1. Upon booting the virtual machine, press F10 once the boot screen appears
  2. Press e to edit the boot command
  3. Navigate to the end of the last line and press Enter
  4. Press Tab to insert indentation, and type in:

    set gfxpayload=1440x900 

The resulting boot command should now be:

setparams 'Android-x86 2017-12-16' search --set-root --file /android-2017-12-16/kernel linux /android-2017-12-16/kernel quiet root=/dev/ram0 androidboot.s\ elinux=permissive buildvariant=userdebug initrd /android-2017-12-16/initrd.img set gfxpayload=1440x900 

Of course, the actual kernel date and time, as well as the resolution you want to set, should differ.

Press either Ctrl + x, or F10, to boot.

Note that there is no need for the trailing x32 in the resolution value. But from my testing, it should work with it as well.


Permanently:

(needs root)

  1. From the Terminal Emulator, type in su to gain administrative privileges
  2. run the following commands:

    mkdir /mnt/boot mount /dev/block/vda1 /mnt/boot vi /mnt/boot/boot/grub/grub.cfg 
  3. from the Vi editor, press i to enter Insert mode
  4. navigate to the end of the last line before the } symbol from the first section (should be line #7)
  5. press Enter and do Step 4 from the "Temporary" part of my answer
  6. Press Esc to exit Insert mode
  7. Type in :wq and press Enter to exit Vi
  8. Back in the terminal emulator, execute:

    umount /mnt/boot 

    optionally, also execute rmdir /mnt/boot.

It's done.


Let me know what problems you were having, exactly, if possible. There is a chance that your virtual machine does not have enough Graphics Memory to support the resolution you want. Check this answer, also from me: https://android.stackexchange.com/a/160371/57668.

3
  • Marc, thank you for your reply. Unfortunately, I had already given up and reinstalled without UEFI. However, I had at the time already tried with the gxfpayload without success (there was something similar that I also tried, though I forget now what it was). It seemed that VirtualBox simply didn't support Android well. I read elsewhere that I should try a different package such as VMWare, but I wasn't going to learn a new package. Anyway, thank you for your effort and answer. Commented Dec 16, 2017 at 22:45
  • @PaddyLandau You're welcome, man. If I can also make a suggestion: in the future, consider giving virt-manager a try. It's a tool developed by RedHat and distributed freely, that makes creating, managing and using virtual machines very straightforward. I find it much simpler than VirtualBox, in all fairness. Commented Dec 17, 2017 at 1:07
  • With android 7.1,virt-manager and kvm-qemu with uefi..doesn't work,start only at 1024x768 Commented Sep 9, 2018 at 9:57

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.