Site icon Leonid Mamchenkov

Running simultaneous Firefox sessions with different profiles

The more and more I use Firefox, the more add-ons I install, and the heavier it becomes.  Recently I got to the point where I am annoyed by all the heavy weight functionality, but cannot remove it complete because I need it occasionally.

The solution to my problem turned out to be pretty simple, even if it required some Google searching and IRC chatting – multiple profiles.

By default, when you run Firefox for the first time, it created a default profile to store all your stuff – saved passwords, bookmarks, add-ons, etc.  However it is possible to create more profiles and separate things a bit.  For example, I currently have three profiles:

Creating this profiles in very easy.  As per Firefox documentation, all you need to do is close all current Firefox windows, and then run Firefox from command line with -ProfileManager parameter.  A small window will popup that will give you options to create, rename, and delete profiles, as well as select with which profile to start the new session.

The problem that I came across was running several Firefox sessions in parallel, each with its own profile selected.  I could easily select the profile for the first session, but when I was starting up the second session, it would just reuse the same profile from the first session.

The solution to this problem is either setting MOZ_NO_REMOTE environment variable to 1, or specifying -no-remote parameter on the command line.  The -no-remote parameter on the command line seems to be a recent addition to Firefox, so if it doesn’t work yet for your version of the browser, you’ll need to fall back on to the MOZ_NO_REMOTE environment variable.

So, if you have a recent Firefox version, you need to run (updating your desktop and menu shortcuts seems like a good idea):

[user@host dir]$ MOZ_NO_REMOTE=1 firefox -ProfileManager

If you want to start Firefox with specific profile (e.g.: DesiredProfile), you can do so with

[user@host dir]$ MOZ_NO_REMOTE=1 firefox -P DesiredProfile

Alternatively, you can export the variable globally, by adding the following line to your .bashrc file

export MOZ_NO_REMOTE=1

If you have a recent version of Firefox, then the command changes to:

[user@host dir]$ firefox -no-remote -P DesiredProfile

Other things that you might want to keep in mind are:

Exit mobile version