[Solved] host only interface, guest and host can't connect

Discussions related to using VirtualBox on Linux hosts.
Post Reply
johnnyxia
Posts: 5
Joined: 11. Jan 2009, 15:16

[Solved] host only interface, guest and host can't connect

Post by johnnyxia »

I am using VBox 3.0.2 r49928 on CentOS5. The guest OS is ubuntu 9.04 server edition.

I use the Host-only interface for the VM. After the guest OS is running, the guest OS gets an IP of 192.168.122.1, while the host OS gets an IP of 192.168.56.1. But I can't ping guest OS from host OS or ping host OS from guest OS.

I opened the File->Preferences->Network and enabled the DHCP server, and the DHCP server uses the ip of range from 192.168.56.101 to 192.168.56.254.

Any idea about this issue?

I am wondering why by default GuestOS and Host OS uses IP of different subnet.

Regards,
Johnny
johnnyxia
Posts: 5
Joined: 11. Jan 2009, 15:16

Re: Using host only interface, but guest and host can't connect

Post by johnnyxia »

One more thing: I tried to set the host IP to 192.168.122.100 and also changed the DHCP server's ip address to 192.168.122.200. But the issue is still there. I tried to ping DHCP server's IP from host OS, also gets the error "Destination Host Unreachable"

It seems that the vboxnet0 NIC doesn't forward the packets to guest OS's NIC. Is there anything I missed here?
johnnyxia
Posts: 5
Joined: 11. Jan 2009, 15:16

Re: Using host only interface, but guest and host can't connect

Post by johnnyxia »

This issue is resolved. The root cause is that when the Guest Linux is running, the eth1 interface is disabled. After I enabled the interface manually, the interface gets an IP from VirtualBox DHCP server and I can communicate between the Guest Linux and Host Linux. However, I don't know why the interface is disabled by default. And it is tricky its interface is eth1 not eth0. Anyway, it is resolved. Hope this info is helpful.

Regards,
Johnny
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: [Solved] host only interface, guest and host can't connect

Post by baf »

Remove /etc/udev/rules/70-persistent-net.rules and reboot the guest
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
Post Reply