In this article, we will be discussing various ways to improve the performance of Ubuntu 20.04 LTS when running on Hyper-V Manager. This includes steps such as blacklisting certain modules, upgrading to a newer kernel version, and using the HWE kernel.
To improve Ubuntu 20.04 performance on Hyper-V Manager, you can blacklist the "hyperv_fb" module, upgrade to a newer kernel version (such as the HWE kernel), or use the legacy vesafb or efifb drivers. These steps can help alleviate sluggishness and improve the user interface experience.
Understanding the Problem
Ubuntu 20.04 LTS, when running on Hyper-V, can sometimes experience a sluggish or slow user interface. This can be due to various reasons, but primarily it’s because of the “hyperv_fb” module. This module is responsible for the Hyper-V synthetic framebuffer driver, which can sometimes cause performance issues.
Blacklisting the “hyperv_fb” Module
One of the easiest ways to improve the performance of Ubuntu 20.04 on Hyper-V is by blacklisting the “hyperv_fb” module. This can be done by adding the line
blacklist hyperv_fb to the
To do this, you can run the following command:
sudo nano /etc/modprobe.d/blacklist.conf
This command opens the
blacklist.conf file in the nano text editor with superuser permissions. Once the file is open, add
blacklist hyperv_fb at the end of the file, save and exit.
After you have made these changes, you will need to reboot your system for the changes to take effect.
Upgrading to a Newer Kernel Version
Another way to improve the performance of Ubuntu 20.04 on Hyper-V is by upgrading to a newer kernel version. The issue with the slow UI has been fixed in the Linux mainline kernel, so upgrading to either the generic 5.4 kernel or the HWE kernel that includes the fix is recommended.
To upgrade to the HWE kernel, you can use the following command:
sudo apt install linux-generic-hwe-20.04
This command installs the HWE (Hardware Enablement) kernel for Ubuntu 20.04. The HWE kernel provides newer kernel and X support for existing Ubuntu LTS releases, allowing users to get the latest hardware support without needing to install a newer version of Ubuntu.
Using the Legacy vesafb Driver or the efifb Driver
If you are unable to upgrade your kernel immediately, you can improve performance by using the legacy vesafb driver (for Generation-1 VMs) or the efifb driver (for Generation-2 VMs).
For Generation-1 VMs, you can add the kernel parameter
video=vesafb:mtrr:3. This parameter tells the kernel to use the vesafb driver and sets the Memory Type Range Register (MTRR) type to write-combining (WC), which can improve performance.
Improving the performance of Ubuntu 20.04 LTS on Hyper-V can be achieved by blacklisting the “hyperv_fb” module, upgrading to a kernel version with the fix, or using the HWE kernel. However, individual results may vary, and further troubleshooting or assistance may be required.
Remember to always backup your data before making any major changes to your system. If you encounter any issues or need further assistance, don’t hesitate to seek help from the Ubuntu community or the Hyper-V forums.
You can check the kernel version by opening a terminal and running the command
uname -r. It will display the version number of the kernel currently running on your system.
Yes, you can revert the changes made to the
blacklist.conf file by removing the line
blacklist hyperv_fb that you added earlier. Simply open the file using a text editor with superuser permissions, remove the line, save, and exit. Then reboot your system for the changes to take effect.
To upgrade to a newer kernel version, you can use the command
sudo apt update && sudo apt upgrade. This command will update all the installed packages on your system, including the kernel. After the upgrade is complete, reboot your system to start using the new kernel version.
No, the legacy vesafb driver is only compatible with Generation-1 VMs, while the efifb driver is compatible with Generation-2 VMs. You need to determine the generation of your VM and use the appropriate driver accordingly.
Upgrading to a newer kernel version usually does not pose any significant risks. However, it is always recommended to backup your important data before making any major changes to your system. In rare cases, there may be compatibility issues with certain hardware or software, but these are generally uncommon.