Ubuntu – How to activate PulseAudio when only being logged in via ssh

pulseaudiosoundssh

I am using a console-based music player, called cmus. It is in the repositories.

If I ssh into my desktop computer from, say, a laptop and start cmus, I would like to be able to play music. But, if I'm not logged in via GDM on the desktop computer, pulseaudio doesn't seem to want to play sound. When I login via GDM on the desktop computer and start cmus through ssh, I do get sound.

My question is: Can I work around this somehow? Can I tell pulseaudio to be active even though I am not physically logged on the actual machine, but only remotely?

Thanks for any and all help!

Note: I am not trying to tunnel the sound through ssh. I instead want to enable the sound to come out of the speakers of the computer I ssh into. Please note the difference. If all of this is unclear, please let me know and I'll try my best to clarify!

Best Answer

I know this question is a year old, but I figured this out myself just moments ago.

I have a machine (music@jukebox) and I discovered as long as I am logged in as the user music on the server I can log in simultaneously through ssh/putty/whatever on another machine and the audio plays through the speakers on the server machine just fine.

I hope this helps.