[pulseaudio-discuss] "Permission denied" to remote shell?

Colin Guthrie gmane at colin.guthr.ie
Wed Nov 10 09:18:48 PST 2010

Hiya Brandon,

'Twas brillig, and Brandon Kuczenski at 10/11/10 05:52 did gyre and gimble:
> Hi,
> I am running pulseaudio [0.9.21-63-gd3efa-dirty] in system mode.  I just
> discovered that an identical command to play audio with mplayer works
> when logged into a local shell but fails when logged in remotely.

Are you 100% certain you are using system mode? This is expected
behaviour when using the (default) per-user mode, but it shouldn't
happen when using system mode as the "pulse" user is in the "audio"
group (or at least it should be!)

Although there is probably a more likely reason... see below.

> Basically, using gnome-terminal on the desktop:
> luser at poppy:/music$ mplayer -ao pulse my-song.mp3
> and that works.
> But when logged in via ssh [as luser], the same command does not work: I
> get the following in mplayer output:
> AO: [pulse] Init failed: Connection refused
> Failed to initialize audio driver 'pulse'
> Is there a reason for this? or am I somehow misconfigured?

Is the machine you are SSH'ing *from* running PA also? If so, then the
normal behaviour is to try and connect back to the machine you SSH'ed
*from* not to the local machine you are currently executing the command on.

This is designed such that you can SSH to a remote machine and run a GUI
application (e.g. Rhythmbox) and see the GUI locally as well as hearing
the sound it produces locally (i.e. a true thin client setup).

In order to do this, we piggy back on the the X11 properties (xprop
-root | grep PULSE) of the root X11 windows. As SSH forwards X11 by
default, your libpulse client on the remote machine will read these X11
properties and try and establish a connect back to the source machine.

In order to allow this connection you need to run paprefs on the machine
you ssh from and enable the network support.

If you want to access the local machine you can either disable X11
forwarding when SSHing (-x or -X or something... can't remember which),
or run:
 unset DISPLAY
before running your mplayer command.

Hope this helps.



Colin Guthrie

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

More information about the pulseaudio-discuss mailing list