The way VirtualBox configures networking in guests is by not only emulating the networking hardware associated with the VM, but it also creates a layer in between Host
and Guest
where it emulates a router.
The "Router" that VirtualBox emulates has settings which can be configured using the Virtual Machine Manager
and when set to use its own DHCP server, the emulated router pushes settings to the client, as if the client was situated on a physical network using DHCP.
When toggling the Guest
On/Off switch, it only applies to the Guest
as it would if you were to setup CentOS on a physical machine, enabling and disabling the interface.
I am using
NAT
mode. But why theGuest
can't connect to internet? Executingcurl google.com
, and the output is "curl(7): Failed tp connect to ...: Network is unreachable
". – Nan Xiao – 2015-05-26T08:00:49.733I'm guessing that you didn't tell CentOS to autostart networking. in which case, run
sudo systemctl status network
to check the status of networking, and if the service is in the stopped state, runsudo systemctl start network
to start it. – td512 – 2015-05-26T08:07:11.670Doesn't seem this cause. The status is
Active: active(exited) since .....
. Is this state right? – Nan Xiao – 2015-05-26T08:11:47.260what's the output of
ifconfig
? – td512 – 2015-05-26T08:13:42.597Because I can't copy easy from VM, so I catch screen shot for the
– Nan Xiao – 2015-05-26T08:19:00.993ip addr
. Sorry for the inconveience.What is the output of:
sudo systemctl -l status network
? – td512 – 2015-05-26T08:25:09.757systemctl -l status network
output: screen shot. – Nan Xiao – 2015-05-26T08:29:25.453It looks like CentOS can't load/didn't finish loading networking in, and is having trouble with that – td512 – 2015-05-26T08:30:56.003
Why does this occur? Do I need re-install the OS? – Nan Xiao – 2015-05-26T08:32:45.687
I'm not sure. best thing to do would be to reload CentOS – td512 – 2015-05-26T08:33:47.090
OK, thanks very much for your time and effort! – Nan Xiao – 2015-05-26T08:55:30.600
The root cause is found in this discussion.
– Nan Xiao – 2015-05-27T08:47:16.113