Deploy A Linux VM on Hyper-V with Sound

By default you can not pass sound through to your host Windows system’s audio devices from a Linux virtual machine. I struggled finding reliable instructions for getting this to work and ended up using a third party solution called PulseAudio.

Attention: If you are using a newer edition of Ubuntu these instructions will not work. The more modern versions do not include XRDP in the base image. There is an updated version of these instructions that will get sound working at

To get started, you’ll need an Ubuntu VM to work with and we’ll need to install Hyper-V if you haven’t already. Open PowerShell as an Administrator and install the Hyper-V components. Run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Hyper-V can also be installed using the GUI. Go to the Control Panel -> Programs and Features > Turn Windows Features on or off and choose it from the menu (both boxes).

Once you have the Hyper-V tools installed, launch the Hyper-V Manager and use the Quick Create feature to automatically install and configure and Ubuntu Linux VM.

After the creation of your new VM has finished, right click on it in the Hyper-V Manager and start the virtual machine. Right click on it again to connect to the console.

After you get logged on to your new Linux machine, the first thing we need to do is to configured the repos so that you can download the PulseAudio software we will be using to enable your VM’s sound. In the show Applications menu, open Software and Updates. Go to the Ubuntu Software tab and select all of the boxes.

Now, open a terminal from the Show Applications menu and run the following lines to install and configure PulseAudio. Reboot the Linux VM when you are finished.

cd /tmp
sudo apt source pulseaudio 
cd /tmp/pulseaudio*
sudo ./configure
cd /usr/src/xrdp-pulseaudio-installer
sudo make PULSE_DIR="/tmp/pulseaudio-11.1"
sudo install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so

When the system comes back on line, connect again and use the Show Applications menu to open Settings. Go to the sound section and set the Output device to xrdp sink. Set the Input Device to xrdp source. That’s it. If everything went according to plan, your Ubuntu VM should be able to pass sound through to your Windows Host.


  1. Getting an error after sudo ./configure
    checking for gm4… no
    checking for m4… no
    configure: error: m4 missing

    and can’t continue


  2. Ok solved it by doing:
    sudo apt-get install m4

    but then also needed the following before ./configure would complete:
    sudo apt-get install libtool
    sudo apt-get install libsndfile-dev
    sudo apt-get install libcap-dev


  3. After installing required dependencies to get ./configure to work, now the next step i get this…

    michael@UbuntuVM:/tmp/pulseaudio-13.99.1$ cd /usr/src/xrdp-pulseaudio-installer
    bash: cd: /usr/src/xrdp-pulseaudio-installer: No such file or directory

    Not sure what to do next, your guide appears to be missing a lot of steps…

    Liked by 1 person

    1. According to the developer’s github documentation:

      Ubuntu 18.04 with xrdp 0.9.5 will not have xrdp-sink device appear unless /etc/xrdp/pulse/ is replaced with the following content:

      load-module module-augment-properties
      load-module module-always-sink
      .ifexists /usr/lib/pulse-11.1/modules/
      load-module /usr/lib/pulse-11.1/modules/
      .ifexists /usr/lib/pulse-11.1/modules/
      load-module /usr/lib/pulse-11.1/modules/
      load-module module-native-protocol-unix


  4. Your instructions worked for me for Ubuntu 18.04 with minor changes. I also needed to do the following prior to your instructions:
    sudo apt install xrdp-pulseaudio-installer
    sudo apt-get build-dep pulseaudio


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s