Ubuntu Hyper-V Guest Console Resolution

Changing the Ubuntu console resolution when running as a Guest OS in Hyper-V can be a bit of a pain. Here’s how to do it in Ubuntu 14 – 16:

  1. Open Terminal if you are in your desktop environment
  2. Type
    sudo nano /etc/default/grub
  3. Look for the line
    GRUB_CMDLINE_LINUX_DEFAULT=""
    and append:
    video=hyperv_fb:(your_resolution_here)
    so that it looks something like:
    GRUB_CMDLINE_LINUX_DEFAULT="video=hyperv_fb:1024x768"
  4. Uncomment the line
    #GRUB_GFXMODE=
    and append your desired resolution with colour depth:
    1024x768x32
    So that it looks like:
    GRUB_GFXMODE=1024x768x32
    Note: there are no quote marks on this line.
  5. Immediately below
    GRUB_GFXMODE
    add a new line:
    GRUB_GFXPAYLOAD=1024x768x32
  6. Exit nano and save the file
  7. Now the important part is to update your GRUB configuration. Type:
    sudo update-grub
  8. Reboot the VM

At this point it wouldn’t be a bad idea to install the Hyper-V Integration Services for Linux.

  1. At the terminal type:
    sudo nano /etc/initramfs-tools/modules
  2. Add the following modules at the end of the file:

    hv_blkvsc
    hv_netvsc
    hv_storvsc
    hv_vmbus

  3. Save and exit the file.
  4. Next install the actual Integration Services packages by issuing the following commands:
    sudo apt-get install --install-recommends linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial
  5. Then:
    update-initramfs -u
  6. Finally, reboot the VM once again.

Ross

Leave a Reply

Your email address will not be published. Required fields are marked *

AlphaOmega Captcha Classica  –  Enter Security Code