Start multiple instances of Firefox

3

How can I have multiple independent instances of Mozilla Firefox 3.5 on the same X server, but started from different user accounts (consequently, different profiles)?

Limited success was only with Xephyr :1, DISPLAY=:1 /usr/local/bin/firefox, but Xephyr has no Cygwin/X's "rootless" mode so it's not comfortable (see other question).

The idea is to have one Firefox instance for various "Serious Business" things and the other for regular browsing with dozens of add-ons securely isolated.

Vi.

Posted 2010-03-31T19:26:30.057

Reputation: 13 705

Answers

2

In fact, you don't even need multiple user accounts to accomplish this. You can execute several Firefox instances inside the same user account using the no-remote argument. The command line arguments are documented at http://kb.mozillazine.org/Command_line_arguments

Dominik

Posted 2010-03-31T19:26:30.057

Reputation: 767

1this is probably true for the OP's situation. if all you want to do is open multiple firefox instances and you're using multiple profiles. using different user accounts might be preferable, though, depending on the situation. – quack quixote – 2010-04-01T02:36:34.460

1Yes, "-no-remote" works. I've tried MOZ_NO_REMOTE=1 /usr/local/bin/firefox, but it hasn't worked. – Vi. – 2010-04-01T04:17:14.437

1

You need to give authorization to connect the original X session for that other user. The easiest way is:

firstuser$ xhost +local:other-user
firstuser$ su other-user
otheruser$ firefox

From xhost man page:

A complete name has the syntax ``family:name'' where the families are as follows:

   inet      Internet host (IPv4)
   inet6     Internet host (IPv6)
   dnet      DECnet host
   nis       Secure RPC network name
   krb       Kerberos V5 principal
   local     contains only one name, the empty string
   si        Server Interpreted

   The family is case insensitive.  The format of the name varies with the family.

There are wrappers for su that does that automatically: gksu is one. You might be more comfortable using them.

liori

Posted 2010-03-31T19:26:30.057

Reputation: 3 044

No, it's not about access to X server. It's about "Firefox already running. Close other instance" or just opening empty window in response. – Vi. – 2010-04-01T04:14:08.343

0

For accessing a second account (such as a separate and dedicated login for a given client), I just use ssh -X with firefox -no-remote, such as this one-liner for a user "dev":

$ ssh -X dev@localhost firefox -no-remote

I do get confused about what windows are for which account though (as I just did in testing this).

sage

Posted 2010-03-31T19:26:30.057

Reputation: 873