Ubuntu Server Screen Resolution
Updated on 11 Oct 2021
When you first go to the terminal of an Ubuntu server, you have a screen resolution of 640x480. This is woefully small and you’re thinking that you might try the VirtualBox guest additions so that you can fit the guest to the host. Unfortunately that option is only available for an OS that has a GUI. The server version requires something different.
Getting to Grub 1
When you first start the server, click on this screen and then hold down the shift
key. Be warned you will have to be quick to also deal with the dialogue box that crops up as well.
Getting to Grub 2
If the first method doesn’t work (you have to be pretty quick), then you can force the grub menu to appear at start up.
sudo vi /etc/default/grub
And make the following changes.
- comment out
GRUB_TIMEOUT
- change
GRUB_TIMEOUT_STYLE
from hidden to menu
GRUB_DEFAULT=0
#GRUB_TIMEOUT_STYLE=hidden
#GRUB_TIMEOUT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
Update grub and reboot
sudo update-grub
sudo init 6
Enter Grub
At this screen you have about 3 seconds to make your choice. Press c to enter console mode.
Video Mode
You can’t fit the guest window to the host, and you can’t pick whatever random screen resolution you want. You can only choose a predefined resolution. At the grub console type the following command to see a list of available resolutions.
vbeinfo
Update screen size in grub
Remembering the screen resolution you want from the previous screen, edit the grub file and make the following changes.
sudo vi /etc/default/grub
- add
GRUB_GFXPAYLOAD_LINUX=keep
- add
GRUB_GFXMODE=1024x768
or some other resolution that suits you.
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_GFXMODE=1024x768
Make sure to call update-grub
and reboot.
sudo update-grub
sudo init 6
And now when you reboot, you’ll have a larger screen size available in VirtualBox for your server.