How to forward Debian 13 GNOME audio output over SSH to another Debian 13 GNOME?
Feb 25, 3:56pm

Forwarding audio output over SSH from one Debian 13 GNOME machine to another involves using PulseAudio, which is the default sound server in GNOME. Here’s a step-by-step guide to achieve this:


1. Prerequisites

  • Both machines must have PulseAudio installed (it is usually installed by default on Debian GNOME).
  • Ensure both machines are on the same network or that SSH tunneling is possible.

2. On the Remote Machine (Audio Source)

This is the machine where the audio is being generated.

Enable PulseAudio Network Access

Edit the PulseAudio configuration file:

bash
sudo nano /etc/pulse/default.pa

Add or uncomment the following lines:

plaintext
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.1.0/24 load-module module-zeroconf-publish

Replace 192.168.1.0/24 with the IP range of your local network if needed.

Restart PulseAudio:

bash
pulseaudio -k && pulseaudio --start

Allow TCP Connections

Edit the PulseAudio daemon configuration:

bash
sudo nano /etc/pulse/daemon.conf

Ensure the following line is uncommented and set:

plaintext
exit-idle-time = -1

Restart PulseAudio again:

bash
pulseaudio -k && pulseaudio --start

3. On the Local Machine (Audio Receiver)

This is the machine where you want to hear the audio.

Install pulseaudio-utils (if not installed)

bash
sudo apt install pulseaudio-utils

Set Up SSH Tunneling

Run the following command to forward the PulseAudio port (4713) over SSH:

bash
ssh -R 4713:localhost:4713 user@remote-machine-ip

Replace user and remote-machine-ip with the appropriate values.

Connect to the Remote PulseAudio Server

On the local machine, set the PULSE_SERVER environment variable to use the tunneled PulseAudio server:

bash
export PULSE_SERVER=tcp:localhost:4713

To make this persistent, add the line to your ~/.bashrc or ~/.profile file.

Test the Audio Forwarding

Play an audio file or run an application on the remote machine. The audio should now be played on your local machine.


4. Troubleshooting

  • Firewall Issues: Ensure port 4713 is open on the remote machine.
  • Authentication: If you encounter authentication issues, check the auth-ip-acl setting in /etc/pulse/default.pa.
  • Restart Services: If audio doesn’t work, restart PulseAudio on both machines:
    bash
    pulseaudio -k && pulseaudio --start

5. Alternative: Using paprefs (GUI)

If you prefer a GUI, install paprefs on the remote machine:

bash
sudo apt install paprefs

Open paprefs, go to the Network Server tab, and enable Enable network access to local sound devices. Configure the allowed IP range as needed.


Summary

  • Enable PulseAudio network access on the remote machine.
  • Set up SSH tunneling for the PulseAudio port.
  • Configure the local machine to use the remote PulseAudio server.
  • Test and troubleshoot as needed.
Feb 25, 3:56pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.