How to Change Screen Resolution of An Ubuntu VM in Hyper-V

Recently I created a Ubuntu desktop virtual machine in the Hyper-V platform. After login to the desktop realizes that the screen resolution is not correct. I tried to change VM to full-screen mode but it opens in partial screen. When I checked the resolution under the settings found below:

Checking the Ubuntu Screen Resolution under Hyper-V
Current Screen Resolution of Ubuntu on Hyper-V


This how-to guide will help you to change the screen resolution of an Ubuntu VM in Hiper-V. This also allows you to run Ubuntu VM in full-screen mode in Hiper-V.

Changing Screen Resolution in Hyper-V Ubuntu VM

Follow the instructions to change the screen resolution of an Ubuntu VM in Hyper-V:

  1. Login to your system as a sudo or root account.
  2. Open a shell and edit /etc/default/groub configuration file in a text editor
    sudo vim /etc/default/grub 
    

    Update the value of GRUB_CMDLINE_LINUX_DEFAULT variable as below:

  1. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1366x768"
    

    Here 1366×768 is the screen resolution of the host machine. You need to change this value as per your host machine resolution

  2. Now run the following command to update the grub configuration.

  3. sudo update-grub 
    
  4. Also install the linux-image-extra-virtual package that provides the extra drivers which is not included in base kernel.
    sudo apt install linux-image-extra-virtual 
    
  5. Reboot your system and test

Once the system is rebooted, log in to the Ubuntu desktop and change to full screen. You will see the Ubuntu desktop open in full screen.

Now, check the updated screen resolution of Ubuntu running on the Hyper-V platform.

Change Screen Resolution  in Ubuntu Running on Hyper-V
Updated Screen Resolution in Ubuntu Running on Hyper-V

Change screen resolution of Ubuntu VM in Hyper-V

  1. Open a Terminal
  2. Enter sudo nano /etc/default/grub
  3. Alter the line starting with GRUB_CMDLINE_LINUX_DEFAULT to add the resolution setting
  4. Alter the line starting with GRUB_CMDLINE_LINUXT to add the resolution setting
  5. Run sudo update-grub
  6. Shut down the VM

Wrap Up

This tutorial helped you to change the screen resolution of an Ubuntu VM running on the Hyper-V platform.

Next Post Previous Post
No Comment
Add Comment
comment url