I want to use tor on a guest system. I'm using Ubuntu both on host and guest system. How to torify virtualbox. i want to do via virtualbox settings not in guest.

  • I want to use ubuntu
    – Vesal75
    May 22 '16 at 15:47
  • Maybe you should try reading all the possible answers on the question.
    – cacahuatl
    May 22 '16 at 16:09

You're absolutely right about how the things should work! Here is how it's done :

  1. Make a dedicated network for your VM('s)
  2. Do not use DHCP on it, let your host be and the rest of them will be 2-250, for example, keep it a single network of Class C (/24 in CIDR mask)
  3. In your host, make a dedicated DNS server and use it as a non-forwarding one : it resolves everything by itself, delegating dot-onion zone to the Tor. A Tor config must have DNSPort for it. it is done like this in ISC BIND(I highly recommend you to use it):

in Debian it's in /etc/bind/named.conf.default-zones

zone "onion" {
 type forward;
 forward only;
 forwarders {;

add it at the end **before** all-closing curly and semicolon.
  1. Route all the traffic from to directly
  2. Route all the rest of the traffic from to TransPort of Tor

If you also need an extensive HS-related stuff, add VirtualMapping in tor config, and forward EVERYTHING to that destination to Tor's TransPort

I'm using IPTables, but you can use a pf for that too.

  • I don't know what is a dedicated network
    – Vesal75
    May 22 '16 at 18:11
  • in VirtualBox it's called Host-Only network
    – Alexey Vesnin
    May 22 '16 at 18:39

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