Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

` My final goal is to have a virtual machine at work in which anything that happen inside (tcp, udp, ping, ...) will use the Internet connection of a computer at home. So, if inside this VM should I open an Internet browser to a site such as "show my IP", my home IP should be printed. I am also looking for a way to debug/develop a software inside this VM, but I would like to tunnel only the connections of this software, not the full graphical interface, this is why a Remote Desktop solution won't fit me.

The connection between the both computer should be secured somehow, like in a SSH tunnel. This ultimately should allow me to have a portable VM in which I can connect to whatever networks I have access at home, in a secure way.

This is my configuration:

  • At work, I have a LAN-connected desktop computer, with Windows 7 Professional Edition as a host [computer W]
  • On this same computer, I have a Virtual Box machine running Windows XP [computer V]
  • At home, I have a laptop computer, running Windows 7 Home Edition [computer H]
  • This laptop is connected to a Livebox 2 broadband modem by Wifi.

What I am trying to do is to sit at work in front of the virtual machine [V], and connect to a webpage as if the request was issued from the laptop [H] at home, and the data should be securely tunneled between the both. But if I am using internet directly inside [W], it should use the normal LAN interface at work.

To achieve my goal, I first try using VPN, than SSH tunneling, without success.

  • I first tried to install Teamviewer between [W] and [H]. This is working fine, I can send files, share desktop, etc. Teamviewer has a VPN mode that creates a new VPN network interface with its own IP, both on computer [W] and [H]. This allowed me to connect [H] as a network computer inside [W] and I was able to share files, but not to share Internet.

  • At this point, I tried to use from [W] the Internet as if I was at home. I setup a route (using route add from command line in [W]) in order to instruct each packet going to a given website to pass by the new VPN interface on [W], with the hope it will be forwarded to [H], but the webpage was simply inaccessible.

  • I then tried to setup a Windows VPN connection between [W] and [H], using the Windows 7 VPN feature. [H] was the server and [W] the client. But it failed: I got the "Unable to join a remote PC while trying to VPN" 720 Error when I was setting up the client on [W]. I think the problem is the Livebox 2 that could blocks the packets. But I am not sure of this: 1) with Teamviewer it works fine, 2) Livebox 2 has a configuration page for port mapping that gives the proper configuration to map VPN ports as an example so I guess that it should allow it, 3) I opened the ports 1723 (TCP) and 500 (UDP) according to some forums.

  • Virtual box has a network configuration parameter in which I can use the VPN network interface created by Teamviewer as a bridged connection. This is suppose to work in the sense that all packets issued by the virtual machine [V] is supposed to go directly to [H]. But I had no internet connection inside [V]. Using the NAT mode, [V] has internet. For me this is the feature that I look for: filtering all connections from the virtual box application to the VPN network interface, and the remaining should use the normal LAN interface. Apart from the build-in feature of VBox, I even do not know if it is possible to route the packet from a given application to a given interface.

  • Finally I tried also SSH tunneling, but this is not the solution I looked for. Using an external SSH server (Linux), I was able to create a localhost connection on [W] (or [V]), using something like 'ssh -N -D server[H]' in order to allow a web browser located in [W] to connect to any website using the SOCKS 5 proxy created locally (SOCKS is a build-in feature of SSH).

  • But repeating the same operation on windows, using a windows SSH server inside [W] (I tried freeSSHd), it failed: SFTP worked, but not the SOCKS tunneling, it was like the browser in [H] did not find internet.

  • Finally only Teamviewer looked able to create a VPN between [W] and [H], but I am not able to use it, as I want, I mean using the Internet connection of [H] sitting in front of [W]. I also tried to bridge the VPN interface and the wifi interface inside [H], but it blocked my laptop, and I tried also the Internet Connection Sharing, trying to share on [H] the wifi connection over the VPN interface. This fails also, but it seems because Teamviewer actually use the wifi interface to be able to provide the VPN link, so I guess I am creating a recursive loop.

I do not know what to try next... Thank you for any advice!!

share|improve this question
    
May I ask why you want to do this? It's not difficult, depending on what firewall rules sit between you and the Internet. –  EEAA Aug 23 '12 at 23:39
    
There are many applications: transfer files directly in the VB in a secure way from local network, create a VB that I will be able to move in any unsecure place and connect safely to bank websites, ... By the way, many websites such as Facebook, twitter and skype are open at work, so, no, it is not to escape control ;-) About firewall rules, I think I can open any port > 1024, but the only doubt is if the livebox lets GRE packets pass... but then how Teamviewer managed it? –  mountrix Aug 23 '12 at 23:45
add comment

1 Answer

You're way over-thinking this.

RDP from V to H, using your externally facing home IP address. RDP creates an encrypted tunnel, and if you set it up right (or right-ish), it's fairly secure. Make sure you have a strong password and a non-default account, and change the RDP port to something non-default as well. If needed (and hopefully it is), you can set up a DMZ or port forwarding rules on your home router to makes sure H gets your RDP session.

It's what I typically do to engage in personal activities (like banking) from work [during breaks, of course], and gives me a testbox external to the corporate network for whenever some twit starts wagging their finger and accusing my network of being borked.

For enabling RDP to a Windows 7 Home edition, there's this nifty little hack. Does make life easier for when I can't get out of fixing a friend or family member's PC, seems like it might work for you too. Read the instructions, obviously.

share|improve this answer
    
Thank you for this answer, I am sure it will work, but actually this is also what Teamviewer is doing (it is another Remote Desktop Software)... What I was looking for is a solution to tunnel only the needed connection, not the whole graphical interface. For instance, if I am implementing/debugging a software in [V] it is faster that I use the dev environment locally instead of remotely, and tunnel only the connections of this software when I launch it. –  mountrix Aug 24 '12 at 11:35
    
@mountrix you should update your question with that goal in mind. Also doable, but a little more difficult. –  HopelessN00b Aug 24 '12 at 11:44
    
Done, thank you! –  mountrix Aug 24 '12 at 14:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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