Latest posts by Michael Pietroforte (see all)
- Evernote backup to Dropbox - Tue, Jan 9 2018
- Install PowerShell Core and the Azure module (AzureRM) on a Mac - Tue, Dec 26 2017
- New wiki doc about changing the PowerShell console colors - Thu, Dec 21 2017
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
- 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"
I assumed here that the name of your VM is Android.
- Start the VM and, when the GRUB boot menu appears, select the Debug mode.
- Wait until the Linux boot process is completed, and then press Enter.
- At the Linux prompt, enter the following commands:
mount /dev/sda1 /boot
- Move the cursor to the first line that begins with kernel /android. In this line, search for “video= -16”.
- Press the i key (enables insert mode in the vi editor), and then type UVESA_MODE=360x640.
- Press ESC and then SHIFT+ZZ to save the new GRUB boot menu.
- Clean up and then restart the VM.
From now on, your Android VM should use the new screen 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).