17

I installed Ubuntu 14.04.4 LTS on my computer using Hyper-V Manager. I am running Windows 10 Pro as the primary system. Sound will not work on Ubuntu, but works fine on Windows 10. I don't know what to turn on or change to get sound to work. It says Dummy Output under Sound. Please help I am new to Linux and want to learn.

4 Answers 4

11

For Ubuntu 18.04 LTS hosted on a Windows 10 Pro Hyper-V VM. I was able to do it using the following on a system that was one of the quick start VMs. The only audio device listed before was "Dummy Audio" or "Dummy Output" or something like that and after it was "xrdp sink" and after I started this in the VM was I had to follow install instructions at [http://c-nergy.be/blog/?p=12469][http://c-nergy.be/blog/?p=12469] and then reboot. Also ensure your client connection to the iva XRDP is passing audio.

Short version is below in case link goes dead.

# Configure system to accept source repos
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
# Restart the VM and reconnect

Note: I also happened to install the following from some other guides, but I beleive that it would have worked without it

sudo apt-get install ubuntu-restricted-extras
sudo apt-get install pavucontrol
4
  • Thank you @Sean J. It worked fine for me!!
    – Willian
    Jun 17, 2020 at 16:11
  • This is the correct answer. Please note that in order to do what he has said in the first method above, you need to go to Software and Updates -> Click the check box "Source code" (enter password) -> Close this window -> It will prompt you to reload, do so. Then follow the instructions
    – Aserian
    Jun 26, 2020 at 22:31
  • Note: cd /tmp/pulseaudio* is wrong it must be cd cd /tmp/pulseaudio and then just press tab (in the case above the name is /tmp/pulseaudio-11.1 Sep 19, 2020 at 12:00
  • On ubuntu 20.04, may need to install libsnapd-glib-dev
    – hao
    Nov 25, 2020 at 15:27
7

It looks like you're doing fine, Hyper-V does not support audio to Linux guests. There is a lot of information on the internet that says to enable Enhanced Sessions in Hyper-V...but Enhanced Sessions are for Windows guests only. It may be possible to install xrdp or another Linux RDP package but I have not tried this as I use Ubuntu Server more than desktop and just SSH in anyways.

Lack of audio support in Hyper-V for Linux is one of several trade offs of using Linux guests on Hyper-V hosts. I have had luck using VirtualBox as the Hypervisor which allows audio, but you must uninstall/deactivate the Hyper-V feature before running/installing VirtualBox as Hyper-V locks the virtualization for Hyper-V's usage.

With that said, I have used Linux (Arch, Ubuntu, Debian, Kali, etc.) and *BSDs as guests in Hyper-V for years and am very satisfied with the overall performance and minimal issues. Best of luck on your Linux journey!

4
1

There is actually a fairly easy, but a counterintuitive, way of playing audio on any Linux VM that supports Pulseaudio. It will also work on any VM platform, not just Hyper-V.

And the best thing about it is that it doesn't require changing any system setting on either the VM or the host machine. And it doesn't require you to run your VM in an enhanced session either and share your host system's audio drivers with it.

Short answer:

Install OS-appropriate version of ffmpeg utility on both your host machine and the VM.

Run the following command on your host machine:

ffplay -nodisp -ac 2 -acodec pcm_s16le -ar 48000 -analyzeduration 0 -probesize 32 -f s16le -i udp://0.0.0.0:18181?listen=1

Run the following command on your VM:

ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_s16le -ar 48000 -f s16le "udp://IP.OF.YOUR.HOST:18181"

Detailed answer:

This article provides a more detailed guidance of the process and explains what the commands actually do: GETTING AUDIO WORKING ON UBUNTU VM ON HYPER-V

0

I noticed that the top answer was missing some dependencies which can often be required for everything to work properly so I decided to write down the complete set of Terminal commands You might need for Solving this issue.

#For starter:

sudo apt-get update -y

sudo apt-get install dpkg-dev

sudo apt-get install -y m4

sudo apt-get install intltool

sudo apt-get install libltdl-dev

sudo apt-get install libcap-dev

sudo apt-get install -y pkg-config

sudo apt-get install libfftw3-dev

sudo apt-get install libsndfile1-dev

sudo apt-get install -y udev

That should have set up the requirements.

Now we need to enable the Source Code Repository. To do that just enter the command below and a window will pop-up.

software-properties-gtk

Check the Source Code Box (see the attached image)

image description of the window here

Next We Proceed to install the PulseAudio

cd /tmp
sudo apt source pulseaudio
cd /tmp/pulseaudio
sudo ./configure

sudo apt-get install xrdp-pulseaudio-installer  -y

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

Verify the installation

 pulseaudio --version

#Also, here are a few links on tutorials which deal with this kind of issues

Deploy A Linux VM on Hyper-V with Sound

xRDP – How to redirect Sound on Ubuntu 18.04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .