Ping Issue to Guest IP.

Discussions related to using VirtualBox on Windows hosts.
Post Reply
azib
Posts: 4
Joined: 2. May 2017, 18:12

Ping Issue to Guest IP.

Post by azib »

Hey Community'
Virtual box is installed on Windows 10. I have installed Linux (Centos) virtual machine. The problem is that I am unable to ping guest IP address from Host machine, however I am able to ping Host machine from guest machine. Please guide me accordingly.

Regards'
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Ping Issue to Guest IP.

Post by socratis »

What's the network mode selected? What are the outputs of the commands:
1) In the host: "ipconfig"
2) In the guest: "ifconfig".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
azib
Posts: 4
Joined: 2. May 2017, 18:12

Re: Ping Issue to Guest IP.

Post by azib »

Hey'
Network mode is selected is NatNetwork. Screenshots are attached.

Regards'
Attachments
ifconfig.png
ifconfig.png (55.62 KiB) Viewed 18054 times
NetWork Mode.png
NetWork Mode.png (118.29 KiB) Viewed 18054 times
ipconfig.PNG
ipconfig.PNG (35.64 KiB) Viewed 18054 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Ping Issue to Guest IP.

Post by socratis »

azib wrote:I am unable to ping guest IP address from Host machine, however I am able to ping Host machine from guest machine.
azib wrote:Network mode is selected is NatNetwork.
That is the expected behavior. You cannot ping something behind a NAT network.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
azib
Posts: 4
Joined: 2. May 2017, 18:12

Re: Ping Issue to Guest IP.

Post by azib »

Hey'
What I would have to do If I want to ping. Is there any configuration changes needed?

Regards'
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Ping Issue to Guest IP.

Post by socratis »

Why don't you start by telling us what you want to do at the end. Ping each other? I highly doubt it. Describe your end goal. Since I have a feeling that you want to do more than that, here's a chart of your available network options. You can see why the "NATNetwork" option failed to communicate between the VM and the host:

[pre]+-----------+-------------+-------------+----------------+----------------+
| | VM <-> Host | VM1 <-> VM2 | VM -> Internet | VM <- Internet |
+-----------+-------------+-------------+----------------+----------------+
| HostOnly | Yes | Yes | No | No |
| Internal | No | Yes | No | No |
| Bridged | Yes | Yes | Yes | Yes |
| NAT | No | No | Yes | Port forward |
| NATNet | No | Yes | Yes | Port forward |
+-----------+-------------+-------------+----------------+----------------+[/pre]

Bridged will allow your guest to appear as just another PC on your host's network. The host, all the other network PCs, the internet and the guest can all communicate. The guest would default to getting an IP address from your host network's router. The host needs to be connected to an active network to allow guests to use Bridged. And Bridged is not always compatible with Wi-Fi.

Internal makes a private network just for your guests. There is no host communication or internet. There is no DCHP server on an internal network by default, though you can put one on in Virtualbox. Otherwise configure static IP address for the guests within the guest OS's. Or you can make a router guest using a router OS like pfSense. You can make more than one internal network by naming the new networks differently.

Host-Only is a special form of internal network that also includes the host, via a virtual Host-Only network adapter made on your host, defaulting to IP address 192.168.56.1, and there is a default DHCP server handing out IP addresses to the guests starting at 192.168.56.101. You can change the IP address range or make multiple host-only networks in Virtualbox's Network settings in the main GUI. There is no internet in Host-Only.

Virtualbox has two kinds of NAT: regular NAT and a NAT network service. Regular NAT ("NAT" in the dropdown) connects each guest to the host's network connection and internet via an independent channel. The host and any other guests cannot connect to the NAT-connected guest, although ports can be opened, just like NAT in a router. (The NAT guest can, however, see any services and shared folders on the host's network.)

The NAT network service ("NAT network" in the dropdown) is like a home router, NAT to the outside world and multiple "LAN" guest connections. All the guests connected to this "NAT network" can see and communicate with each other. Internet is accessible. Ports can be opened just like a real router. You need to make a new NAT network in the main Virtualbox window, File Menu, Preferences, Network. Then attach the guests using the name of the NAT network you made in Preferences.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
azib
Posts: 4
Joined: 2. May 2017, 18:12

Re: Ping Issue to Guest IP.

Post by azib »

Off course, I want to do more than just ping. Actually, It's my home setup & I want to access my VM's Guest machine from outside. There are many services are running on Guest operating system like (SSH, Cacti, Apache, etc), I am also like to access these services as well. This my end goal.

Regards'
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Ping Issue to Guest IP.

Post by socratis »

Good. That's why I included in my previous message all your available options, so you can pick whichever is the best for your setup (you read it, right?). If you don't want to mess with port forwarding rules, I'd go with Bridged.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply