virtualization – Guide – How to Get Ubuntu Running on Windows Hyper V with Enhanced Session, Fullscreen and Copy/Paste

I’m writing a guide to install a working Linux VM in Hyper V after finding Fedora either fails to boot or does not have fullscreen support and runs slugglishly because of missing enhanced session which Microsoft haven’t developed.

Hyper V is only supposed to offer native OS performance for Arch and Ubuntu variants because other “emulated devices do not provide high performance and cannot leverage the rich virtual machine management infrastructure that the Hyper-V technology offers. In order to make full use of all benefits that Hyper-V provides, it is best to use Hyper-V-specific devices for Linux and FreeBSD.”

You can see vm-tools is out of date however we’ll use a user update (you can see Arch and Ubunutu only): https://github.com/microsoft/linux-vm-tools

Create VM

Disable secure boot

Add Guest Services under settings

Install OS – Xubuntu or Ubuntu recommended (see notes at bottom)

Boot and when on desktop install updates, restart/return and open terminal.

Replace kernal with Azure: Enhanced Session Mode not working – Hyper-V Guest

Optional if you have a previous azure kernal installed:

sudo apt purge -y linux-azure

sudo apt autoremove -y –purge

Begin with:

sudo apt install -y linux-azure

sudo update-initramfs -u

Reboot

Source: https://old.reddit.com/r/HyperV/comments/gvfxzq/ubuntu_2004_enhanced_session/ftqrh74/

Add latest XRDP: https://github.com/microsoft/linux-vm-tools/blob/cb07b3eaeb89822ebc6eaddb10f3932bb1879f47/ubuntu/20.04/install.sh

Just do below:

wget is.gd/uhyper

sudo chmod +x uhyper

sudo ./uhyper

sudo ufw allow 3389

Reboot

sudo nano /etc/xrdp/xrdp.ini

Add somewhere on a new line:

address=0.0.0.0

You probably have these already, otherwise:

port=vsock://-1:3389

use_vsock=false

Save & exit nano

sudo /etc/init.d/xrdp

Reboot

Set-VM -VMName -EnhancedSessionTransportType HvSocket

Now shut down, connect and start, continue (exit the screen resolution window), log out, actually log out, exit VM window and connect again.
Now select resolution and you’ll land at a blue screen so enter your username and password. Copy/paste for text should be available 🙂

Ubuntu – connection procedure specific: connect, start, enter Ubuntu boot, minimise window, view > unselect Enhanced Session, logout, connect and enter user details. Not doing this prevents terminal from opening for some reason, 50hz refresh rate.

Xubuntu, Xfce – works super well, stable, 50hz refresh rate.

Lubuntu, LXDE/LXQT – it just breaks the desktop environment and leaves you with no wallpaper and funky toolbars.

Budgie – XRDP login starts but won’t connect. Just broken.

Mate – appears broken and requires shut down first, then starting, logging out, connecting, you’ll be told Mate isn’t supported on your OS, menu closes after a few seconds, some programs open if you’re fast enough to select them.