Problem: How can I launch PMS with a custom profile?
Solution:
Creating and loading profiles
A collection of PMS configuration settings is called a
profile. Profiles are stored in text files with a .conf extension. The default profile is saved as
PMS.conf.
A new profile can be
created by launching the PMS profile selector (see
below) and either navigating to a directory without a PMS.conf file (the profile will be saved there as PMS.conf), or navigating to any directory and manually adding the new profile filename (with a .conf extension) after the directory in the file name field. Alternatively, a new profile can be created by copying and editing an existing profile in a text editor (the options are documented here).
New profiles configured in the GUI should be
saved via the Save button if they are to be reused, and each profile should use a different port if it needs to run at the same time as other profiles.
A profile can be
loaded interactively by launching the PMS profile selector (see
below), navigating to a directory with a saved .conf file, and selecting it. For automatic loading options (e.g. via shortcuts), see below.
Profile name
To distinguish between different profiles in the renderer, set the name option (this must currently be set manually in the .conf file) e.g.:
- Code: Select all
name = My Profile
If no name is specified, the hostname is used.
Unique profile ID
Each profile must have a unique UUID:
- Code: Select all
# this is just an example; don't copy it
uuid = abcd1234-1234-1234-1234-12345678abcd
A new UUID is created and saved automatically (when PMS exits) whenever PMS creates a new profile (e.g. the first time it is run), but profiles that are copied and edited manually will need to be given a new UUID. The easiest way to do this is to delete the UUID from the new profile. This allows PMS to create and save a new UUID the next time that profile is loaded. Alternatively, you can change one or more of the digits in the copied file's UUID — as long as you make sure the UUID in each profile is different. (If you run two instances of PMS with different profiles that share the same UUID, the renderer will see them as one server.)
Profiles can be selected in three ways:
1. GUI
As of PMS 1.30.0, it's possible to select a custom profile or create a new one by launching PMS via the "PS3 Media Server (Select Profile)" Start Menu shortcut on Windows and
Linux. A similar shortcut/launcher may be available in builds on other platforms.
2. Environment Variable (Advanced):
PMS also supports multiple profiles by means of the PMS_PROFILE environment variable. This is mainly useful on Unix systems where environment variables can be set on a per-process basis, though it can also be used on Windows e.g. to set a global profile directory/path for all users.
If this variable is unset, the
default profile directory is used to locate PMS.conf (and WEB.conf, if used).
If PMS_PROFILE is an absolute or relative (to the working directory) path pointing to an existing directory, then PMS.conf is loaded from and saved to that directory. If PMS_PROFILE is set, but doesn't point to an existing directory, it is assumed to be a relative or absolute path to a profile file. Note: while the file doesn't need to exist, the directory containing it must exist if the file is to be saved.
Unix (Linux, Mac OS X &c.):
- Code: Select all
PMS_PROFILE=PMS.conf ./PMS.sh
PMS_PROFILE=relative/path/to/profile.conf ./PMS.sh
PMS_PROFILE=/absolute/path/to/myprofile.conf ./PMS.sh
Windows:
- How To Manage Environment Variables in Windows XP
- How to Add, Remove or Edit Environment variables in Windows 7?
3. Property (Advanced):
The profile file/directory can also be set via the pms.profile.path property e.g.
- Code: Select all
java -Dpms.profile.path=/path/to/PMS.conf net.pms.PMS
This is resolved in the same way as the environment variable.
On Windows, this property can be set in the
PMS .bat launcher or
via a shortcut. In both cases, multiple .bat files/shortcuts can be used to launch different profiles.