Can’t ping between two virtual machines using VirtualBox host-only adapter in OS X

3

1

I am trying to run Kali Linux in one VirtualBox, and a De-ICE machine in another VirtualBox on a Mac (OS X 10, if it matters). I want to use the host-only adapter to connect the machines so the Kali machine can attack the De-ICE machine.

For those who don’t know De-ICE is an emulated Linux server meant to be penetrated for educational purposes, which means I can’t log into it. Netdiscover on Kali will show the IP address of De-ICE (192.168.1.20), but using nmap and ping on this IP will not work. nmap gives me the following message; pings are just lost:

failed to determine route to 192.168.1.20

In the general VirtualBox settings I created the host-only adapter (vboxnet0), and have messed around with the settings without success. One thing I noticed is the DHCP sever said the lower bound was 192.168.56.100 which is above 192.168.1.20 so I lowered it, but that didn't help.

In the settings of Kali and De-ICE I set them both to use the Host-only adapter vboxnet0.

A few weeks ago switching to the bridged adapter worked, but now that won’t work either, even though I haven't touched Virtualbox in the meantime. I did change the actual router my computer is on since then, so maybe that is the problem. Realistically though, I want to get the host-only adapter working rather than use a work around.

The weird part is I was at a friends house who has a PC, so I tried it on this completely different computer on a completely different network, and it still did not work.

Additional info:

I believe the De-ICE machine is set to always use 192.168.1.20, and can't be changed as far as I know. Netdiscover will show two versions of the machine. One at 192.168.1.20 and one at 192.168.56.100, but nmap and ping do not work on either. Maybe the problem is the DHCP server being run by Virtualbox is assigning one IP address, but De-ICE is defaulting to another? If so, how can I change what Virtualbox assigns to De-ICE, since De-ICE can't be changed?

Here is what I am seeing in Kali: kali screenshot

So I changed to these settings, and it seems to be working now.
Virtualbox settings 1

I'm having a real Charlie Brown moment here because I swear this is exactly what I did before I came here and it didn't work, but it seems ok now.

In my exasperation I rudely forgot to thank you for your help, so I'll say it now. Thank you!

Billybumbler

Posted 2014-11-24T03:54:57.077

Reputation: 31

Answers

1

You say you have a host-only adapter setup, but what settings do you have in VirtrualBox for vboxnet0? To my knowledge, there are two places where the network settings need to be adjusted.

I’m using a Mac as well, but the general concept should be the same for anyone else using VirtualBox on Windows or Linux. If I go to “Preferences” when I launch VirtualBox and then click the “Network” icon and then click the “Host-only Networks” tab, I get a list of adapters I have setup:

enter image description here

Then—as shown in the screenshot—if I select vboxnet0 and then click the screwdriver icon, I can change options. Screenshot below:

enter image description here

I have the “IPv4 Address” set to 192.168.56.1 and the related IPv4 Network Mask set to 255.255.255.0. Now I usually have the DHCP server disabled as shown in the following screenshot:

enter image description here

But in your case it seems like De-ICE needs DHCP to get a connection, correct? If that’s the case, then perhaps the issue is you seem to have your vboxnet0 network set to the 192.168.1.x subnet? To my knowledge, the VirtualBox host-only setup always uses the 192.168.56.x setup. So I am not clear why De-ICE would get an address in the 192.168.1.x range unless the settings under Preferences -> Network -> Host-only Networks were adjusted. Would recommend checking that and ensuring the subnet is 192.168.56.x.

Also, you say this:

One thing I noticed is the DHCP sever said the lower bound was something about 192.168.1.20 so I lowered it, but that didn't help.

All that means is that the DHCP server would begin assigning IP addresses from 192.168.1.20 to the upper bound setting. Which is why De-ICE got assigned an address of 192.168.1.20; that was the first device to connect to the DHCP server on the VirtualBox host-only adapter. That is fairly meaningless and should not be lowered. Leave that as is. But like I said, I believe the range should be in the 192.168.56.x scope; not 192.168.1.x.

JakeGould

Posted 2014-11-24T03:54:57.077

Reputation: 38 217

ockquote>

If I go to “Preferences” when I launch VirtualBox and then click the “Network” icon and then click the “Host-only Networks” tab, I get a list of adapters I have setup:

I just checked, and the adapter settings are exactly the same as yours. The DHCP settings are: Enabled Server Address: 192.168.56.254 Server Mask: 255.255.255.0 Lower bound: 192.168.56.100 Upper bound: 192.56.200

Do you mean to say I should literally put an 'x' in there or did you just mean any number there is fine?

I believe the De-ICE machine is set to always have an IP of 192.168.1.20. – Billybumbler – 2014-11-24T05:34:38.650

@Billybumbler You should have a list of adapters. But if you select one and then click the screwdriver icon you can check the settings. The main thing being that the 192.168.1.x subnet is not what VirtualBox uses for host-only connections. It should be 192.168.56.x. I actually just launched two Ubuntu servers I have under VirtualBox on my setup here to test pinging and via the 192.168.56.x they work great. – JakeGould – 2014-11-24T05:39:42.087

“Do you mean to say I should literally put an 'x' in there or did you just mean any number there is fine?” Oh no, that is just shorthand notation for filling out a subnet example when documenting things. Not for usage. – JakeGould – 2014-11-24T05:55:58.987

@Billybumbler “I believe the De-ICE machine is set to always have an IP of 192.168.1.20.” Hmmm… If that is the case maybe what you should do is create a second adapter named vboxnet1 and set that to be 192.168.1.1 with a DHCP server setup that is similar to vboxnet0 but just change the addresses from 192.168.56.x (or whatever it is, might be 192.168.57.x) to 192.168.1.x with the x referring to whatever the value you are changing is. – JakeGould – 2014-11-24T05:56:46.777

0

You need to make sure sure you set Promiscuous Mode in your VBox network/adapter settings to 'Allow VMs' at the very least.

Failing that, have you tried installing a fresh build?

xbullet

Posted 2014-11-24T03:54:57.077

Reputation: 21

I've tried it on four different computers with the only commonality being I downloaded Virtualbox, De-ICE, and Kali from the same places each time. Three Macs and one PC on two different networks. The odds of all these failing makes me think the Promiscuous mode setting is exactly the sort simplistic solution I am missing. I will give it a try as soon as I get a chance. – Billybumbler – 2014-11-26T02:41:53.510

Ah, hopefully Promiscuous mode will resolve it for you then. Let me know how it goes! – xbullet – 2014-11-26T06:34:38.023