However, desktop integration (features such as clipboard sharing) have always been lacking for Linux guests. While this makes sense, since Microsoft primarily focuses on delivering a great Hyper-V experience for servers and the cloud, and instead positions the Windows Subsystem for Linux as the preferred way to get a Linux userland on your own machine, there are still many use cases out there for a comfortable virtualized desktop Linux experience with proper desktop integration – after all, not every single desktop Linux app is terminal-based.
The good news is that improvements are coming! As previewed at Microsoft's Virtualization blog, starting with Ubuntu 18.04, it will be possible to easily get a Linux virtual machine in Hyper-V that supports what Microsoft calls "Enhanced Session Mode", which adds features such as:
- Better mouse experience
- Integrated clipboard
- Window Resizing
- Drive Redirection
To get this done, Microsoft is working together with the developers of XRDP, an open source implementation of Microsoft's Remote Desktop Protocol, to add support for Hyper-V sockets, which provide an efficient way for guest virtual machines to communicate with the host.
Ubuntu 18.04 will include the latest version of XRDP with the new feature, along with Linux kernel version 4.15, which adds support for Hyper-V sockets out of the box.
If you don't want to wait for Ubuntu 18.04, however, you can preview improved Linux integration today! While still under development, Microsoft has provided a way to try out the enhanced session using the current Ubuntu LTS release, 16.04.
Enabling enhanced session support in Ubuntu 16.04
Since Ubuntu 16.04 does not ship with the necessary components out of the box, some setup is required. Microsoft provides a script that will download and compile the newest version of XRDP, and install a version of the Linux kernel with Hyper-V sockets support. It only takes a few steps to get going, and requires that you use Windows 10 build 17063 or newer:
- Create and set up an Ubuntu 16.04 virtual machine (you can get the ISO here)
- Install git:
sudo apt update; sudo apt install git
- Clone the required git repository and
git clone https://github.com/jterry75/xrdp-init.git ~/xrdp-init; cd ~/xrdp-init/ubuntu/16.04/
- Make the required scripts executable:
sudo chmod +x install.sh; sudo chmod +x config-user.sh
- Run the install script:
- Reboot your virtual machine when prompted
cdinto the script directory and run it again:
cd ~/xrdp-init/ubuntu/16.04/; sudo ./install.sh
- Run the configuration script:
- Shut down the virtual machine
- Enable enhanced session mode by running this command in PowerShell:
Set-VM -VMName <your_vm_name> -EnhancedSessionTransportType HvSocket
Finally, boot into your virtual machine, and you should be prompted to select a screen resolution – that means the enhanced session to go! Enjoy, and don't forget to file any enhaced session bugs that you run into on GitHub!
We may earn a commission for purchases using our links. Learn more.