I’m using Hyper-V for this. Your mileage will vary. This post assumed Ubuntu 25.10, but these problems could be GNOME 49’s own so you might experience it on other linux distros that uses GNOME 49 as well.
Settings to Remote login / Desktop Sharing (RDP) hangs out of he box
When I entered “System -> Remote Desktop” under Settings app (on Hyper-V) in the first boot right after installation, it will hang
Turns out it works fine after rebooting again. I installed this over and over and realize it’s always the first boot that’d freeze the Remote Desktop settings.
Cryptic error message for failed Remote Login
Even if you entered the wrong username, you’ll be greeted with this confusing message.
Username and Password changes are glitchy
Changing usernames and password in the Remote Login dialog box does not always immediately take effect. I had to disable and re-enable Remote Login at the top of the settings->system->remote login tab for the change to take effect.
It’s confusing when combined with the cryptic error message above.
Watch out for case sensitive login name for RDP
Windows’ username is not case sensitive but the RDP implementation on GNOME 49 is case sensitive!
If you entered a “User name” in the first tab of the native RDP client (mstsc) that happens to match any of your Windows account (regardless of case since Windows don’t care about capitalization in user names),
it will pull out your Windows account showing the capitalization stored in Windows
But this is where this gets really fucked up (is so misleading that it’s a user trap): under the hood it’s your “User name” with the exact capitalization typed in the first tab that gets passed to GNOME’s Remote Login, not what the “Windows Security” dialog box showed you when you entered the password!
Inconsistent Login Detail defaults between Remote Login and Desktop Sharing
Desktop Sharing and Remote Login are esentially the same thing in terms of users interface, differing only in the port number and whether it reuses an existing screen or start a new graphical login.
Nonetheless the Login Details for Desktop sharing pre-enters the current session’s username and a prefilled password that’s prefilled
while Remote Login prefills nothing.
It’s not like what’s pre-entered in Desktop Sharing is tied to Linux’s system user account (login and password pair) anyway so why do it for one (Desktop Sharing) but not the other (Remote Login)? This really looked unpolished.
Text RDP file changes needed to securely connect to GNOME’s remote desktop
The native Remote Desktop (mstsc)’s graphical user interface do not contain the option to enable RDSTLS so it has to be written into an .rdp file then either loaded or executed. You will get this warning message if you use the entries from mstsc’s GUI alone to make the connection:
It’s frustrating that there are no simple packages provided by Microsoft or Ubuntu to get something as basic as sound working on Hyper-V. It’s nuts that we still have to deal with these kind of integration bullshit in 2023 when people are claiming that Linux is useable! At the time of writing, there are still way too many rough edges on Linux that are clearly not the users’ fault!
To understand why things are the way they are. We have to first understand that Hyper-V talks to the VM under RDP under the hood which has many advantages that the RDP provides. RDP is way less sluggish for the video and sound quality than the damned X11 server, which people spent little time to provide for Windows. MobaXterm is the only decent free X11 server for Windows in terms of user experience but it’s not the first one that populate search results.
In other words, we’ll need to set up Linux to stream the apps through RDP, not X11 to take advantage of Hyper-V manager’s interface (specifically vmconnect.exe under the hood). In Linux, this area is not maturely developed and the author of xrdp is not keen to make polished packages so most of the time we get pointed to the struggle of compiling the source code.
Given RDP is not native to Linux, xrdp did not rebuild the guts of X11 that maps natively to RDP. Instead it launches a bare minimal RDP session with nothing on it other than a basic client (sesman) that you can use it as a VNC client or X11 client that streams to the bare minimum RDP, so there’s an extra layer of indirection. You are not running RDP natively. That RDP session is for you to call X11.
Since X11 does not natively stream audio, you need to a sound server (over network) system that streams the audio to the bare minimal RDP layer of xrdp, then have the RDP layer stream/relay to RDP with pulseaudio-module-xrdp (which is a kernel package that you need to build from scratch at the time of writing since there’s no packages for it).
By the way, if you get this xrdp+pulseaudio ordeal working, you also get (x)RDP working for the linux even if you don’t use vmconnect to connect to it, because it’s RDP under the hood anyway.
I followed the messy (and often broken) instructions from multiple sources to build and install pulseaudio-module-xrdp, but it turned out this wasn’t enough. There’s no sound and the anticipated sound device didn’t show up in Ubuntu and all I see is a dummy sound driver.
Turns out there are many pieces of the puzzle scattered through different blogs and the blog either has typos, missing a key component, or the URLs changed so it’s broken. Here’s an overview of what you need to do
Replace Pipeware completely with PulseAudio on Ubuntu
RDP Enhanced Session is required for sound. This is true for Windows Guests as well. Linux doesn’t have RDP so you’ll need xrdp first before you even talk about enhanced session. Vsocket is how Enhanced Session talk. On Linux side we configure xrdp to talk on vsocket instead of a raw rdp protocol over Port 3389. On Windows we enable Enhanced Session (if not already) and enable hv-socket (with it the Windows side of vsocket).
Since xrdp ‘cheats’ by redirecting X11 instead of implementing RDP from the core, you’ll need to relay the pulseaudio from the Ubuntu itself to the RDP layer which is done by pulseaudio-module-xrdp. Unfortunately it’s does not come with xrdp and there’s no package so you have to build it yourself the install your compiled product. Remember by default source code repo is disabled so you need to enable it first before following the any build instructions.
Get rid of Pipeware Completely & Install PulseAudio
Griffon’s IT library provided the insight that we need to take out Pipeware (the competitior of PulseAudio) completely and replace it with PulseAudio. After that I got it working. Here’s a path to his tutorial:
His tutorial included the script he made to install a more recent xrdp he built but the link is now broken. So what I did turned out to be necessary after all.
His tutorial basically stop/disabled/masked the hell out of Pipewire so it’s dead and deader and make sure the users cannot install it later and displace PulseAudio. It’s a lot of gymnastics because systemctl disable and mask do not take wildcards so you have to find out each service/daemon named pipewire. I’ll take this shortcut instead:
sudo apt purge pipewire
A tool to check if there’s audio server running (optional) is
pactl info
House keeping and install both pulseaudio and xrdp if not already done. pavucontrol is for controlling the volume which is often needed:
Part 1 [DONE BY DEFAULT NOW]: Change xrdp to receive vsocket instead of raw RDP
TLDR: No actionable item here. Included here for educational purposes only as it was a required step before.
Enhanced Session uses vsocket instead of raw Port 3389 for connection which xrdp.ini defaults to out of the box. Griffon’s IT library gave the instruction to replace the port=3389 to port=vsock://-1:3389 in xrdp.ini. However it’s already taken care of in the new install.sh script for linux-vm-tools:
Part 2: install linux-vm-tools (think of it as vsocket driver)
linux-vm-tools is “Hyper-V Linux Guest VM Enhancements” developed by Microsoft which dropped support for it and picked up (forked) by hinara to support Ubuntu 22.04. Hinara’s version is more updated.
So the first thing you do is to download (can use wget, curl, aria whatever you like as the downloader) the install.sh of the latest/appropriate version (right now it’s Ubuntu 22.04):
Note that the folder name at the top level says 20.04 (branch name) but at the lower level says 22.04 (folder name). So be prepared the path might change in the future if the author figured it’s better to use a consistent branch name later. The safest bet is to go to the Github page and discover the latest version then click raw to get the direct link to use with wget (or any file downloader).
Downloads by default are not executable for your safety, so enable the execute attribute with chmod +x:
sudo chmod +x install.sh
and of course execute the install.sh after you checked it’s all kosher:
sudo ./install.sh
The last 2 lines of the script tells you to RUN IT AGAIN AFTER REBOOT. It’s easy to overlook given the text doesn’t stand out after the user got bombarded with lots of verbose info. Make sure you follow it!
Configure Hyper-V for Enhanced Session (Host)
On Windows side, you’ll need to enable the Windows version of vsocket to communicate with the vsocket. There’s no curly braces when you type in {your VM’s name}:
Deploy a Linux VM on Hyper-V with Sound 20.04 Edition – techbloggingfool.com‘s scripts do not use the default folder choices by the build script so the changes in the upstream broke his folder scheme by adding a ‘+dfsg1‘ to the folder name. Instead of fixing it, I followed the official instructions on the github page but take advantage of the one very useful piece he provided: enable source code repo:
He has command line scripts that enables the source code too. Given my confidence about linux developer coordinating with people downstream about the naming schemes changes, I’ll stick with the GUI which gives a consistent interface.
./bootstrap && ./configure PULSE_DIR=$HOME/pulseaudio.src
make
PULSE_DIR=$HOME/pulseaudio.src because this is the default in the wrapper script above if no arguments are specified. Stick with the defaults (working at home folder) as it’s not wise to trust people to coordinate their naming scheme consistently. The defaults are likely tested more thoroughly.
which you can OPTIONALLY check your work to see if the kernel modules are indeed installed:
ls $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp
[Optional Cleanup] If you don’t have anything named pulseaudio that you’d like to keep, you can clean up by removing the files using wildcard and the install.sh
sudo rm -rf ~/pulseaudio*
sudo rm ~/install.sh
Summary
Here’s a consolidated ‘script’ to show the complexity. I do not recommend copying and pasting it as the dependencies might change and it might break.
# Change audio server in Ubuntu
sudo apt -y update
sudo apt -y purge pipewire
sudo apt -y install pulseaudio pavucontrol xrdp
systemctl --user enable --now pulseaudio.service pulseaudio.socket
# [Optional] check if PulseAudio was installed correctly
pactl info
# Build pulseaudio-module-xrdp and install the kernel modules
# Stick with official instructions which assumes home folder
cd ~
sudo apt -y 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=$HOME/pulseaudio.src
make
sudo make install
# [Optional] check if pulseaudio-module-xrdp was installed correctly
ls $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp
# Install linux-vm-tools which enables Enhanced Session
# Give linux-vm-tools its own folder to avoid confusion
mkdir -p ~/linux-vm-tools
# Note: "... && cd $_" will
cd ~/linux-vm-tools
wget https://raw.githubusercontent.com/Hinara/linux-vm-tools/ubuntu20-04/ubuntu/22.04/install.sh
sudo chmod +x install.sh
sudo ./install.sh
# The last 2 lines of screen output of install.sh tells you to reboot and run this again
# This is automated below by making a icon in Gnome desktop's autostart folder
# that will self-destruct after first launch
cat > ~/.config/autostart/startonce.desktop <<EOF
[Desktop Entry]
Type=Application
Name=startonce.desktop
Exec=gnome-terminal -- sh -c 'sudo ~/linux-vm-tools/install.sh && rm -rf ~/pulseaudio-module-xrdp ~/pulseaudio.src ~/linux-vm-tools ~/.config/autostart/startonce.desktop && init 0;$SHELL'
EOF
sudo reboot
I also noticed a quirk that the first reboot after everything’s installed might be a little too fast. In this case restart again once more. So instead I just have the desktop shortcut shutdown your VM after it’s done and have you manually start it again so it’d work right the first time.
I’ve created a Github repo for my own convenience, but feel free to use it however way you like, but I’m not responsible for any damages it might cause. Better read through the code with the help of this blog page and understand what it does and decide if you want to try it for your setup. I tried to make it robust, but it’s designed to be installed on freshly install Ubuntu guest VMs.