Ubuntu Hyper-V Guest Display Resolution

85,968

Solution 1

I had the same issue and when I was looking for help I remember seeing your post. Now when I finally got it to work I might as well document it here:

  1. Upgraded linux-image and headers sudo apt-get install linux-image-3.11.0-15-generic linux-headers-3.11.0-15-generic (Perhaps virtual would work just as well as the generic one.):

  2. Installed linux-image-extras with the hyperv-drivers: sudo apt-get install linux-image-extra-virtual

  3. Set video mode (Pretty much what you already did):
    Set GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1680x1050" in /etc/default/grub.

  4. Update grub: sudo update-grub
  5. Reboot

I guess the critical part was installing the updated hyperv-drivers with linux-image-extra-virtual. Also make sure they are loaded.

Solution 2

copat's answer worked for me, but only after I changed my resolution down from 1920x1200 to 1920x1080.

Looking in the Linux source file hyperv_fb.c there is the comment: "This is the driver for the Hyper-V Synthetic Video, which supports screen resolution up to Full HD 1920x1080 with 32 bit color on Windows Server 2012, and 1600x1200 with 16 bit color on Windows Server 2008 R2 or earlier."

Solution 3

Since this question was asked (in 2013) things have progressed significantly with regards to Hyper-V & Ubuntu 18.04.1 with regards to ‘Enhanced Session Mode’.

There are two approaches currently:

A) New System

Optimized Ubuntu Desktop images available in Microsoft Hyper-V gallery

B) Existing System

Manually configure xRDP to support ‘Enhanced Session Mode


Here are the details:

Option A)

  1. In Hyper-V, on your server & select [Quick Create]
  2. In the [Create Virtual Machine] dialog, select [Ubuntu 18.04.1 LTS] && then [Create Virtual Machine]
  3. Then complete the standard Ubuntu installation options
  4. ‘Enhanced Session Mode’ will prompt you to setup screen resolution, local resources, etc.
  5. Note/Caution ~ if you have problems using drives, then you may want to de-select the [Printers]

Here are the links to where I sourced the information:

Optimised Ubuntu Desktop images available in Microsoft Hyper-V gallery

Run Ubuntu virtual machines made even easier with Hyper-V Quick Create

Option B)

  1. Modify Ubuntu 18.04 to use xrdp

    1.1 Get the scripts from GitHub

    sudo apt-get update
    sudo add-apt-repository ppa:git-core/ppa
    sudo apt update; sudo apt install git
    git clone https://github.com/jterry75/xrdp-init.git ~/xrdp-init
    

    1.2 Make the scripts executable and run them...

    cd ~/xrdp-init/ubuntu/18.04/
    sudo chmod +x install.sh
    sudo ./install.sh
    reboot
    

    1.3 <After Reboot> Run script again to finish setting up VM

    cd ~/xrdp-init/ubuntu/18.04/
    sudo ./install.sh
    
  2. Shutdown Ubuntu VM

  3. Register Ubuntu Session ~ run this command on host PC using powershell with admin rights:

    Set-VM -VMName YourUbuntuVMNameHere -EnhancedSessionTransportType HvSocket
    
  4. Restart VM

  5. Connect/Login to XRDP from Hyper-V (note ~ enter username - must be lowercase)

  6. Note/Caution ~ if you have problems using drives, then you may want to de-select the [Printers]


Here is the link to where I sourced the information:

Solution 4

I did all this without success, and then I tried fiddling with the Hyper-V settings.

I increased the RAM for video to 512K and also deleted the 3D driver.
This worked for me.

Share:
85,968

Related videos on Youtube

user221048
Author by

user221048

Updated on September 18, 2022

Comments

  • user221048
    user221048 over 1 year

    Good afternoon,

    I am trying to set up an Ubuntu guest on a Hyper-V server. I am relatively new to Linux so please bear with me, the VM is a test machine to get the hang of things and give Ubuntu a try. One of the new features of Server 2012 R2 is the improved display capabilities as mentioned here at blogs.technet.com

    I don't think I am alone in finding this doesn't "just work". Some advice found online suggests updating the kernel, which I have done to 3.11.6 as described in one post, and to the latest 3.12.1. In both cases I could only see resolutions listed under the display options up to 1152x864, which is what Linux has always been limited to under Hyper-V.

    Another clue was found in the next link (in Japanese) - the poster has added "video=hyperv_fb:1920x1080" to /boot/grub2/grub.cfg. When I went to repeat this I noted the message about not editing /boot/grub2/grub.cfg directly so I have added the line in /etc/default/grub instead.

    yamanxworld.blogspot.co.uk

    This has not given the option for the full 1920x1080 resolution either, and at this point I have run out of things to try and would not know if this is now a Hyper-V issue or something more fundamental and this would not have worked on a physical or other hypervisor machine.

    If anyone can shed some light I would be most grateful.

  • Jerad Rose
    Jerad Rose over 8 years
    This works, but for those on 1920x1200 monitors, you have to drop it down to 1920x1080 to get it to work (I had originally missed the answer below, so thought a comment here might be seen quicker for some).
  • SeveQ
    SeveQ over 7 years
    The given "make sure..." link is 404
  • user9993
    user9993 over 6 years
    Is this still the case with 17.04?
  • oikonomopo
    oikonomopo over 5 years
    Don't forget to remove from your VM settings the remotefx card (If enabled for some reason)!
  • Charles Green
    Charles Green over 5 years
    What exactly is 'grubby' and where did you obtain it from? There seems to be no package or file with this name in https://packages.ubuntu.com
  • temarsden
    temarsden about 5 years
    Thank you! I would say option A) of your answer, using the optimized desktop images, is the best advice if you're starting with a fresh instance.
  • Carolus
    Carolus over 4 years
    @CharlesGreen It seems that grubby is a tool only available to RPM-based distros (Red Hat, etc). CTRL+F "Ubuntu" here.