I found that the Tails has been evaluating Docker. However, I'd like to have a Docker image that connects only through Tor. I'm happy with setting my own proxy. Is there a recipe to do this?

What I expect: Run a docker container from an image, and get into a terminal where the VM can only connect to Internet through Tor. I'm happy with a Docker file that can do that.

If my question is still ambiguous, please feel free to ask for more details.

  • Yes it is possible. – jamescampbell Dec 25 '18 at 18:54
  • Please note that a docker container does not come with the same level of isolation as an actual VM. – Birb Sep 23 '19 at 1:07
  • @Izmaki Can yo please elaborate on that? – The Quantum Physicist Sep 23 '19 at 8:01
  • @TheQuantumPhysicist a docker container shares many things with its host such as the kernel. This, as an example, means that if your host kernel is vulnerable to an attack, an attacker may be able to go from a low privileges in the container to full privileges on the host machine. A VM has better "isolation" in that sense. – Birb Sep 23 '19 at 21:31
  • just use torsocks type this sudo torsocks on then reload the program – MassHyper Oct 18 at 13:09

It's possible. Take a look at opnsense or tails. They have ability to transparently route all traffic through tor.

| improve this answer | |

Yes this is possible and I have a WIP code on github that spins up a new dockerized hidden service server. This should point you in the right direction: https://github.com/jamesacampbell/stealth-tor-docker/blob/master/README.md YMMV.

| improve this answer | |

This reminds me of Whonix. You could set up a Whonix VM "gateway" and connect whatever you wanted through that "gateway" (this is an assumption - all you need is access to the hypervisor network), like the regular "workstation" does. More info at https://www.whonix.org/wiki/About

If you change your requirement to "how can I run a VM through Tor only" then this applies.

| improve this answer | |

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.