Virtual box host-only adapter configuration

Posted by Xoundboy on Server Fault See other posts from Server Fault or by Xoundboy
Published on 2011-09-05T09:34:39Z Indexed on 2012/04/06 11:33 UTC
Read the original article Hit count: 231

Filed under:
|

I have VirtualBox 4 running on Win 7 with a Centos 6 guest VM set up for hosting my dev server. When I'm connected to my home network the guest can be accessed via a static IP address that I configured (192.168.56.2), but not when I'm in the office. I'm guessing that the DHCP server in the office doesn't have a gateway configured for the 192.168.56.x IP range. I read something about the VB host-only adapter that should allow me to set this guest VM up in such a way that I don't need to be on any network to be able to access the guest from the host using a static IP. I've not been able to find out exactly how to configure this though. Can anyone give me an example configuration, thanks.

UPDATE:

Thanks for your responses. I've now set up a single virtual network adapter in VirtualBox and set it to host-only:

C:\Users\Ben>vboxmanage list hostonlyifs
Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            d419ef62-3c46-4525-ad2d-be506c90459a
Dhcp:            Disabled
IPAddress:       192.168.56.2
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:78e3:b200:5af3:2a57
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 08:00:27:00:94:e8
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter

On the guest I've set up eth0 to use the same IP address as the host-only adapter (192.168.56.2) but when I try to log in using Putty I still get "Network Error : connection refused". VirtualBox DHCP servier is enabled but I can't ping the gateway (192.168.56.1) from either host nor guest. There's no firewall running on either OS. What next?

© Server Fault or respective owner

Related posts about networking

Related posts about virtualbox