This is one of these throw away posts that I place here more for myself than for you guys. This way I know how to do this next time around. I wanted to talk about running two instances of Firefox at the same time. More accurately, an installed Firefox instance and Firefox Portable instance side by side. Why would you ever want to do that?
There are many reasons. For example, you might want to use the Tor Browser Bundle to do some anonymous browsing without actually needing to close your main browser window. Or you may want to use your portable browser to sign into the same website using different credentials. I’m sure you have been in this situation before – you are working on a website and you are signed in as administrator. The feature you are coding will only be visible to no-admin users. Wouldn’t it be nice to simply be able to open a new instance of Firefox and sign in as a non-admin without having to log out?
A lot of people think that Firefox Portable would solve this issue – it is a specialized build after all and it uses it’s own profile and cache and extensions which are stored in a completely different place from the other Firefox. There is no possible overlap between the two. But the Portable version will still refuse to run if it detects that another copy of Firefox is already running.
There is a way around this though. Your copy of Firefox Portable should have a file named FirefoxPortable.ini in it’s directory.
If you don’t see that file, it may be located in the Other/Source folder. If it is, you will simply need to copy it back to the root directory where the Firefox Portable executable is located. Once it is there, you will need to open it with a text editor and change a single value inside:
Locate the following line:
And change it to:
That’s it! Next time you try to open Portable Firefox it won’t be checking for a running instance and will happily coexist with an installed copy.
Running two instances of Firefox at the same time
The solution I posted above only works with the portable version of Firefox. What if you want to run two instances of your installed Firefox? Well, then you need to use profiles.
As you may or may not know, Firefox allows you to define distinct profiles. Each one gets it’s own configuration folder for extensions, bookmarks and settings. You can open the profile creation dialog by running your Firefox with the --profilemanager attribute:
"C:Program FilesMozilla Firefoxfirefox.exe" --profilemanager
On most unix based systems (linux, unix, bsd, osx – ie. everything that is not windows) you can usually get away with:
This is because the firefox binary will usually be in your path. This will open the profile manager dialog and it will let you create a new profile. Make one with all the default settings then close firefox. Next you need to open with some more attributes:
firefox -P profilename --no-remote
The -P tag specifies the profile name which goes right after it. The --no-remote attribute prevents Firefox from checking whether or not another copy is already loaded into memory. This way you will be able to run two separate instances of the browser – each with it’s own cache, extensions, bookmarks, config and it’s own sessions.
You probably might want to create shell script or a shortcut which will run the second instance this way for you. This trick does not require a portable firefox version. It will work with a single installed copy.