7

I want to run Tor Browser, without the bundled Tor, using Qubes TorVM. Let's assume I have already got Qubes OS running.

The TorVM documentation states under Future Work: "Create Tor Browser packages w/out bundled tor". This is essentially what I want to do now, except I will need to manually set things up so that Tor Browser uses Tor through the TorVM rather than through the bundled Tor executable.

Why? Because the version of Firefox that comes with the Tor Browser Bundle is already configured to be relatively secure and Tor-friendly compared to stock Firefox.

  • Bundle your own Firefox rather than bundling your own Tor Browser? – Ry- Sep 25 '13 at 20:11
  • You're going to have a tough time doing that, especially with Tor Browser Bundle 3.0's design where the Tor Launcher Firefox extension launches the Tor binary. In summary, sticking Tor Browser in a VM behind a firewall is definitely worthwhile to do, but there will be a lot of development work before we/you are there, and then also there's maintenance to consider. – Roger Dingledine Sep 25 '13 at 20:45
  • Hi Roger, it's actually not that hard, thanks to brade implementing the TOR_SKIP_LAUNCH environment variable. See also my answer below. – adrelanos Sep 25 '13 at 23:05
3

This answer isn't perfect yet, but still better than nothing.

This answer mostly works for TBB 3.0 and above. (Currently the Alpha version of TBB.) Most of this solution is taken from Whonix's source code. It could be made to work with TBB 2.x (currently the stable version of TBB) as well, in that case get the modified Tor Browser start script (start-tor-browser) from Whonix 0.5.6 source code. (For TBB 2.x, see also TorifyHOWTO/WebBrowsers.) You can ask questions in the comments and I will improve this answer, if I can.

This is definitely doable and not rocket science. Also since TBB 3.0 works in Whonix out of the box. Download, [OpenPGP verification up to you], extract, run. No Tor over Tor. No modifications. (Because of environment variables and rinetd, see below.) So it might be useful to check out how it's done in Whonix. I try to summarize the relevant parts for you here...

Create a file /etc/profile.d/20_torbrowser.sh.

## Deactivate tor-launcher,                                                                                                                                                         
## a Vidalia replacement as browser extension,                                                                                                                                      
## to prevent running Tor over Tor.                                                                                                                                                 
## https://trac.torproject.org/projects/tor/ticket/6009                                                                                                                             
## https://gitweb.torproject.org/tor-launcher.git
export TOR_SKIP_LAUNCH=1

## The following TOR_SOCKS_HOST and TOR_SOCKS_PORT variables
## do not work flawlessly, due to an upstream bug in Tor Button:
##    "TOR_SOCKS_HOST, TOR_SOCKS_PORT regression"
##    https://trac.torproject.org/projects/tor/ticket/8336
## (As an alternative,
##    /home/user/tor-browser_en-US/Data/profile/user.js
## could be used.)
#export TOR_SOCKS_HOST="192.168.0.10"
#export TOR_SOCKS_PORT="9100"

## Something else to consider, but better don't use it, use proper stream isolation.
#export TOR_TRANSPROXY=1

Reboot, so the environment variables takes effect.

Due to the bug changing Tor Browser's proxy settings with a script isn't as trivial as exporting the environment variables TOR_SOCKS_HOST and TOR_SOCKS_PORT. Either change the proxy settings in Tor Button (sorry, I don't know which IP/port the Qubes-Tor-Gateway is providing) or use rinetd.

Sample config for rinetd (you have to adjust IP's and ports, i.e. connectaddress and connectport):

##
## this is the configuration file for rinetd, the internet redirection server
##
## you may specify global allow and deny rules here
## only ip addresses are matched, hostnames cannot be specified here
## the wildcards you may use are * and ?
##
## allow 192.168.2.*
## deny 192.168.2.1?

##
## forwarding rules come here
##
## you may specify allow and deny rules after a specific forwarding rule
## to apply to only that forwarding rule
##
## bindadress    bindport  connectaddress  connectport

## SocksPorts
127.0.0.1        9050      192.168.0.10    9050
127.0.0.1        9150      192.168.0.10    9150

Tor Button's New Identity feature won't work, because that requires access to Tor's control port. Unfiltered access to Tor's control port is recommended against, because the control port command "getinfo address" could leak your IP. Due to lack of control port access, you will also see a "your browser is not configured to use Tor" warning when Tor Browser starts, because it uses Tor's control port for its check. Those two things shouldn't matter much and could be fixed with something like Control Port Filter Proxy, but that's a different story.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.