How can I make Ubuntu run full screen in hyper-v?
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.
Solution 1:
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. The instructions are in this blog post from Microsoft and 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 (18.04 or above) as you normally would;
- Update all package dependencies to make sure you have everything up to date,
- Run
sudo apt update
andsudo apt upgrade -y
;
- Run
- 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 on the blog post linked above.
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.
Solution 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