Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to define a VPN per Workspace/Application in Ubuntu?

share|improve this question
(as in, those 4 workspaces that you get with gnome/xfce that you can switch between) – Asaf Nov 24 '11 at 5:58
@khendrick Workspaces have nothing to do with networking. The only thing that I would even try to guess would be to have a VPN connection for the wireless and the wired connection. I don't know of any VPN solutions that can adequately do this, though. – KronoS Mar 27 '12 at 3:40

No. The networking components have no concept of "windows", "workspaces" or even "applications", while the window manager does not have the possibility to reconfigure the network.

share|improve this answer
such a thing would probably only be possible with a Proxy (since most network applications allow connecting through proxy). Is there a way to use a VPN as a proxy ? – Asaf Nov 24 '11 at 10:35

You can use multiple VPN connections at one time, if their routes are correctly defined in the spirit of "Split DNS" or "Split Tunneling" with no overlap of their IP segments, and if none of the VPN servers is configured to use VPN Tunneling. As long as you use the right IP addresses, everything else is automatic.

However, such a case is too simple to merit your bounty.

I therefore postulate that you are asking about having multiple VPN connections, each with its own DNS resolver for full Internet access. AFAIK this is impossible, since DNS resolving is done system-wide by Linux and is not concerned with workspaces.

Individual programs may be configured to access the Internet in different ways. For example, you could define 4 profiles in Firefox where each one accesses the Internet differently, but you will still need to create 4 icons, one per workspace, for launching Firefox with the right profile. This doesn't seem to be what you are asking for.

Otherwise, the only other solution I can think of is to use a virtual machine in the additional workspaces, where each VM connects to a different VPN. This solution will even work with VPN Tunneling, but it is somewhat cumbersome to use.

share|improve this answer
You can have a separate DNS server for each Firefox profile by using a separate SOCKS proxy per profile and setting "network.proxy.socks_remote_dns = true" in about:config – agporwfnz29 Apr 1 '12 at 12:57

This is requires a good deal of work but I think it is possible and requires a great deal of RAM,

virtuialize 3-4 sepearte Linux's then setup each Linux in the seperate workspaces with a VPN

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .