Topics

Virtual Insider

How To Change the Resolution of an Ubuntu Hyper-V Virtual Machine

Microsoft Hyper-V is continuously improving its support for Linux distributions, but some occasional manual tweaking is necessary to accomplish tasks.

Take, for example, an installation of Ubuntu in a Hyper-V VM. If you try to change the screen resolution from the GUI, you'll find that it's impossible. This is despite the fact that there is full integration between Hyper-V VMs and Ubuntu distribution, and this integration also includes a virtual video driver.

Fortunately, there's a manual workaround that's easy to implement and which accomplishes the same objective. Follow these steps to change the screen resolution:

From within the Ubuntu virtual machine, open Terminal

Type sudo vi /etc/default/grub

Find GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Append that line with video=hyperv_fb:[specify resolution, e.g. 1024x768]

Here is what it might look like: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1024x768"

Save changes and exit

Run the following command: sudo update-grub

Restart the VM

This is a simple workaround that allows you to customize the screen resolution of an Ubuntu installation inside a Hyper-V VM. As always, there are many different ways of updating files in Linux distribution; I'm simply offering one of those methods. If you have other tips, share them in the comments section so others can benefit from your knowledge.