Tag: Linux

Configure Linux Mint/Ubuntu Screen Resolution Under Hyper-V

As a .NET developer running Windows 10 I had just about given up running Linux in a virtual machine on my development machines.  Once you install Visual Studio 2012/2013/2015 with all the bells and whistles (specifically the tooling to support Windows Phone development) you end up with Hyper-V installed and configured on your system to support the Windows Phone simulators.  The obvious thing to do then is to create your VM in Hyper-V, but that results in a virtual machine running in a window @1024×768 or @ 1152×864 which is a little annoying on a 1920×1080 display.  (This is definitely workable, but it is annoying).  After poking for a while inside Linux trying to get the resolution set to 1920×1080 I decided that surely I needed virtual display drivers much like I have used in the past with VMware.   I began scouring the web for the Hyper-V equivalent of the VMware Tools.   Unfortunately I wasn’t having any luck finding what I was looking for.

If you think you might try VMware or Virtual Box along side your Hyper-V installation, think again.  Running either of these platforms along side Hyper-V is difficult due to compatibility issues.  In particular they clash around the virtual network adapters.  I was able to get this scenario to work, but it required creating scripts to disable Hyper-V and then rebooting the machine to switch between the two visualization platforms.

After doing some research I found that it was possible to get the virtual machine to boot up with your desired resolution with a little modification to your grub file,  here’s how to make it happen.

  • Install the latest version of your distro of choice (Ubuntu or Linux Mint anyway)
    • I used Mint 17.2 (Rafael) with the Cinnamon desktop for my virtual machine
  • Open up a terminal window
  • Navigate to your /etc/default directory
    • cd /etc/default
  • Open your grub file for editing as an administrator
    • sudo gedit grub
  • Find the line GRUB_CMDLINE_LINUX_DEFAULT and change it to :
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"
  • Update your grub file
    • sudo update-grub

Now just reboot your Linux virtual machine and you’re good to go.

Resources

http://nramkumar.org/tech/blog/2013/05/04/ubuntu-under-hyper-v-how-to-overcome-screen-resolution-issue/