This blog is about Java (advanced Java topics like Reflection, Byte Code transformation, Code Generation), Maven, Web technologies, Raspberry Pi and IT in general.

Samstag, 5. Mai 2018

Ubuntu VM with Hyper-V on a UDH display

Until now I used VirtualBox for VMs. However Docker for Windows requires Hyper-V to be enabled and VirtualBox doesn't work with this setting. Therefore I switched to Hyper-V for VMs. After installing Ubuntu I noticed that the font was blurry and the clipboard wasn't shared between guest and host. To fix both issues it's required to enable the Enhanced Session Mode. To do that run following commands on the Ubuntu VM:

$ git clone https://github.com/jterry75/xrdp-init.git ~/xrdp-init
$ cd ~/xrdp-init/ubuntu/18.04/
$ sudo chmod +x install.sh
$ sudo ./install.sh

Install.sh will need to be run twice in order for the script to execute fully (it must perform a reboot mid-script). That is, once your VM reboots, you’ll need to change directory into the location of the script and run again. After you’ve run your scripts, shut down your VM. On your host machine in a admin PowerShell prompt, execute this command:

Set-VM -VMName -EnhancedSessionTransportType HvSocket

After that the Enhanced Session Mode works with the Ubuntu VM and the front isn't blurry anymore and the clipboard is shared. The only annoying thing is that per default you can only choose between 100% and 200% scale in Ubuntu's display setting. To set it it to 150% just execute this command:

gsettings set org.gnome.desktop.interface text-scaling-factor 1.5


Source: Sneak Peek: Taking a Spin with Enhanced Linux VMs