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.