We configure the VM with two network cards, one local to talk to the host, the other to talk to the internet. Then we force the host to use the guest as its router, erasing the old gateway.
1) Configure your VM to start with 2 network adapters, one for bridged access, the other one for Host-only connection. Configure the Host-only connection to have a DHCP server at 192.168.56.100, and to dish out IP addresses 192.168.56.1 (to the host, say) and 192.168.56.2 to the guest. On the host, I assume the interface connected to the guest is called vboxnet0, if not pls change accordingly.
Let me give you a reference on how to do this: see this AskUbuntu excellent answer
2) start your virtual machine, make sure you can connect to the Internet and can ping to/from Host, then connect via the VPN.
3) On the host, change your default gateway to be the guest 192.168.56.2:
route delete default
route add default 192.168.56.2 dev vboxnet0
5) Now let us go back to the guest: you find here instructions as to how share your VPN connection with other connections, for Windows.
6) On the host, check that you have connectivity, for instance by means of
ping -c1 8.8.8.8
If this works, and you can connect to the Internet, you are done. If this works, but you cannot connect to the internet, it means your DNS configuration is broken, it is very easy to correct it, see for instance here.
If however the ping above cannot connect to Google, it means there is a problem on the guest. Possible causes include a restrictive firewall, or some typing error. To diagnose, check your routing tables, on guest and host, or disable the firewall completely.
And thank you for providing an amusing project.
Here are two articles on establishing VPN in Windows 8.
Please comment on how they compare to what you have done to create that VPN.
Windows 8 - How to configure PPTP with Windows built-in client on Windows 8
Windows 8 VPN Get Connected
The IP address of type 169.254.x.x means that Windows wasn't able to contact a DHCP server and allocated its own temporary address.
Set the client's IP address to a static IP of 192.168.x.x so as to place it on the same network as that established by the VPN server.
Otherwise, the one is not fully accessible to the other.
Best Answer
Run the following PowerShell commands:
The first command creates a NetworkListManager object.
The second command consists of three parts (separated by
|
s):(remove the third part to see the results of the filtering)
0
is public;1
is private.For more (technical) information, see the Network List Manager API documentation.