A VPN connection allows you to access your machine as if your are on-site. When you want to access your remote machine from inside a Virtual Machine (VM) that is running on your computer, you can do so in one of two ways:
If neither of these options work, you my need to restart the VM or your computer entirely.
Establish the VPN connection from inside the VM
If you establish the VPN connection from inside your VM, then the steps are no different than if you'd be using any other regular computer. Of course, you do need to share your computer's internet connection with your VM.
- Open your VM's network settings and share your computer's internet connection with your VM.
- Establish a VPN connection to your remote machine from inside the VM.
Once you have a VPN connection, you can connect to your remote machine:
Share the computer's VPN connection with the VM
If you establish the VPN connection from the computer itself, then the steps are slightly different.
NAT method
Only IP-based traffic
Using this method only allows IP-based traffic to work. Actions such as search, scan, etc will not work. In such cases it is advised to set up the VPN connection from inside the VM instead.- Establish a VPN connection to your remote machine from the computer.
Once you have a VPN connection, you can share your computer's (VPN) connection with your VM and then connect to your remote machine:
- Open your VM's network settings and set it to "NAT".
- Connect to your machine.
Bridged method
- Establish a VPN connection to your remote machine from the computer.
Once you have a VPN connection, you can bridge your computer's (VPN) connection with your VM and then connect to your remote machine:
- Open your VM's network settings and set it to "Bridged".
- In the VM, manually add the necessary route.
- On a Windows VM, open Command Prompt and execute the following command.
route add MACHINENETWORK SUBNETMASK STRIDEROUTERVPNADDRESS
For example:
route add 192.168.140.0 255.255.255.0 10.187.145.23
- On a Windows VM, open Command Prompt and execute the following command.
- Connect to your machine.