How to run HyperV Ubuntu VM in full screen

  • 24 November 2020
  • ADM

 

How to run HyperV Ubuntu VM in full screen - images/logos/windows.jpg

 

When I installed Ubuntu Desktop in HyperV, the VM was running with a 1152x864 screen resolution and I could not get the machine to run full screen. The max resolution that hyperv_fb is supporting is 1920x1080.

Solution

The solution is to update the /etc/default/grub settings to allow higher resolutions.

Step 1 - Open terminal

How to run HyperV Ubuntu VM in full screen - /images/hypervUbuntu001.jpg

Step 2 - Edit grub file

Type into the terminal the following command:

$ sudo vi /etc/default/grub

Edit mode

Press i to enter edit mode. This will be marked by the -- INSERT -- line at the bottom of the terminal.

How to run HyperV Ubuntu VM in full screen - /images/hypervUbuntu002.jpg

GRUB_CMDLINE_LINUX_DEFAULT

Search for GRUB_CMDLINE_LINUX_DEFAULT variable and add at the end video=hyperv_fb:1920x1080.

Note: the max resolution that hyperv_fb is supporting is 1920x1080.

The full line will look line this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"

How to run HyperV Ubuntu VM in full screen - /images/hypervUbuntu003.jpg

Exit edit mode

Press Esc to exit the edit mode.

Save file

Type :wq  followed be Enter to save the file.

Reload the settings

Run the following command:

code class="bash">$ sudo update-grub
[sudo] password for adrian: 

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/40-force-partuuid.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-54-generic
Found initrd image: /boot/initrd.img-5.4.0-54-generic
Found linux image: /boot/vmlinuz-5.4.0-48-generic
Found initrd image: /boot/initrd.img-5.4.0-48-generic
Adding boot menu entry for UEFI Firmware Settings
done

Restart

Restart your VM, Ubuntu should run now in full screen mode.

 

References