VirtualBox is my virtualization software of choice. It is free and feature-rich, so all my virtual machines are created in VirtualBox.
Sometimes you need to set the exact display resolution which is not listed in the guest OS settings. While you can achieve this by resizing the VM's window, it is a waste of time. Here is how you can do it quickly.
Let's say I want to set the display resolution in my Windows 10 VM to 1366x768. As you can see, it is not listed in available display modes in my setup:
To bypass this limitation, you need to use the VBoxManage tool, which is a console application to tweak virtual machines on the fly and offline. Our readers might be familiar with this tool from the article How to resize a VirtualBox HDD image (VDI).
You need to execute the following commands:
VBoxManage setextradata global GUI/MaxGuestResolution any VBoxManage setextradata "Machine Name" "CustomVideoMode1" "Width x Height x Bpp" VBoxManage controlvm "Machine Name" setvideomodehint Width Height Bpp
The first command unlocks all possible display resolutions for virtual machines.
The second command defines a custom video mode for the specific virtual machine with name "Machine Name".
Finally, the third command sets this custom video mode for your virtual machine.
You must run these commands after the virtual machine has been started, when the guest operating system is ready to use and its Guest Additions are installed properly and loaded.
In my case, I need to execute the following commands:
VBoxManage setextradata global GUI/MaxGuestResolution any VBoxManage setextradata "Windows 10 build 14352" "CustomVideoMode1" "1366x768x32" VBoxManage controlvm "Windows 10 build 14352" setvideomodehint 1366 768 32
Under Linux, VBoxManage is accessible from any opened terminal/console.
Under Windows, you need to open a new command prompt window in the folder C:\Program Files\Oracle\VirtualBox. See the following article: All ways to open the command prompt in Windows 10, and the part "Run the command prompt directly from Explorer".
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!