Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yousecjoe/297563b6ab6bba92f66651d880b845ab to your computer and use it in GitHub Desktop.
Save yousecjoe/297563b6ab6bba92f66651d880b845ab to your computer and use it in GitHub Desktop.

Ubuntu Hyper-V VM Enhanced Session

Summary

The Hyper-V Enhanced Session increases performance of the VM GUI and adds multimedia capabilities which improves the end user experience of Linux running on Hyper-V.

Installation and Enhanced session

Follow steps on the post below:

deploy-a-linux-vm-on-hyper-v-with-sound-20-04-edition

Or follow theses steps:

Configure Linux Hyper-V VM for "Enhanced Session"

Note - if it asks to reboot and rerun, rerun the install.sh again

Run the following script on the Linux VM:

wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh
chmod +x install.sh
sudo ./install.sh

Configure VM using Windows Powershell

Set-VM -VMName "Your VM Name" -EnhancedSessionTransportType HvSocket

Configure audio in Linux Hyper-V VM with updates

Install prerequisites:

sudo apt-get install git libpulse-dev autoconf m4 intltool build-essential dpkg-dev libtool libsndfile1-dev libspeexdsp-dev libudev-dev -y

Enable source code as downloadable.

Note - Can also be enabled from the GUI, using Settings > About > Software & Updates)

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update

PulseAudio

Download PulseAudio source in /tmp directory

Note - Do not forget to enable source repositories

sudo apt build-dep pulseaudio -y
cd /tmp
apt source pulseaudio

Compile PulseAudio

Go to the PulseAudio folder (pulseaudio-<version.number>) and build it from source.

Note - Follow the instructions in the README file, on the section HACKING

cd pulseaudio-<version.number>
meson build
meson compile -C build
build/src/daemon/pulseaudio -n -F build/src/daemon/default.pa -p $(pwd)/build/src/

Create xrdp sound modules

Go back to /tmp folder then use git clone to clone the PulseAudio XRDP module GitHub repo.

cd .. 
git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
cd pulseaudio-module-xrdp

Like the PulseAudio source, I followed their docs to get this done

Build Doc: pulseaudio-module-xrdp/wiki/Build-on-Debian-or-Ubuntu

scripts/install_pulseaudio_sources_apt_wrapper.sh
./bootstrap
./configure PULSE_DIR=~/pulseaudio.src
sudo make install

Restart the VM.

Install Doc: pulseaudio-module-xrdp/wiki/README#install

Credits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment