Multiple isolated instances of Firefox within a single login session on Linux

Here's a simple solution to run multiple instances of Firefox, each with own user profile (and thus cookies, extensions and themes), all running as separate processes. Useful for troubleshooting and to keep one misbehaving site from crashing all your firefox windows (I'm guilty of running way too many at once).

I used to accomplish this by setting up multiple user accounts and then using sux to startup multiple instances:

1
2
user1@madcow:/$ sux user2
user2@madcow:/$ firefox &

The above will fire up a firefox instance inside the user1's desktop session running as user2. It works and maybe preferable in some situations, but there's a better way for what I'm trying to do:

1
user1@madcow:/$ firefox -ProfileManager -no-remote &

The above will fire up the Profile Manager window allowing to start up separate instances of Firefox with multiple profiles:

1
2
3
4
5
user1@madcow:/$ ps auxf | head -1 && ps auxf | grep firefox
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
user1    21652  2.8  7.5 460416 274592 ?       Sl   Feb10  23:05 /usr/lib/firefox-3.0.17/firefox -p -no-remote
user1    22432  1.7  1.9 225680 69688 ?        Sl   Feb10   1:05 /usr/lib/firefox-3.0.17/firefox -p -no-remote
user1    23004  0.0  0.7  73964 28296 ?        Sl   Feb10   0:01 /usr/lib/firefox-3.0.17/firefox -p -no-remote

To make this the default way of starting up Firefox in Gnome, right click the Firefox application launcher in the panel, go to "Properties" and change "Command" to "firefox -ProfileManager -no-remote".

Very ni-i-ice.

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).