Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Enable Sound Output Hyper-V

  1. #1
    Join Date
    May 2022
    Beans
    12

    Enable Sound Output Hyper-V

    How do you enable sound output in a Ubuntu Desktop 22.04 virtual machine using Windows 11 Pro and Hyper-V?

  2. #2
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Enable Sound Output Hyper-V

    Quote Originally Posted by matthew-cats-dogs View Post
    How do you enable sound output in a Ubuntu Desktop 22.04 virtual machine using Windows 11 Pro and Hyper-V?
    One of weaknesses of Hyper-V is that you cannot get sound from a linux guest unless the VM has an RDP server and you go through xrdp...
    Although that was possible, through adding and configuring xrdp and PulseAudio and some Hyper-V VM setting through Powershell with 20.04... It isn't possible with Ubuntu 22.04 (yet). Hyper-V doesn't see any virtual sound device hardware...

    That is not an issue with Ubuntu, but with Hype-V itself. If you used VirtualBox or VMware player on Windows, then sound works just fine. But you cannot use either of those if the Hyper-V feature is enabled. Hyper-V takes over "things."
    Last edited by MAFoElffen; December 2nd, 2022 at 10:25 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Enable Sound Output Hyper-V

    Update.

    I got sound working on an Ubuntu 22.04 Desktop VM under Hyper-V... Not straight forward.

    In Windows, in PowerShell:
    Code:
    Get-VM
    Set-VM -VMName "The_VM_Name" -EnhancedSessionTransportType HvSocket
    Then in the Ubuntu Guest
    Code:
    sudo apt update
    sudo apt install pulseaudio pavcontrol xdrp
    cd ~/
    wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh 
    chmod +x ./install.sh
    sed -i 's/20\.04/22\.04/g' ./install.sh
    ./install.sh
    sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool
    git clone https://github.com/netrinolabs/pulseaudio-modle-xrdp.git
    cd ~/pulseaudio-module-xrdp
    scripts/install_pulseaudio_sources_apt-warapper.sh
    ./bootstrap && ./configure PULSE_DIR=~pulseaudio.src
    make
    sudo make install
    ls $(pkg-config --variable=modlibexecdir libpulse) | grep 'xrdp'
    sudo reboot
    Then when it gets to the 'xrdp" login dialog, go to "Show Options" > "Local Resources" Tab > "Remote Audio" > Settings > Select "Play on This Computer".

    Have fun.
    Last edited by MAFoElffen; December 2nd, 2022 at 10:39 PM. Reason: Fixed typo's

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  4. #4
    Join Date
    May 2022
    Beans
    12

    Re: Enable Sound Output Hyper-V

    Thanks!

  5. #5
    Join Date
    Feb 2023
    Beans
    1

    Re: Enable Sound Output Hyper-V

    hey guys

    thanks for the tips

    actually found some typos, take a look at my version below, please check before running it

    happy coding !

    Code:
    sudo apt update
    
    sudo apt install pulseaudio pavcontrol xdrp
    
    cd ~/
    wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh 
    chmod +x ./install.sh
    
    sed -i 's/20\.04/22\.04/g' ./install.sh
    ./install.sh
    sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool
    
    
    
    git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
    
    cd ~/pulseaudio-module-xrdp
    
    
    scripts/install_pulseaudio_sources_apt-wrapper.sh
    
    ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src
    
    
    make
    
    sudo make install
    
    
    ls $(pkg-config --variable=modlibexecdir libpulse) | grep 'xrdp'
    
    
    
    sudo reboot

  6. #6
    Join Date
    Sep 2013
    Beans
    1

    Re: Enable Sound Output Hyper-V

    So this had a few mistakes that I noticed:
    1. there is no `pavcontrol` or `xdrp` packages (but there is a `pavucontrol` and a `xrdp` package)
    2. the script in neutrinolabs' git repo is `install_pulseaudio_sources_apt_wrapper.sh` (and appears to hang on the "Creating <distro> buildroot ..." step. But for me, it took a LOOOOONG time to run - about 55 minutes, much longer than I thought it would, and with no output - tail the log file in another window to see it doing something)

    But other than that, this works a treat. Now watching some guy mow abandoned properties on YouTube with full sounds

  7. #7
    Join Date
    Dec 2023
    Beans
    1

    Re: Enable Sound Output Hyper-V

    Quote Originally Posted by jonvel2 View Post
    So this had a few mistakes that I noticed:
    1. there is no `pavcontrol` or `xdrp` packages (but there is a `pavucontrol` and a `xrdp` package)
    2. the script in neutrinolabs' git repo is `install_pulseaudio_sources_apt_wrapper.sh` (and appears to hang on the "Creating <distro> buildroot ..." step. But for me, it took a LOOOOONG time to run - about 55 minutes, much longer than I thought it would, and with no output - tail the log file in another window to see it doing something)


    But other than that, this works a treat. Now watching some guy mow abandoned properties on YouTube with full sounds



    I succeeded, thank you everyone upstairs!


    According to @jonvel2's revision, the final correct code in the Ubuntu Guest should be:


    Code:
    sudo apt update
    sudo apt install pulseaudio pavucontrol xrdp
    cd ~/
    wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh 
    chmod +x ./install.sh
    sed -i 's/20\.04/22\.04/g' ./install.sh
    ./install.sh
    sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool
    git clone https://github.com/netrinolabs/pulseaudio-modle-xrdp.git
    cd ~/pulseaudio-module-xrdp
    ./scripts/install_pulseaudio_sources_apt_wrapper.sh

    The script "install_pulseaudio_sources_apt_wrapper.sh" will take a long time (approximately 10 minutes for me) to complete, but it won't produce any output. You can open a new SSH window and use the "tail -f /var/tmp/pa-build-dev-debootstrap.log" command to monitor the progress.


    Then continue with the remaining:


    Code:
    ./bootstrap && ./configure PULSE_DIR=~pulseaudio.src
    make
    sudo make install
    ls $(pkg-config --variable=modlibexecdir libpulse) | grep 'xrdp'
    sudo reboot

  8. #8
    Join Date
    Jan 2024
    Beans
    1

    Re: Enable Sound Output Hyper-V

    I just ran through this process and identified more typos in the latest set of commands. Here is the version that worked for me.
    * Github account is neutrinolabs, not netrinolabs
    * PULSE_DIR definition in configure call needs ~/pulseaudio.src, not ~pulseaudio.src

    Code:
    sudo apt update
    sudo apt install pulseaudio pavucontrol xrdp
    cd ~/
    wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh 
    chmod +x ./install.sh
    sed -i 's/20\.04/22\.04/g' ./install.sh
    ./install.sh
    sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool
    git clone https://github.com/neutrinolabs/pulseaudio-modle-xrdp.git
    cd ~/pulseaudio-module-xrdp
    ./scripts/install_pulseaudio_sources_apt_wrapper.sh
    
    ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src
    make
    sudo make install
    ls $(pkg-config --variable=modlibexecdir libpulse) | grep 'xrdp'
    sudo reboot
    Last edited by cschmack; January 12th, 2024 at 08:44 PM. Reason: Trying to remove link attributes on URLS, which causes the shortened form

  9. #9
    Join Date
    Feb 2024
    Beans
    2

    Re: Enable Sound Output Hyper-V

    I found another typo hope that help. Here is the version that worked for me.
    * Github account is module and not modle

    Code:
    sudo apt update
    sudo apt install pulseaudio pavucontrol xrdp
    cd ~/
    wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/20.04/install.sh 
    chmod +x ./install.sh
    sed -i 's/20\.04/22\.04/g' ./install.sh
    ./install.sh
    sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool
    git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
    cd ~/pulseaudio-module-xrdp
    ./scripts/install_pulseaudio_sources_apt_wrapper.sh
    
    ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src
    make
    sudo make install
    ls $(pkg-config --variable=modlibexecdir libpulse) | grep 'xrdp'
    sudo reboot
    [/QUOTE]

  10. #10
    Join Date
    Feb 2024
    Beans
    2

    Re: Enable Sound Output Hyper-V

    Finally nothing works, I don't know what happened
    I see in setting the sound bar chart is moving but no sound and the output is through "Dummy Output"
    can any one advice me

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •