Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Onboarding: Ubuntu

Craig Wilhite edited this page Oct 5, 2018 · 20 revisions

We support an enhanced Ubuntu VM for Hyper-V through our VM gallery. Using the VM Gallery is the preferred method for setting up an enhanced Ubuntu VM in Hyper-V.

Please be advised:

When completing the installation of your Ubuntu guest OS, DO NOT enable auto-login for your account. There is a bug where auto-login will prevent successful enhanced mode connections via xrdp

Prerequisites

  • You need to be on Windows 10 April 2018 update (1803) or later.
  • Virtualization must be enabled in the BIOS and you must have the Hyper-V feature turned on (Note: Windows 10 Home does not support Hyper-V).

Quick Create Gallery

We recommend relying on the Quick Create Gallery to give you an enhanced Ubuntu VM. To use the VM gallery to create a VM with the latest Ubuntu version:

  1. Open the VM gallery by typing "Hyper-V Quick Create" in the Windows Search Bar and opening the app. quick create app in menu

  2. Select 'Ubuntu 18.04.1 LTS' From the menu and click Create Virtual Machine. quick create

  3. The VM image will be downloaded and verified. downloading image

  4. Start your VM and you will be guided through setting up Ubuntu (adding user account, timezone, etc). start vm

  5. Once setup is complete, you will automatically be prompted to select your display resolution. connect to vm

  6. Once you connect, you'll be greeted by the XRDP prompt to login. Make sure "Xorg" is selected from the dropdown menu before logging in. xrdp login

Alternatively, you can achieve a similar experience to what you will find in the VM gallery by manually installing and configuring your own VM with the scripts found in this repo. The instructions for this are below.

Manual Config - Ubuntu 18.04

Please make sure you have an Ubuntu Desktop image. These steps will not work for Server-based images. From a clean install of an Ubuntu 18.04 image, issue the following commands in a terminal:

wget https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/ubuntu/18.04/install.sh
sudo chmod +x install.sh
sudo ./install.sh

After you’ve run your scripts, shut down your VM. On your host machine in an Administrator powershell prompt, execute this command:

Set-VM -VMName <your_vm_name> -EnhancedSessionTransportType HvSocket

Start your virtual machine and connect. You will be greeted with a connection prompt windows that asks for a screen resolution--this will indicate that everything is installed correctly. connect window prompt

This will take you to an xorg login. This indicates that you've successfully brokered a connection and that the xrdp service is running. Login to begin your session.

NOTE: Enabling auto-login for your Ubuntu user causes an issue that will block enhanced mode from successfully connecting. Please ensure auto-login is DISABLED.

xorg login

Manual Config - Ubuntu 16.04

Please make sure you have an Ubuntu Desktop image. These steps will not work for Server-based images. From a clean install of an Ubuntu 16.04 image, issue the following commands in a terminal:

wget https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/ubuntu/16.04/install.sh
wget https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/ubuntu/16.04/config-user.sh
sudo chmod +x *.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 dir into the location of the script and run again. Once you’ve finished running the install.sh script, you’ll need to run config-user.sh

sudo ./config-user.sh

After you’ve run your scripts, shut down your VM. On your host machine in an Administrator powershell prompt, execute this command:

Set-VM -VMName <your_vm_name> -EnhancedSessionTransportType HvSocket

Start your virtual machine and connect. You will be greeted with a connection prompt windows that asks for a screen resolution--this will indicate that everything is installed correctly. connect window prompt

This will take you to an xorg login. This indicates that you've successfully brokered a connection and that the xrdp service is running. Login to begin your session.

NOTE: Enabling auto-login for your Ubuntu user causes an issue that will block enhanced mode from successfully connecting. Please ensure auto-login is DISABLED.

xorg login

Clone this wiki locally