Hyper V: Change Ubuntu Resolution

At work the only VM I can use is Hyper V due to network policies and the like. So I installed Ubuntu, fired it up and noticed the screen resolution was low. I needed it changed because this resolution was not working for me. It was a bit difficult to get work done. Enter CLI or command line interface.

Let’s Change the Resolution

  • Login to your VM

    Login to your Ubuntu VM and open up a terminal window

  • Edit Grub

    We are going to edit grub using the following command:
    Type: sudo nano /etc/default/grub then hit the ENTER key
    You will see a screen similar to this:
    Ubuntu command line screenshot
    *Note: I like using “nano” over “VI” because I can never exit the VI editor but you can use the editor of your choice, even “gedit” if you so desire

  • Change Resolution Value

    Change the value of GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:800x600", in my case 800×600, to your desired resolution. I’m going to change mine to “1440×900” then save the changes
    Ubuntu command line screenshot

  • Update Grub

    Update Grub to save your new configuration.
    Type: sudo update-grub then hit the ENTER key

  • Install linux-image-extra-virtual

    Install the linux-image-extra-virtual (extra drivers for the system) by typing the following command: sudo apt install linux-image-extra-virtual

  • Reboot VM

    Reboot the system and you should be good to go

I got the “linux-image-extra-virtual” advice from TecAdmin (https://tecadmin.net/change-screen-resolution-of-an-ubuntu-vm-in-hyper-v/) but my system already had those extra drivers installed so I skipped that step.

Now that your screen resolution is set to your liking, go create something awesome!

Tags: , ,