Tuesday, December 24, 2013

Running Ubuntu full screen under Hyper V 2012

There is no way through the GUI to configure the screen resolution of an Ubuntu guest to run full screen when running under Hyper V 2012 (on Server 2012 / 2012 R2 or Windows 8 / 8.1).

One way to get Ubuntu running full screen is to hard-code the resolution of your monitor as a Linux kernel parameter. My monitor runs at 1680x1050, so I made the following changes to my Ubuntu 13.10 guest:


  1. Edit the grub configuration file, for example:
    sudo vi /etc/default/grub
     
  2. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT, and add "video=hyperv_fb:1680x1050" (or your custom resolution) in between the quotes. For example: 
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1680x1050"
  3. Save and exit 
  4. Run 
    sudo update-grub
  5. Restart your computer


If you get an error dialog warning about not being able to apply the video mode when logging into the GUI, use the Ubuntu control panel to change the screen resolution to your chosen custom resolution.

12 comments:

  1. Thanx for the How-to. Finally I was able to make it working.

    ReplyDelete
  2. Thanks alot :) that works for me

    ReplyDelete
  3. Thanks! Helped me... but it's very slow (Ubuntu 14.04 guest, Windows 8 Pro host) ... Any idea?

    ReplyDelete
    Replies
    1. Good question. Performance and resolution is supposed to have been improved by the new synthetic frame buffer that Microsoft contributed to Linux, but I haven't had any success with it. I see there are quite a few bug reports relating to this functionality, so hopefully the Microsoft Linux developers pick up on those soon and we can stop using workarounds like I have posted here.

      Delete
  4. Thank you very much. It helped me. Thanks.

    ReplyDelete
  5. Fantastic! It also helped me a lot! :) Cheers!

    ReplyDelete
  6. Works great. Such a simple solution and it took so much effort to find. Thanks.

    ReplyDelete
  7. Once the edits have been made to the file, how do you "Save and Exit"?

    ReplyDelete
    Replies
    1. If you've managed to make the changes, you can enter:
      :wq

      Have a look at a basic vi tutorial like this one for more detail: https://www.cs.colostate.edu/helpdocs/vi.html.

      Don't forget to run as root (e.g. via sudo), otherwise you won't be able to save the changes.

      Delete