46
23
I am having trouble connecting my CentOS 7 guest to the internet. My VirtualBox Network configuration is as follows:
Adapter 1: NAT; Adapter 2: Host-Only (vboxnet0)
vboxnet0
is connected set up with DHCP with default VirtualBox parameters.
In my CentOS Guest, I commanded ip a
and got the following:
enp0s3: 10.0.2.15/24 (NAT adapter)
enp0s8: 192.168.56.102/24 (Host-Only adapter)
I can connect to my VirtualBox from my host machine:
ping 192.168.56.102
can transmit and receive packets.
However, my VirtualBox cannot access the internet:
ping www.google.com
outputs "unknown host www.google.com"
Here is my ifcfg-enp0s3
:
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
IPV4_FAILURE_FATAL=no
IPV6_INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=UUID HERE (sorry I cannot copy from my guest host yet, no Guest Additions and it was too long)
DEVICE=enp0s3
ONBOOT=yes
Why can't my guest connect to the internet?
3also reboot after these steps – arahant – 2017-09-27T21:21:15.773
5Thanks, this awnser solved my problems. ONBOOT=yes did it for me, I didn't need the lines DNS1 and DNS2. – Seanie O'Leary – 2018-03-24T10:58:18.167
Thanks @Tim Pizey You save my day. :) – user3337635 – 2019-03-15T19:09:26.363
yes, as @SeanieO'Leary said. Only
ONBOOK=yes
was also needed for me. – saw-monster – 2019-05-03T20:25:06.230