12

I recently installed Ubuntu on hyper-v, But when I try to go full screen mode the Ubuntu window covers only a small portion of the screen.

I have tried editing the /etc/default/grub file and updated GRUB but still that only made it somewhat larger.

If someone know how to fix this please help me out.

Zanna
  • 69,223
  • 56
  • 216
  • 327
ElBaronRojo
  • 131
  • 1
  • 1
  • 3
  • Which version of Ubuntu are you using? Server? Presumably the BIOS being used by Hyper-V is not enabled to run everything at your display's native resolution. You can probably tell it to scale up though? But that's probably a question better asked on the Windows SE site, than here. – dobey Dec 11 '17 at 17:26

2 Answers2

15

This is an old question, but I think it is worth pointing out that it is now available for Ubuntu 18.04 and the latest Windows 10/11. Microsoft's recommendation now it to use Hyper-V Quick Create feature, see this blog post.

The instructions are originally from a blog post from Microsoft and it works with XRDP. The experience is good enough to work with it all day.

How to get it to work:

  • Create the VM, install Ubuntu (22.04 or above - see bellow for earlier versions) as you normally would;
  • Update all package dependencies to make sure you have everything up to date,
    • Run sudo apt update and sudo apt upgrade -y;
  • Make sure you enable an SSH server, so if anything goes wrong you can always get back into the VM;
  • Run on PowerShell Set-VM -VMName <your_vm_name> -EnhancedSessionTransportType HvSocket;
  • Run install.sh as root and follow instructions.

Make sure you do not enable autologin, as it breaks the whole thing.

When you connect to the VM you will be given the options to enable enhanced mode.

You can find more info using the resources linked above.

Please read bellow for more information for earlier versions of Ubuntu/Hyper-V, and also how this solution and script evolved over time.


Update from 6/4/2019:

I noticed that some admin dialogs were not being shown, and it seems it is a problem with xrdp (used in this solution) and polkit. I had to remove a config file, like so:

sudo rm /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf 

So I recommend you do the same when you finish your setup.

The answer from where I got the info is this one: https://askubuntu.com/a/1041947/832580


Update from 11/17/2021:

I noticed that on Ubuntu 21.04 (and probably 20.04), fresh install, it was not working. I changed two values in /etc/xrdp/xrdp.ini:

port=vsock://-1:3389
use_vsock=false

I had to restart the VM to get it to work, it was erroring before the restart.

It seems something changed between versions, the way vsock works is different.

I got the information from this issue:

https://github.com/microsoft/linux-vm-tools/issues/111

Also from this PR, which was never merged:

https://github.com/microsoft/linux-vm-tools/pull/106

The microsoft/linux-vm-tools was archived, so, none of this solutions is supported anymore.

Update from 7/26/2022:

I have forked Microsoft's repo and added a version for 22.04.

Giovanni Bassi
  • 251
  • 2
  • 9
  • Super helpful answer. Fixed a number of issues I was having, thanks! – Dan Feb 07 '19 at 08:55
  • This requires Win 10 1803 or newer, see https://stackoverflow.com/questions/52892821/how-can-i-enable-enhancedsessiontransporttype-on-a-hyperv-vm-using-powershell – Wollmich Feb 25 '19 at 14:03
2

Try installing and activating Linux integration services

sudo apt-get install linux-tools-3.11.0-15-generic
sudo apt-get install hv-kvp-daemon-init

also try updating the GRUB configuration file to add the parameter video=hyperv_fb:1920x1200. The line to change will look like this after your edit:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1200"

After changing this file, you need to run

sudo update-grub
sudo reboot

if none of these work, make sure to remove the remoteFX video card that might be configured for the VM.

Step-by-step

  • turn off your VM
  • in the Hyper-V manager, right-click on the VM, then click on Parameters
  • in the hardware section, if there is a 3D RemoteFX graphics card, click on it and then click on remove.
  • click OK
  • start your VM
Zanna
  • 69,223
  • 56
  • 216
  • 327
Sebastian
  • 21
  • 1
  • 2