#860297 torbrowser-launcher: it is not possible to launch 2 torbrowsers on the same host from 2 different users

Package:
torbrowser-launcher
Source:
torbrowser-launcher
Submitter:
Date:
2026-07-06 17:37:10 UTC
Severity:
wishlist
Tags:
#860297#5
Date:
2017-04-14 08:18:15 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
2 people on the same system, from 2 different monitors both started torbrowser-launcher.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
Only 1 person can start a torbrowser. The other person gets a graphical window with the message: Tor unexpectedly exited. This might be due to a bug in Tor itself, .....
   * What outcome did you expect instead?
Both people should be able to start torbrowser in parallel.

Some more information about my system:
bs@majestix:~$ dpkg -l | grep "\<tor"
ii  tor                  0.2.9.10-1  amd64  anonymizing overlay network for TCP
ii  tor-geoipdb          0.2.9.10-1  all    GeoIP database for Tor
ii  torbrowser-launcher  0.2.6-3.1   amd64  helps download and run the Tor Browser Bundle
ii  torsocks             2.2.0-1     amd64  use SOCKS-friendly applications with Tor

If you only have one monitor you can see the error if you do the following with 2 users (in my case user bs and user tim):
# test preparation:
bs@majestix:~$ xhost +
bs@majestix:~$ export LANG=C

# make sure it works with firefox (without tor):
bs@majestix:~$ sudo su - tim /usr/bin/firefox &
bs@majestix:~$ /usr/bin/firefox
# now 2 firefox are running

# test with torbrowser:
bs@majestix:~$ sudo su - tim sh -c /usr/bin/torbrowser-launcher
bs@majestix:~$ /usr/bin/torbrowser-launcher
# it is not possible to launch 2 torbrowsers on the same host from 2 different users
# we get the error in a grapical window: Tor unexpectedly exited. This might be due to a bug in Tor itself, .....
# the window also contains a button "Restart Tor". If the button is pressed it shows the previous error.
# If I stop the torbrowser started as user tim, and press the button "Restart Tor" after that, the torbrowser is started as user bs



*** End of the template - remove these template lines ***

#860297#10
Date:
2017-05-03 12:49:00 UTC
From:
To:
Hi Bernd,

I believe that the problem is due to torbrowser-launcher not only
launching the browser, like when you launch Firefox, but also launching
it's own instance of tor. When this instance is already running under
your current user, you won't be able to launch a second instance using
the same SOCKS port.

Holger Levsen has created a how to run torbrowser-launcher as another
user in another X environment:
https://anonscm.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git/tree/debian/examples?h=debian/sid

It's also possible to run a second TorBrowser configured to use system
tor, which might be a workaround for the tor instance problem.

Some other ideas:
https://tor.stackexchange.com/questions/2006/how-to-run-multiple-tor-browsers-with-different-ips

I've not tested any of these myself. If you do, please report back.

Although I find this very interesting, I'd like to close this bug, as I
believe that it exceeds the intended usage of this package and is not a
bug in the packaging itself. This should either be reported upstream or
documented on the Debian wiki. What do you think?

Cheers!
u.

#860297#15
Date:
2017-05-03 13:14:43 UTC
From:
To:
u:

Agreed. IMO we would need upstream support for running multiple Tor
Browsers as the same user.

Cheers!

#860297#20
Date:
2017-05-26 20:25:29 UTC
From:
To:
Please understand, the problem is not, to run multiple Tor Browsers as
the same user.
The problem is to run multiple Tor Browsers, each from a different
user at the same time on the same machine.

After investigation I found, that this is because of a fixed SOCKSPORT
and and fixed CONTROLPORT.
But each user needs his own SOCKSPORT and CONTROLPORT.

To fix this, the upstream script which is installed at
~/.local/share/torbrowser/tbb/x86_64/tor-browser_de/Browser/start-tor-browser
has to be changed for each user. The patch is attached.

The patch first searches for free ports and then modifies the config
files to use the free ports.

I have build a wrapper script for torbrowser-launcher to apply the
patch, if it isn't already applied.
But I hope it will be fixed by upstream.

#860297#25
Date:
2017-05-26 20:26:05 UTC
From:
To:
Please understand, the problem is not, to run multiple Tor Browsers as
the same user.
The problem is to run multiple Tor Browsers, each from a different
user at the same time on the same machine.

After investigation I found, that this is because of a fixed SOCKSPORT
and and fixed CONTROLPORT.
But each user needs his own SOCKSPORT and CONTROLPORT.

To fix this, the upstream script which is installed at
~/.local/share/torbrowser/tbb/x86_64/tor-browser_de/Browser/start-tor-browser
has to be changed for each user. The patch is attached.

The patch first searches for free ports and then modifies the config
files to use the free ports.

I have build a wrapper script for torbrowser-launcher to apply the
patch, if it isn't already applied.
But I hope it will be fixed by upstream.

#860297#30
Date:
2017-05-27 07:19:00 UTC
From:
To:
Hi Bernd,

Yes, I had perfectly understood this the first time I read your bug
report, no worries.

I'll open an issue upstream to ask for review / inclusion of your patch
or a modified version thereof.

Cheers!
u.