Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While it is possible to use X applications remotely by using -X switch in ssh, the sound is being played in remote machine's speaker only. For example if I view a film in VLC/Totem only video is visible and I can't hear the audio. Is there a way to forward audio too? [without digging through Pulse-audio's setup, I mean; Like how ssh understands X forwarding by itself.]

I have tried this only in Ubuntu (in various Ubuntu versions from 9.10 through 10.10), if that helps.

share|improve this question

1 Answer 1

The easy way: Run paprefs, go to Network Server and check Enable network access to local sound devices.

Whenever you SSH with X11 forwarding enabled, PulseAudio programs use X11 to discover your sound server (use pax11publish or xprop -root PULSE_SERVER to see for yourself). Just tell PulseAudio to listen for network connections (paprefs as described above), and all X11 programs will be able to use it.

(Other users will not have access to your sound server, unless you allow it yourself in paprefs. The authentication data is carried over in the X11 PULSE_COOKIE property, or you can copy ~/.pulse_cookie manually.)

Note however, that the PulseAudio stream is not encrypted this way, so it is okay for use at home, but not over the Internet.


The slightly more complicated way: Enable network access as above, but tunnel PulseAudio over SSH TCP forwarding. Use pax11publish to discover your PulseAudio port (usually 4713), connect with ssh -R 24713:localhost:4713, then run export PULSE_SERVER="tcp:localhost:24713". This will be slightly slower due to SSH overhead, but is safe to use over the Internet.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.