1
votes

I am running VirtualBox on Windows 7 and I wanted to make sure that my VM has two network interfaces. One is a NAT interface (eth0) to access the Internet, and the other is a host-only interface (eth1) to communicate with the host machine. Running command ifconfig on VM I got that the IP address of eth0 is 10.0.2.15 and IP address of eth1 is 192.168.56.101. I have changed /etc/network/interface file by adding the following lines:

auto eth1
    iface eth1 inet static
    address 192.168.56.101
    netmask 255.255.255.0

However, I cannot ping 192.168.56.101 or SSH 192.168.56.101 from my host (Windows 7) machine. I have tried DHCP instead of static (in interface file) but still no connection.

Can someone provide configuration steps so I can have these two interfaces working, i.e. to have Internet and to access VM from the host?

2

2 Answers

0
votes

vboxnet can be useful, though I'm not fully sure about it. follow this link to create vboxnet network adapter

0
votes

I have the exact same setup, and things are working. What is your Guest os. I was running Centos 5.3 I initially started with a static ip, then for some reason things stopped working. I ended up enabling the DHCP server, and set the "Lower Address Bound" to the IP address I wanted the Guest OS to have. Internet starting working again. I may have had trouble b/c I disconnected ethernet and starting using wireless on my Host, but restarted Virtualbox and things still failed. Anyway, switched to DHCP instead of a static ip, and got internet working again.