Recently I created a Ubuntu desktop virtual machine in the Hyper-V platform. After login to the desktop realises 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:
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:
- Login to your system as a sudo or root account.
- Open a shell and edit /etc/default/grub configuration file in a text editor
sudo vim /etc/default/grub
Update the value of GRUB_CMDLINE_LINUX_DEFAULT variable as below:
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
- Now run the following command to update the grub configuration.
sudo update-grub
- 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
- 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.
Wrap Up
This tutorial helped you to change the screen resolution of an Ubuntu VM running on the Hyper-V platform.
6 Comments
Hello!
/etc/default/groub >>>> /etc/default/grub
Thanks
This does not seem to be an issue after updating to the latest Ubuntu studio distribution: 22.04 as of writing this comment. The GUI is the KDE Plasma environment and it is now listing all available resolutions in the Display settings applet.
Thank you, that was so helpful.
does not work for 2560×1440, still no full screen
Thanx for the post. Worked for me. Pity that you need to do this as some other distros you can change the resolution from the settings panel