How to set Virtualbox centos 7 client to share host vpn - virtualbox

I need to access vpn of host from my virtualbox vm centos.
But search and tried several method failed.
Environment:
Host: Win10
VPN: shadowsocks-windows
Virtual box 5.2
Client: Centos 7

Search from google, many set virtualbox to use Bridge mode.
Here I use NAT mode and passed.
Enable shadowsocks to allow local network connection
Set Virtualbox to use NAT network Adapter
Get virtualbox network adapter ip by run cmd in centos consle: $ ip route show
Set Centos network proxy to use virtualbox network adapter ip and shadowsocks server port, by default is 1080
Then enjoy!

The following looks a good answer to the question:
virtualbox guest os through vpn
https://superuser.com/questions/987150/virtualbox-guest-os-through-vpn

Related

pfsense: Can't access web console when using virtualbox

I've installed pfsense 2.3 x64 in virtualbox with 2 adapters; One is bridged to my wifi adapter (adsl modem) (WAN) and the other one set as'Internal network' ('intnet') (Lan);
The problem is that although pfsense can automatically detect dhcp over first adapter and get an IP but my system (the host) can not ping the pfsense server (pfsense can ping both adsl modem gateway and the host).
Note1: Disabling the antivirus and firewall (kaspersky internet security 2016) has no effect.
Note2: I know that this setup works because I use the exact same network configurations for a Kerio Control server (v9.0.2, installed in virtualbox)
Note3: If I constantly ping pfsense server in my host (ping 192.168.1.102 -t) and at the same time restart pfsense server, during the booting phase of pfsense I can get two pings!
After contacting the pfsense official forum, it turned out that the WAN interface blocks everything by default. Therefore, either a rule should be defined to allow WAN to accept traffic or access server from LAN side.
I figured this out without having to go through the WAN interface, answer is on the pfsense forum
Configure host-only network "vboxnet1" (or any of the other host-only networks if you're already using vboxnet1 for other VMs) with the following:
192.168.1.77 (or whatever IP you want your host to appear as on the network)
255.255.255.0
DHCP Disabled
The make sure that the LAN adapter on your pfSense VM is a "Host-only Adapter" and that it's using "vboxnet1" (or whatever network you configured above)
Reboot/re-install and http://192.168.1.1 should work now

HDP Sandbox 2.3 on Virtualbox - Guest unable to access host network

I have a HDP 2.3 Sandbox (CentOS) on VirtualBox with Windows host.
I want the sandbox guest machine to access the host network i.e. to access the machines in the company's network that host can access.
I have both the NAT and the host only adapter configured for the VM.
VirtualBox Network Configuration
Host ipconfig shows this
VM Network Settings
After these, i started the sandbox VM, but still i am not able to ping a machine on the host network from the VM.

VMware have network access but can't ping anywhere

I am using VMware 9.0.0 on a Windows 7(64bits) host, the guest OS is CentOS 6.5(I have tried Ubuntu 12.04 also).
Firewall on Windows 7 is completely disabled. My host is connected to a router via wireless network adapter.
Guest's network configuration is NAT, and guest IP address is 192.168.117.130. Default gateway of the guest is 192.168.117.2. The Nat Interface(VMware Network Adapter VMnet8) on Windows 7 have an IP address of 192.168.117.1.
The problem I met is that I can have Internet access, actually, every network service using TCP and UDP is ok. But I can't ping any host other than hosts on the network of 192.168.17.0/24.
I used wireshark to locate the problem. I found a strange phenomenon, my host can receive the ping echo request from the guest and ping echo response, but it is not forwarding to the guest. Seems the NAT of ICMP packet is not working.
Any suggestions?

Can't manage to connect my virtual machine to the internet

I have a windows server 2003 as the guest in VMware player and windows 7 enterprise as the host. I'm trying to connect to the inernet from my guest and i can't. In my VMware player virtual machine settings my network addapter is set to NAT but i can't get it to work.My host is in the work LAn and connected to the internet through it. Could this have something to do with it not working properly? Do I have to perform some special setup?
The problem may be caused by:
You're NATting to the wrong host's network interface in the VM's option.
Your VM's NIC DNS configuration is wrong. To verify this issue, try to PING the host's NIC from the VM.

how to ping guest xp from host ubuntu in virtualbox?

I have a ubuntu in my lap top and install virtualbox. I install an xp as guest in vbox.
I want to have access to guest from host for penetration usage.
#1st try: the guest uses bridge network with ip 192.168.1.103 (assigned static).
I can not access guest form host, when I ping the guest, loosing all packages.
ping 192.168.1.103
But I can access host form guest, when I ping the host.
ping 192.168.1.101
#2nd try: the guest uses an NAT and a Host-Only network.
same as above host can not access the guest:
ping 192.168.56.103
but guest can access the host:
ping 192.168.56.1
who can I access the guest from host?
As you can ping host from the guest, it tells that the connection is working ok both ways (response comes back ok). The problem probably is that XP has not been configured to answer to ping requests so it's silently discarding them. You need to change the settings of the firewall to allow answers to ping.
See for example http://kb.iu.edu/data/aopy.html for details how to enable ping service in different Windows versions with the default firewall.