Virtural box host-only mode problem

basic environment:
1. Host win7, has a fixed IP, for example: 10.1.18.9
2. Virtual machine centos7

requirements:
1. Virtual machines are not required to surf the Internet
2. Host and virtual machine communicate with each other

Action:
I set host-only mode,

Virtual machine ip is 192.168.56.100
Gateway: 192.168.56.1

virtualbox host-only Ethernet Adapter sets ip 192.168.56.1

question:
the host can ping the virtual machine
the virtual machine cannot ping the host

how to do it?

Apr.30,2021

check the dns, subnet mask


host-only ping hosts theoretically need GATEWAY points. To access the host.

if you access the extranet, you need to add sharing to: VirtualBox Host-Only Ethernet Adapter in the
devices that actually access the extranet in the network link.

but I didn't succeed in Ubuntu myself.

the easiest way is to have two network cards, one host-only and one NAT. The simplest.

Menu