In one of my earlier posts, I talked about setting up a home lab comprising of Ubuntu Desktop/Server, CentOS, RHEL, and OpenSUSE VMs on a high-end Windows 10 Box through Hyper-V.
Since I have three 4K and one HD monitors in my Home lab, I wanted to change the screen resolution of all these Linux distros beyond the default low resolution (1152×864) I got out-of-box when setup on Hyper-V VMs.
Now when we set up any Linux VMs on Hyper-V, we automatically get all the integration components and virtualized drivers Including the Hyper-V video driver. However, if we try to change screen resolution from inside our VMs, we are unable to do so. This is a strange limitation, which continues to persist until date.
The only way possible right now is to manually change screen resolution for Linux VMs in Hyper-V.
Let’s see this manual process to change the screen resolution for CentOS and RHEL VMs running on Hyper-V within Windows 10:
- Open Terminal
sudo grubby --update-kernel=ALL --args="video=hyperv_fb:1920x1080"
- Reboot the virtual machine
Here we use the “grubby” tool to update all current and future kernels, passing the video argument for the Microsoft Hyper-V Synthetic Video Frame Buffer driver with the new screen resolution we want to set. Doing the aforementioned change modifies the grub configuration within the file
You can see the screenshot of the modified /boot/grub2/grub.cfg file and the relevant sections, shown below:
Please note that the maximum resolution you can set today stands at 1920×1080, and cannot be extended beyond that threshold. This is a limitation of the Hyper-V video driver as you can see in the source for the same here: https://patchwork.kernel.org/patch/2149401/
Hope this post is useful to you. In case you have any questions, please feel free to comment below.