How To install PS3 Media Server to Ubuntu in Headless mode

NOTE: 5-20-2014 – I have switched from the PS3 MediaServer to Universal Media Server. I find it to be better than the PS3, easier to setup and maintain, and transcodes better. Please see my page on how to setup UMS in Ubuntu.

I will leave this PS3 setup page here, but I suggest UMS instead.

PS3 media server is now my go to application for transcoding and playing media around the house since development on Mediatomb came to a halt. And this PS3 Media Server is sweet. So far it plays anything I throw at it on the Ps3 and the Sony NMP-200 I use around the house.

P.M.S. was meant to run in a GUI display. So there are a few extra things we need to do so that it runs on a Ubuntu Server in headless mode (without a GUI). After all, who needs a GUI on a server anyway… Since PMS version 1.81.0, I’ve stopped using the manual installation and instead am using the repository. It makes for an easier install and updates are handled via apt-get.

I’ve used this on Ubuntu 12.04.

We will need a few pre-reqs:

apt-get install mplayer mencoder ffmpeg openjdk-6-jre

Let’s add the repository from which we will install the PMS and run the installation.

 
sudo add-apt-repository ppa:happy-neko/ps3mediaserver
sudo apt-get update
sudo apt-get install ps3mediaserver

Next we create a system user account for the PMS to use. By default, PMS runs under the root account, but it’s always a good idea to keep things as secure as possible.

sudo adduser --system --group ps3mediauser

Now lets edit the PMS config file and setup the custom user and set it to autorun on startup. Edit /etc/default/ps3mediaserver, locate the following items in the file and make the changes as indicated.

PMS_START="yes"
PMS_USER="ps3mediauser"
PMS_PROFILE="/home/$PMS_USER/.config/ps3mediaserver"

Next, we need to create a PMS.conf file in the ps3mediauser home directory. You will need to run these commands as root since the ps3mediauser account is a system only account. Copy in the default PMS.conf file.

su -i
mkdir -p /home/ps3mediauser/.config/ps3mediaserver
cp /etc/skel/.config/ps3mediaserver/PMS.conf /home/ps3mediauser/.config/ps3mediaserver

Next you should edit the PMS.conf file and change the ‘folders’ to reflect the location of your Media files. The other settings can be left at default for the most part, but it doesn’t hurt to familiarize yourself with whats available.

folders =/mnt/media/tv,/mnt/media/movies,/mnt/media/music

With all the settings in place, you need to change ownership of the ps3mediauser home folder:

 
chown -R ps3mediauser:ps3mediauser /home/ps3mediauser

Last thing to check is the /tmp/ folder. PMS will use this folder and if the ‘root’ user had stuff in that folder related to PMS, the non-root user will have issues running the service. It doesn’t hurt to remove any older remnants.

rm -F /tmp/jna
rm -F /tmp/ps3* 
rm -F /tmp/hsperfdata*

Some people have reported that they needed to change permissions in /tmp/. I’ve never had to do that, but it is something to keep in mind.

Lastly, just start the service:

sudo start ps3mediaserver
Bookmark the permalink.

14 Responses to How To install PS3 Media Server to Ubuntu in Headless mode

  1. Jon Brooks says:

    Thanks for the awesome guide. I had this sort of working (from the linux tar ball) but without a good start up script. I then proceeded to waste an afternoon going down a rabbit hole trying to get the packaged deb version to work – it didn’t work for me. So I reverted to the 1.72 version from the tar ball with your script and all is working. I’m streaming to a Panasonic Blu-Ray Player (DMP-BD75).

    • Jon Brooks says:

      Forgot to mention that I couldn’t get this to work as user “pms”, so I’m currently running as root, which is not ideal. Any suggestions as to why it fails so miserably as a normal user would be much appreciated.

      • mike says:

        Check the pms logs, they offer good info for troubleshooting. I would usually guess there is a permissions issue somewhere that keeps user ‘pms’ from accessing a file/directory it needs. One thing to look for, in the /tmp/ folder, you should delete any leftovers from previous pms attempts. The /tmp/ stuff may have been created as root, and when you try to re-run as PMS, you lack the rights to delete/recreate the files that root had there.

      • lars says:

        I had the same issue, trying all this on debian in a virtual machine. After changing the owner of the “pms”-dir, there was still no success. The log-file gave the answer: no access to tmp-dir.

        After giving all users rights for writing in “tmp” everything works great.

        Thanks for all your work.

  2. BillG says:

    Thanks! Great how-to, much appreciated.

    Like Lars, I had to change the permissions to the /tmp directory to get things to work running the server as user pms.

  3. Richard says:

    Worked like a charm thank you.

  4. Richard says:

    you should update the user to be more secure and create the user with the following command

    sudo adduser –disabled-password –system –home /var/lib/pms –gecos “Play Station Media Server” –group pms

  5. Al_ says:

    Thanks for the script, great help.

    I thing that I do not understand: how does the symbolic link /opt/pms prevent you from the need to update the config file? I understand that /opt/pms/PMS.conf is created/modified in /opt/pms-xxxx (as /opt/pms is simply a link).

    Best

    Al_

  6. Michael says:

    Just wanted to say thanks a million. I have had a time trying to get MediaTomb to work, and finally decided to go to PS3 Media Server(which I had used for my previous Windows server…ughh…) I looked around at a few how-to’s and your’s was the best one I could find. It did the job and it did it right. Thanks again. Now off to watch my mkv Miyazaki films!
    🙂

  7. David says:

    Hello. Thanks so much for this guide. I am having trouble with my init terminating the server. I have tried uninstalling/reinstalling and googling the Upstart issue, fiddling with the Upstart init script (starton interfaces), but just can’t figure out what the problem is. The log file indicates nothing wrong. /tmp is chmod 777. I’m stumped! Any help would be greatly appreciated. I’m not really looking forward to debugging Upstart.

  8. AL Haines says:

    Thanks. Works great!

    SYSTEM INFORMATION
    Running LinuxMint Linux, the LinuxMint 15 (olivia) release.
    GNOME: 3.6.3 (Ubuntu 2013-03-18)
    Kernel version: 3.8.0-27-generic (#40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013)
    GCC: 4.7 (x86_64-linux-gnu)
    Xorg: 1.13.4 (08 May 2013 02:34:03PM) (08 May 2013 02:34:03PM)

    CPU INFORMATION
    AuthenticAMD, AMD A8-3850 APU with Radeon(tm) HD Graphics
    Number of CPUs: 4

    MEMORY INFORMATION
    Total memory: 7964 MB Total swap: 8197 MB

  9. Reyes says:

    I had all my content in my headless server and decided yesterday i was going to watch it on my ps3 via the samba server. Quickly realized it wasn’t going to work, i searched the net and found about the ps3mediaserver and had it running in minutes!

  10. Cool Dude says:

    I’m using Ubuntu 14.04 and the last three commands (starting with chown -R ps3mediauser:ps3mediauser /home/ps3mediauser) don’t work for me. So basically, PMS does not run on startup even though it is supposedly running because I have to stop it in the terminal to either launch the app or start it again in the terminal. Any ideas?

  11. Bhaskar says:

    The commands starting from “chown..” are not working for me. Now, PS3 Media Server is supposedly running as a service on startup but the server is not detected by any renderers. Even when I launch the GUI it doesn’t work. I have to stop the service in the terminal and then launch the GUI for it to work. I’m using 14.04

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve : *
16 + 15 =