Submit your email address to get a link for quick download on your desktop and get started!
While working with USB in Hyper-V, you may face some problems. For example, Enhanced sessions give you many options, but how to work with Enhanced sessions on linux? In the following article, we’ll discuss how to configure Hyper-V virtual machines (running Ubuntu 20.04 desktop) that have enhanced sessions enabled.
Hyper-V Windows 10 1909 Wizard supports 18.04 and 19.10 versions of Ubuntu (at the time of this article’s publication). However, these restrictions are easy enough to dismantle if the tools are installed manually.
Follow the below steps to learn how this is done...
Step 1: Open “Hyper-V Manager”, and click “New” (which is found on the right panel)
Step 2: Select “Virtual Machine”
Step 3: Once a new window pops up, create a name (of your choice) for the Virtual Machine
Step 4: Click “Next” once a name is chosen
Step 5: On the next page that appears, ensure UEFI is enabled by selecting: “Generation 2”
Step 6: Once enabled, click “Next”.
Step 7: Decide on your “Startup Memory allocations”. It is recommended to use up to 8 GB of memory to ensure the user-experience is efficient and enjoyable. However, a minimum of 4 GB is required.
Step 8: Click “Next”
Step 9: After choosing at least one network interface (which allows Ubuntu to download updates -and/or drivers- during installation)... Click “Next”
Step 10: Decide on your preferred disk size (the installation wizard defaults at a 127 GB disk), then click “Next”
Step 11: Choose the ISO downloaded from the Ubuntu website
Step 12: Click “Finish”
Because Ubuntu cannot support “Secure Boot”, it will need to be disabled prior to starting up a VM. Follow the steps below to disable “Secure Boot”:
Step 1: After choosing the desired VM, click “Settings” (located on the right-side panel as shown below)
Step 2: Click “Security” (located in the left panel)
Step 3: Ensure “Enable secure boot” is left unchecked
Step 4: Click “OK”
Step 5: After making sure to select “don’t enable auto-login”, it’s time to start up the virtual machine and run the OS setup. If “don’t enable auto-login” isn’t configured, the enhanced session won’t function.
From there, it’s time to install the Microsoft-provided “linux-tools”.
Step 1: Open a terminal within Ubuntu
Step 2: Download the setup script and run it
wget
https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/ubuntu/18.04/install.sh
sudo chmod +x install.sh
sudo ./install.sh
sudo chmod +x install.sh
sudo ./install.sh
Step 3: If an error pops up after installing the script, open “/etc/xrdp/xrdp.ini (sudo required)” in your preferred editor.
Step 4: Once “/etc/xrdp/xrdp.ini (sudo required)” is opened in the editor, edit or add the lines shown below:
port=vsock://-1:3389
use_vsock=false
Step 5: Save the file and shutdown the VM
Step 6: From Windows, open a PowerShell prompt with admin privileges and type:
Set-VM-VMName <your_vm_name>-EnhancedSessionTransportType HvSocket
The “<your_vm_name>” = the name of the desired Virtual Machine (the name that was created during the “Create The Virtual Machine” section)
Step 7: Start up the virtual machine, and you’ll quickly redirect to the XRDP login screen