12

Ubuntu 20.04 LTS installed with Hyper-V Manager. I have assigned it 4 processor cores and 12GBs of RAM. I have run through several forums and tutorials and I haven't found any solution that would actually help with the issue. The performance is so sluggish, it's making usage of the VM unbearable. I'd love things to run smoothly - moving the cursor, opening windows, scrolling etc.

i-7 8700K, 32GB, Intel UHD Graphics 630, SSD

I'd appreciate any help.

4 Answers 4

7

On Ubuntu 20.04 do the following:

  1. Run:

    sudo nano /etc/modprobe.d/blacklist.conf
    
  2. Add the following line at the end of the file:

    blacklist hyperv_fb
    
  3. Save (Ctrl+X then Y)

  4. Reboot.

The refresh rate should be much better.

2
  • 1
    This seems to improve the behaviour but my screen resolution changes to 1024x768 even though I have it as 1920x1080 in GRUB_CMDLINE_LINUX_DEFAULT May 22, 2021 at 18:36
  • @George Vovos, here is a link I used to change the resolution, just wanted to be sure that the line says GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080" May 11, 2022 at 12:41
3

I wish I would have seen this question earlier. I'm sorry that you have been affected for a long time. :-(

This is a known issue (please refer to https://github.com/LIS/lis-next/issues/655) which has been fixed in the Linux mainline kernel since last Nov (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f1251a48c17b54939d7477305e39679a565382c).

For Ubuntu 20.04, as I just checked, the latest linux-azure kernel Ubuntu-azure-5.4.0-1039.41 (Jan 18) still does not have the fix, but the generic 5.4 kernel Ubuntu-5.4.0-66.74 and the HWE kernel Ubuntu-hwe-5.8-5.8.0-44.50_20.04.1 already have the fix. You probably want to upgrade to either of the two kernels that have the fix.

If you can't upgrade your kernel immediately, there is a workaround: please blacklist the Hyper-V synthetic framebuffer driver (the file location can be found by "modinfo hyperv_fb"), and then Linux will automatically use the legacy vesafb driver (if it’s a Generation-1 VM) or the efifb driver (if it’s a Generation-2 VM); if it’s a Generation-1 VM, please also add the kernel parameter "video=vesafb:mtrr:3", which tells the legacy framebuffer driver "vesafb" to map the legacy framebuffer cacheable. The rationale of the workaround is that the legacy vesafb/efifb drivers are fast since they map (or can be instructed to map) the framebuffer cacheable.

3
  • When I upgrade to 5.4.0-66-generic I can't boot anymore. When I upgrade to the newest (5.4.0-91-generic) it still feels like 15 FPS, but youtube videos feel a little more performant than before. But still not berable.
    – fabpico
    Dec 18, 2021 at 14:24
  • Probably you can try the v5.11-based linux-azure kernel by "apt install linux-azure". I suspect the v5.4-based kernel is not so well-maintained for a Linux VM running on Hyper-V.
    – Dexuan
    Dec 19, 2021 at 23:04
  • I did apt install linux-azure, it resulted in 5.11.0-1022-azure, but still feels like 15 FPS.
    – fabpico
    Dec 20, 2021 at 21:04
1

to change the resolution back to 1920:

Set-VMVideo -VMName "Name of VM in Manager" -HorizontalResolution 1920 -VerticalResolution 1080 -ResolutionType Single

(https://learn.microsoft.com/en-us/answers/questions/341631/how-to-adjust-virtual-machine-display-resolution-t)

0

As an example how to use the HWE kernel for Ubuntu 20.04 with the mentioned kernel fix above:

sudo apt install linux-generic-hwe-20.04

Works like a charm!

2
  • This results in 5.11.0-43-generic, and still feels like 15 FPS. Any ideas why it still feels like 15 FPS?
    – fabpico
    Dec 18, 2021 at 14:36
  • this doesn't work, comes already in linux-image-extra-virtual and wont fix it.. still going like 15fps, tested on 22.04 Mar 27, 2023 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .