Adjust Screen Resolution for an Ubuntu Hyper-V Virtual Machine

For a while I’ve been using Ubuntu 20.10 as a machine that I setup to run in Hyper-V. However, the default screen resolution of a virtual machine package is 1024×768.
Whilst this is all well and good for short term use, it can become quite tiresome and cause considerable eye strain with long-term use.
Good News! With a few simple commands in the terminal, this setting can be changed to a more suitable resolution.
Firstly, open the terminal and enter the following command:

Sudo vim /etc/default/grub

Sudo or root privileges are required to run this, otherwise the grub file opens as Read-Only and cannot be changed. Press ‘i’, this will change vim to ‘insert’ mode and allow changes to be made.
There are two lines in the grub file that need to be updated for the resolution changes to take effect.
Locate ‘grub_cmdline_linux_default=’ and ‘grub_cmdline_linux=’. Once you have found those two lines, which are located directly next to each other; update the end of each entry to add “quiet splash video=hyperv_fb:1920×1080”.
Change the resolution at the end to meet your requirements.

“quiet splash video=hyperv_fb:1920×1080”

After updating the file, press ‘esc’ followed by ‘:wq!’ (without the quotation marks), this will close vim whilst writing and saving the changes.
To complete the changes to the file, it is now time to update grub. This can be done by using the command ‘sudo update-grub’.

sudo update-grub

All the necessary sections have been updated, next time the machine reboots, it will reboot with the new resolution in place.

Ubuntu VM after grub update

Published by Daniel Wray

IT Support Engineer; Studying for CompTIA Network+. 100 Days of Python Challenge. Aspiring blogger. Passion for Learning and Teaching! https://ko-fi.com/danielwray4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: