{"id":64,"date":"2013-05-04T20:06:09","date_gmt":"2013-05-05T04:06:09","guid":{"rendered":"http:\/\/nramkumar.org\/tech\/?p=64"},"modified":"2014-08-16T22:45:06","modified_gmt":"2014-08-17T06:45:06","slug":"ubuntu-under-hyper-v-how-to-overcome-screen-resolution-issue","status":"publish","type":"post","link":"https:\/\/nramkumar.org\/tech\/blog\/2013\/05\/04\/ubuntu-under-hyper-v-how-to-overcome-screen-resolution-issue\/","title":{"rendered":"Ubuntu under Hyper-V &#8211; How to overcome screen resolution issue"},"content":{"rendered":"<p>Recently, I got a new SSD (<a title=\"Sandisk SSD\" href=\"http:\/\/www.newegg.com\/Product\/Product.aspx?Item=N82E16820171741\" target=\"_blank\">Sandisk 256 GB<\/a> in case you&#8217;re wondering) and as part of setting it up, I decided to clean install Windows 8 instead of moving my existing Windows 7 setup over. One of the things I wanted to try out was the integrated Hyper-V support in Windows 8 to host my Ubuntu VM instead of using VMWare Player. Windows 8 Pro has native Hyper-V but you&#8217;ll need to turn it on from Control Panel\/Programs\/Turn Windows features on or off. Please note that if you turn on Hyper-V you cannot install VMWare Player on the machine. You will need to turn off Hyper-V if you need to install VMWare Player &#8211; the two cannot co-exist as of now.<\/p>\n<p>One of the first tasks I needed to accomplish was to migrate the existing VMWare Ubuntu VM hard-disk to Hyper-V. You can do this using 2Tware convert VHD (available <a title=\"2TWare Convert VHD\" href=\"http:\/\/www.2tware.com\/product\/6\/2tware+convert+vhd+free\" target=\"_blank\">here<\/a>). Using this freeware, you can convert the VMWare disk into VHD format. Now all I needed to do was setup a new VM in Hyper-V and attach the VHD to this VM. Everything worked remarkably well &#8211; Microsoft has released Linux drivers for running Linux VMs under Hyper-V and Ubuntu LTS 12.04 has these drivers as part of the image. So my old VM worked flawlessly on Hyper-V (networking was fine, mouse and keyboard were mostly fine).<\/p>\n<p>There was one hitch however &#8211; the maximum resolution of X in my VM was set to 1152&#215;864. Turns out the current video support for Linux in Hyper-V only allows a maximum resolution of 1152&#215;864 (basically you&#8217;re using the VESA framebuffer video driver as there&#8217;s no synthetic video driver for Hyper-V yet). The good news is that Microsoft has already added the synthetic video driver with resolution support for upto 1900&#215;1200 to the Linux kernel. However, it is going to be a while before this shows up in a LTS Ubuntu distribution. In the meantime, a much better solution exists for working with your Linux VM from your Windows machine &#8211; note that this tip actually applies to both VMWare and Hyper-V and for the most part, I prefer this setup over running the VM full-screen.<\/p>\n<p>The trick consists of the following steps:<\/p>\n<ol>\n<li><span style=\"line-height: 13px;\">Run PuTTY to establish an SSH session with your VM. Enable tunneling of X over SSH in the PuTTY options<\/span><\/li>\n<li>Run an X server on your windows machine &#8211; <a title=\"xming\" href=\"http:\/\/sourceforge.net\/projects\/xming\/\" target=\"_blank\">xming<\/a> is what I use. It works with no configuration hassle.<\/li>\n<li>Now you can launch any X program from your PuTTY session and it will show as a native window in your Windows machine.<\/li>\n<\/ol>\n<p>With this setup, I interact with the VM much better (this is very similar to, but IMO better than VMWare&#8217;s Unity mode). Of course, if you really want a Linux Window Manager and a richer environment like KDE or Gnome or Unity you&#8217;ll need to configure xming so you run it in one window mode. For me, since I mostly work in the Linux terminal, gvim and xemacs, the multi-window mode is much more useful.<\/p>\n<p><strong>Update 8\/16\/2014<\/strong><\/p>\n<p>Finally updated one of my VMs to Ubuntu 14.04 &#8211; the resolution was still stuck at 1152&#215;864. A quick check of loaded modules with lsmod showed that the hyper-v synthetic frame buffer driver hyperv_fb was loaded. A brief search helped me figure out that I needed to pass in a kernel option at boot. So to get the higher resolution, add this to \/etc\/default\/grub:<\/p>\n<p><code>GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash video=hyperv_fb:1920x1080\"<\/code><\/p>\n<p>Then run sudo update-grub and reboot your VM and now you should be able to get your VM at 1920&#215;1080 resolution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I got a new SSD (Sandisk 256 GB in case you&#8217;re wondering) and as part of setting it up, I decided to clean install Windows 8 instead of moving my existing Windows 7 setup over. One of the things I wanted to try out was the integrated Hyper-V support in Windows 8 to host&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,23,6],"tags":[69,70,24,62,26,25],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-configuration","category-hyper-v","category-ubuntu","tag-configuration","tag-hyper-v","tag-resolution","tag-ubuntu","tag-x","tag-xming"],"_links":{"self":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":2,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/64\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}