Ubuntu 20.04 on Hyper-V

App Engineering Lab
2 min readMar 25, 2020

--

Creating Virtual Machine

  1. Create appropriate virtual machine:
Hyper-V creating Virtual Machine
Hyper-V new virtual machine

2. Follow the wizard’s flow and be avare to select Generation 2 on Specify Generation screen:

Hyper-V Generation 2
Hyper-V specify generation

And when Installation Options screen prompted find the path to your Ubuntu 20.04 ISO file:

Hyper-V choose instalation media
Hyper-V choose instalation media

Finish the setup and you are almost ready to go.

3. Tweak VM settings ( Right click on VM ->Settings …) and disable Enable Secure Boot and assign more virtual processors if you are able:

Hyper-V disable “Enable Secure Boot”
Hyper-V disable “Enable Secure Boot”

4. Connect to VM ( Right click on VM -> Connect) and start it:

Hyper-V Connect to VM
Hyper-V Connect to VM

5. Follow the installation process as usual.

Install Microsoft Linux-VM-Tools

1. Update system and install git:

sudo apt-get update
sudo apt install git

2. Clone appropriate repository and position inside desired folder:

git clone https://github.com/Microsoft/linux-vm-tools.git ~/linux-vm-tools
cd ~/linux-vm-tools/ubuntu/18.04/

3. Install Linux-VM-Tools and reboot the system ( If they stated XRDP error proceed to steps 4 and 5)

sudo chmod +x install.sh
sudo ./install.sh
sudo reboot

[IF ERROR] 4. Edit XRDP INI file:

sudo gedit /etc/xrdp/xrdp.ini
change these two lines:
port=vsock://-1:3389
use_vsock=false

[IF ERROR] 5. Start XRDP service:

sudo systemctl enable xrdp.service
sudo systemctl start xrdp.service

6. Reboot and if everything is done correctly you should be welcomed with a screen to select resolution:

Ubuntu 20.04 on Hyper-V
Ubuntu 20.04 on Hyper-V

Complete github gist

Ubuntu 20.04 on Hyper-V gist

Resources

  1. https://techcommunity.microsoft.com/t5/virtualization/sneak-peek-taking-a-spin-with-enhanced-linux-vms/ba-p/382415
  2. https://github.com/microsoft/linux-vm-tools/issues/94

Social Networks

If you want you can follow me on twitter and instagram.

--

--

App Engineering Lab

PhD student in computer science. Interested in mobile, web development and AI. Twitter: https://twitter.com/labappeng Instagram: appengineeringlab