Multiple Firefox instances with different network settings


Prior to f10 I always created a second user that I allowed to display applications on my desktop that I use to launch a second instance of Firefox.  There are lots of reasons to want to do this.  The most obvious is that the second user is completely isolated from my desktop so I can use my desktop instance of firefox for basic browsing and the second user for access to bank accounts, etc.  This completely eliminates any possibility of cross-site scripting issues.

At work I also used this method to have my desktop for basic browsing direct to the internet while the second user was configured to go through my proxy at home to access web services there.  This includes MythWeb and my development wiki (running off of PmWiki) where I keep notes on writing and software development projects along with important information like the model of blower motor in my A/C (which required replacement last summer and where I saved about $500 by doing it myself).

The problem arose when I tried to use mythweb on that second user at work (never mind the “hey, aren't you supposed to be working” issue – we have that all worked out).  I could easily watch a recorded program but there was no sound.  Turns out that PulseAudio, the new sound server for linux which has been adopted by fedora, doesn't allow multiple users access to the sound drivers, at least not by default.  You can set up pulseaudio to run in a system-wide setting but the PulseAudio people say this is probably not a good idea (and give several reasons why).  Fedora follows their lead and runs PulseAudio from the session management for your desktop. This is why the second user cannot access the sound drivers.

My problem with this is obvious – the second user can't play audio – and also not so obvious – why the hell would anyone build a “server” that only allows one user to connect to it?  That's not a server, folks.  That's a bottleneck.

I never got around to trying the system-wide configuration of PulseAudio because that required writing an init script that I would have to maintain privately.  I'm too lazy for that.  Fortunately, for this particular situation, I can eliminate the second user at work and simply use two independent Firefox profiles run from the same desktop.  This solution is much easier to deal with than the system-wide PulseAudio solution but it isn't quite as isolated as the two-user method when dealing with cross-site scripting.  Still, for use with and without a proxy at the same time, it works great.

Setting up Profiles

firefoxprofilemanager1

Firefox's Profile Manager

You'll need to exit out of your current Firefox session first.  Then open a terminal window.  From there, type the following command:

firefox –ProfileManager

This will launch the Firefox tool for managing your profiles.  All that is required is to pick a unique name.  The directory specified for the profile should be fine, though you may want to make sure it does not share the same directory as your default profile.  It shouldn't, but a double check wouldn't hurt.

Starting Each Profile

Each profile must be started with two arguments, as in this example:

firefox -P myProfile -no-remote

The -P argument specifies the name of the profile you want to launch, in this example the profile named myProfile.  The -no-remote is required to prevent firefox from attaching a new window to an existing firefox instance.  You must do this for all profiles or the desired behaviour (separate profiles) won't happen.

I place a gnome Custom Application Launcher for each profile into a GNOME Drawer using the same Firefox icon and a different Name for each.  You can add the custom launcher by right clicking on a GNOME panel and choosing the Add to Panel option.

Problems

The drawback to this method is that if you used a desktop icon or menu item to open another window for firefox then the updated method will launch a new instance of firefox instead.  The difference (higher memory use) is noticable if you have a slower system (I have a quad-core at home and dual-cores at work with 4GB memory so it's less noticable).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.