Use Xrandr to choose resolution in VirtualBox

Find your output

This should return something like:

You may notice popular options like 1920x1080 and 2560x1440 are not available. This is because Linux hates you.

Adding a mode for your resolution

Example for 1920x1080

NOTE Fix blank screen for 2560x1440, make sure you give the max amount of video memory available under: Settings -> Display -> Video Memory

I'm going to be copy pasting something here because I can't be bothered to rewrite this:

First we need to get the modeline string for xrandr Luckily, the tool gtf will help you calculate it. All you have to do is to pass the resolution & the- refresh-rate as the command parameters:

In this case, the horizontal resolution is 1920px the vertical resolution is 1080px & refresh-rate is 60Hz. IMPORTANT: BE SURE THE MONITOR SUPPORTS THE RESOLUTION

Typically, it outputs a line starting with "Modeline" e.g. "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync Copy this entire string (except for the starting "Modeline")

Now, use "xrandr" to make the system recognize a new display mode. Pass the copied string as the parameter to the --newmode option:

Well, the string within the quotes is the nick/alias of the display mode - you can as well pass something as "MyAwesomeHDResolution". But, careful! :-|

Then all you have to do is to add the new mode to the display you want to apply, like this:

Virtual1 is the display name, it might differ for you. Run "xrandr" without any parameters to be sure. The last parameter is the mode-alias/name which you've set in the previous command (--newmode)

It should add the new mode to the display & apply it. Usually unlikely, but if it doesn't apply automatically then force it with this command:

The option should also now be available in your display settings on gnome for instance.

Persisting the resolution

This resolution will not be available to you after reboot

To make it available add the following to /etc/X11/xorg.conf.d/10-monitor.conf

Resources

Xrandr Answer on Stack Exchange

archwiki xrandr

Useful script

xrandr.sh (just in case the gist goes down)


Tagged in linuxvirtualbox