Using Tor Browser and TorBox together

Update of 03rd of April 2023
Tor Project and Mullvad announced the launch of the Mullvad Browser. This browser is built on the same principles and with similar safety levels as the Tor Browser — but that works independently of the Tor network. In short: the Mullvad Browser is Tor Browser without the Tor Network. It gives Mullvad Browser some advantages in combination with TorBox. With this combination, you route all client network traffic through tor and use a safe Browser. In parallel, you avoid the problems with the tor over tor situation, which the Tor Browser creates if used with TorBox. See more here.

Wouldn’t it be great to combine Tor Browser and TorBox? Tor Browser prevents fingerprinting, isolates each website, and clears cookies and browsing history. However, TorBox routes not only your Web traffic but all your data through the Tor network. It also mitigates a possible weak point of the Tor Browser. If an application from the Internet manages to break out of the browser’s containment, IP leakage is still prevented by the TorBox (see, e.g., Tor Browser Deanonymization with SMB). Additionally, Tor Browser is not a solution if someone mainly uses mobile applications.

Unfortunately, such a combination will create a “Tor over Tor scenario” because the Tor Browser launches its own Tor instance on the client device. This scenario has its risks. Also, in late 2021, tor relays started to block tor over tor traffic because it can harm the Tor network. However, there are two workarounds:

  • using Bridges in the Tor Browser;
  • don’t launch Tor Browser’s own Tor instance; instead, utilise the SOCKS v5 proxy functionality of the TorBox.

The second workaround will be explained in more detail below.

Basics for all operating systems

The three fundamental steps to use Tor Browser without an own Tor instance on the client machine is for all operating systems the same:

  1. Download the latest version of the Tor Browser and install it — preferably without changing the standard settings regarding the installation location.
  2. Next, environment variables must be temporarily set to tell the Tor Browser not to load a Tor instance.
  3. Depending on whether the client is connected to the TorBox wirelessly via the TorBox AP or with a cable, the user.js or user_cable.js file must be used, which must be unnamed to user.js.
  4. Make a backup of the file prefs.js and put the file user.js in the profile directory to ensure that the correct variables are passed to the Tor Browser so that the browser is usable even if there is no own Tor instance available. The variables tell the Tor Browser that it should use the TorBox Socks5 as a proxy. The variables in the user.js will be integrated into prefs.js. This means that you need to backup prefs.js if you changed something with “about:config”, which you want to have restored.
  5. Start the Tor Browsers.

To restore the original behavior of the Tor Browser with its own Tor instance, do the following:

  1. Close the Tor Browser.
  2. Delete the files user.js and prefs.js, which will be regenerated automatically with the next start of the Tor Browser. If you changed something with “about:config”, which you want to have restored, then you have to copy back your old prefs.js.
  3. Regarding the environment variables: no action is necessary because we changed them solely temporary.
  4. Start the Tor Browsers.

What’s in the user.js?

user_pref("extensions.torbutton.use_privoxy", false);
user_pref("extensions.torbutton.settings_method", "custom");
user_pref("extensions.torbutton.socks_host", "192.168.42.1");
user_pref("extensions.torbutton.socks_port", 9050);
user_pref("network.proxy.socks", "192.168.42.1");
user_pref("network.proxy.socks_port", 9050);
user_pref("extensions.torbutton.custom.socks_host", "192.168.42.1");
user_pref("extensions.torbutton.custom.socks_port", 9050);
user_pref("extensions.torlauncher.control_host", "192.168.42.1");
user_pref("extensions.torlauncher.control_port", 9051);

What’s in the user_cable.js (has to be renamed as user.js before used)?

user_pref("extensions.torbutton.use_privoxy", false);
user_pref("extensions.torbutton.settings_method", "custom");
user_pref("extensions.torbutton.socks_host", "192.168.43.1");
user_pref("extensions.torbutton.socks_port", 9050);
user_pref("network.proxy.socks", "192.168.43.1");
user_pref("network.proxy.socks_port", 9050);
user_pref("extensions.torbutton.custom.socks_host", "192.168.43.1");
user_pref("extensions.torbutton.custom.socks_port", 9050);
user_pref("extensions.torlauncher.control_host", "192.168.43.1");
user_pref("extensions.torlauncher.control_port", 9051);
Implementation with macOS

Manually: Tor Browser with TorBox

  1. Download the latest version of the Tor Browser and install it — the default installation directory of the Tor Browser is the application folder; the default profile-directory is somewhere in “~/Library/Application\ Support/TorBrowser-Data/Browser/” and have the extension .default
  2. Open a terminal (in the folder Applications / Utilities the program “Terminal”) and execute the following commands:

Manually: Restore – Tor Browser without TorBox

  1. Close the Tor Browser
  2. Open a terminal (it is in Applications / Utilities) and execute the following commands:

Using a shell script
We have created a shell script, which makes the process described above much easier (and yes, it works also under Catalina):

  1. Download the shell script “start_tor_browser_on_macos.sh” for clients connected to the TorBox wirelessly or “start_tor_browser_on_macos_cable.sh” for clients connected to the TorBox with a cable (right-click the link and press “save as” or something similar).
  2. Open a terminal, go to the directory where you downloaded the shell script and write the following command to make it executable:
Tor Browser is running under macOS without its own Tor instance on a TorBox client device. It was started by the script “start_tor_browser_on_macos.sh”.
Tor Browser is running under macOS without its own Tor instance on a TorBox client device. It was started by the script “start_tor_browser_on_macos.sh”.
Implementation with Linux

Manually: Tor Browser with TorBox

  1. Download the latest version of the Tor Browser and unpack it. The default installation directory is the “tor-browser_xx-XX” directory where you unpacked the .tar.xz file (e.g., ~/Desktop/tor-browser_en-US/); the default profile-directory is in the default installation directory under “Browser/TorBrowser/Data/Browser/profile.default/”.
  2. Open a terminal, go to the default installation directory and execute the following commands:

Manually: Restore – Tor Browser without TorBox

  1. Close the Tor Browser
  2. Open a terminal, go to the default installation directory and execute the following commands:

Using a shell script
We have created a shell script, which makes the process described above much easier:

  1. Download the shell script “start_tor_browser_on_linux.sh” for clients connected to the TorBox wirelessly or “start_tor_browser_on_linux_cable.sh” for clients connected to the TorBox with a cable (right-click the link and press “save as” or something similar) and put it into the default installation directory (e.g., ~/Desktop/tor-browser_en-US/).
  2. Open a terminal, go to the default installation directory, make “start_tor_browser_on_linux.sh” or “start_tor_browser_on_linux.sh_cable.sh” executable and start it:
Implementation with Windows 10 (2018 or newer)

Manually: Tor Browser with TorBox

  1. Download the latest version of the Tor Browser and install it. The default installation directory is the folder “Tor Browser” on the Desktop (e.g., ~\Desktop\Tor Browser\); the default profile-directory is in the default installation directory under “Browser\TorBrowser\Data\Browser\profile.default\”.
  2. Open a terminal, go to the default installation directory and execute the following commands:

Manually: Restore – Tor Browser without TorBox

  1. Close the Tor Browser
  2. Open a terminal, go to the default installation directory and execute the following commands:

Using a batch file
We have created a batch file, which makes the process described above much easier:

  1. Download the batch file “start_tor_browser_on_windows.bat” for clients connected to the TorBox wirelessly or “start_tor_browser_on_windows_cable.bat” for clients connected to the TorBox with a cable (right-click the link and press “save as” or something similar) and put it into the default installation directory (e.g., ~\Desktop\Tor Browser\).
  2. Open a terminal, go to the default installation directory, and execute “start_tor_browser_on_windows.bat” or “start_tor_browser_on_windows_cable.bat”.
  3. Now the Tor Browser starts without its own Tor instance. If you want to restore the original behavior of the Tor Browser with its own Tor instance, you have first to close the Tor Browser, and after that, press a key in the still open script window.
It doesn’t work, and I’m lost ?

Don’t give up! Contact us and describe in detail what you already tried — we will try to help you.