How-to-simply...

Setup Windows host to CentOS guest network in VirtualBox

  • 1 On the Windows host:
    VirtualBox Manager CentOSName->Settings->Network Adapter2 Tab:
    Select Host-only Adapter
    Name: VirtualBox Host-Only Ethernet Adapter
    Generate MAC
    Cable connected
  • 2 On the CentOS guest:
    cd /etc/sysconfig/network-scripts
    sudo vi ifcfg-eth1
    DEVICE="eth1"
    BOOTPROTO=static
    HWADDR=08:00:07:AB:CD:EF # Must match vbox generated MAC
    IPADDR=192.168.56.10 # same network as host
    NETMASK=255.255.255.0
    ONBOOT=yes
    sudo service network restart
  • 3 Test:
    ping centos guest from windows command line:
    ping 192.168.56.10
  • N VirtualBox Host-Only Ethernet Adapter is missing:
    VirtualBox Manager->File->Preferences->Network Host-only Networks Tab:
    Add one or customize host ip address. This ip address must match with VirtualBox Host-Only Network Adapter (IPv4 Settings).

References