How to resize Android screen in VirtualBox with UEFI? 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?
The following steps should resolve the issue, although I can't test on VirtualBox.

Temporarily:


Upon booting the virtual machine, press F10 once the boot screen appears
Press e to edit the boot command
Navigate to the end of the last line and press Enter
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)


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

mkdir /mnt/boot
mount /dev/block/vda1 /mnt/boot
vi /mnt/boot/boot/grub/grub.cfg

from the Vi editor, press i to enter Insert mode
navigate to the end of the last line before the } symbol from the first section (should be line #7)
press Enter and do Step 4 from the "Temporary" part of my answer
Press Esc to exit Insert mode
Type in :wq and press Enter to exit Vi
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.