This article will help you to solve the issue  virtual Linux image not Pinging from host windows

Not able to ping virtual box guest from host OS

Here is the solution of the problem

There could be many reason if you are not able to ping, we will explain the reason and we will debug one by one:

  • We are assuming that your guest OS  have static IP

1) Host Only Adapter not set

Click on the Machine which you are not able to access, Machine should be shutdown state.


go to network


make sure that
Attached to: Host-Only Adapter
You will require this adapter in host only mode to access this virtual machine (guest) from your base machine (host)

 

2) your virtual adapter IP is not matching with Machine IP

go to windows start
type cmd
it will open command prompt
type ipconfig
You will see the Virtualbox host-only adapter with the IP assigned make sure that IP is in range of the machine IP
in case of following example your guest machine IP should be 192.168.56.xxx

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
 Link-local IPv6 Address . . . . . : fe80::db4:19ba:9ef0:xxxxx
 IPv4 Address. . . . . . . . . . . : 192.168.56.1
 Subnet Mask . . . . . . . . . . . : 255.255.255.0
 Default Gateway . . . . . . . . . :

if IP address of virtualbox network adapter is not in range of machine
then Open Virtual Box
go to File –> Preference..

 

go to Network
go to Host Only Networks

click on edit (screwdriver icon)

Update the IP and subnet in the range of machine (do remember that if other machine already running they will not accessible if they are using previous subnet)

 

3) mac address issue

start your machine in case of linux
go to network setting direcoty
cd /etc/sysconfig/network-script
cat ifcfg-eth0

you will see HWADDR

note that mac address
go to
/etc/udev/net.
comment all the lines other then eth0

now go to virtual box network setting.
Click on Advance setting of network setting

Check if the mac address is same which was there in linux machine.
if its not matching then you need to update mac address in virtual box. You will be able to edit the mac address only if machine is not running.

Once mac address is updated you can start the machine it should work