Notes on Setting up Xrdp PulseAudio on Fedora Silverblue

I’ve been playing with Bazzite inside , and that led me to figure out how to set up xrdp with glamor and pulseaudio on a new, headless Fedora Silverblue VM that I intend to use as my new ML sandbox.

Update: I’ve switched to the pipewire modeule for Xrdp, which I very much recommend instead since setup is utterly trivial.

Setting up xorgrdp-glamor was easy enough:

  • Disable graphical login with systemctl set-default multi-user.target
  • Install xrdp and xorgxrdp-glamor
  • Comment out the Xvnc entry from /etc/xrdp/xrdp.ini to force Xrdp use.
  • Tell to use a VirGL GPU display device so that the VM can use the Intel iGPU via virtio1

But getting pulseaudio to work inside Silverblue is a bit of a pain because of rpm-ostree’s immutable filesystem and the fact that there are no prebuilt pulseaudio-module-xrdp packages for .

So I cheated: I built pulseaudio-module-xrdp in a Fedora 39 container (where I could run mock without any issues) and set up an rpmbuild tree with the artifacts like so:

# tree rpmbuild 
rpmbuild
├── BUILD
├── BUILDROOT
├── pulseaudio-module-xrdp-0.1
   ├── load_pa_modules.sh
   ├── module-xrdp-sink.la
   ├── module-xrdp-sink.so
   ├── module-xrdp-source.la
   ├── module-xrdp-source.so
   └── pulseaudio-xrdp.desktop
├── RPMS
├── SOURCES
   └── pulseaudio-module-xrdp-0.1.tar.gz
├── SPECS
   └── pulseaudio-module-xrdp.spec
└── SRPMS

Then I created the SOURCES tarball and wrote a minimal spec file:

Name:     pulseaudio-module-xrdp
Version:  0.1
Release:  1%{?dist}
Requires: pulseaudio
Summary:  xrdp sink / source pulseaudio modules
License:  Apache-2.0
Group:    Other
Url:      https://github.com/neutrinolabs/pulseaudio-module-xrdp
Source0:  %{name}-%{version}.tar.gz
Packager: Rui Carmo <me@localhost>

%description
xrdp implements Audio Output redirection using PulseAudio, which is a 
sound system used on POSIX operating systems.

%install
rm -rf %buildroot
mkdir -p %buildroot%{_libdir}/pulseaudio/modules
cp *.so %buildroot%{_libdir}/pulseaudio/modules
mkdir -p %buildroot%{_sysconfdir}/xdg/autostart
cp *.desktop %buildroot%{_sysconfdir}/xdg/autostart
mkdir -p %buildroot%{_libexecdir}/pulseaudio-module-xrdp
cp *.sh %buildroot%{_libexecdir}/pulseaudio-module-xrdp

%prep
%setup -q

%clean
rm -rf $RPM_BUILD_ROOT

%files
%_libdir/pulseaudio/modules/*.so
%_sysconfdir/xdg/autostart/pulseaudio-xrdp.desktop
%_libexecdir/pulseaudio-module-xrdp/load_pa_modules.sh

%changelog
* Tue Jan 23 2024 Rui Carmo <me@localhost> - 0.0.1
- First version being packaged

Then I ran:

rpmbuild -bb ~/rpmbuild/SPECS/pulseaudio-module-xrdp.spec 

…to build the RPM, copied it across, and proceeded to install it and swap out pipewire in a single transaction:

rpm-ostree override remove pipewire-pulseaudio --install pulseaudio ./pulseaudio-module-xrdp-0.1-1.fc39.x86_64.rpm

I suppose I should contribute this back to pulseaudio-module-xrdp, but I don’t have the time to get to grips with its Makefile and set up a proper build pipeline for it right now.


  1. I can’t use the NVIDIA GPU I’ve passed through via PCI because I’d have to rebuild glamor from scratch, and one RPM is enough for a single evening, thank you very much. ↩︎

This page is referenced in: