The Computer Oracle

Installed minimal CentOS 6.4 in VirtualBox but have no internet?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping

--

Chapters
00:00 Installed Minimal Centos 6.4 In Virtualbox But Have No Internet?
00:26 Answer 1 Score 5
00:50 Accepted Answer Score 51
02:03 Answer 3 Score 3
02:22 Answer 4 Score 4
02:39 Thank you

--

Full question
https://superuser.com/questions/611179/i...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#virtualbox #centos6

#avk47



ACCEPTED ANSWER

Score 51


Looks like your eth0 is not set up. Here is what I did to fix mine on CentOS 6.4.

sudo su -
cat /etc/sysconfig/network |grep -i network

This should return: NETWORKING=yes - If it does not, then change it to yes.

vi /etc/sysconfig/network-scripts/ifcfg-eth0

This should look like:

DEVICE="eth0"
HWADDR="08:00:27:07:9e:57"
NM_CONTROLLED="YES"
ONBOOT="NO"

There are a few options that we want to change here, NM_CONTROLLED needs to be NO, ONBOOT needs to be YES, and finally add this code at the bottom:

BOOTPROTO="dhcp"

This will allow you to grab an IP from your DHCP and essentially enable IPV4.

Now the whole file should look like this:

DEVICE="eth0"
HWADDR="08:00:27:07:9e:57"
NM_CONTROLLED="NO"
ONBOOT="YES"
BOOTPROTO="dhcp"

Save and close. Now, lets restart the network service to reload with these settings:

[root@Development ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
[ OK ]

Notice the ‘eth0′ – awesome! Now lets check to see if we got an IPV4 from our DHCP:

ifconfig

You should now see 'eth0'.




ANSWER 2

Score 5


You have no networking configured. you should have enabled it during install (its not obvious, I missed it too during my first minimal-install). Try:

dhclient eth0 # gets you DHCP on en0

This will get you started. Then try:

yum install system-config-network-tui

Which will give you a curses based network config program where you can set things permanently.




ANSWER 3

Score 4


I had a similar problem, but all I needed to do was edit the network-script to yes for onboot and restart the network.

Edit the network-script

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
bla bla=bla
...
onboot=yes

Restart network

 systemctl restart network



ANSWER 4

Score 3


When you're installing CentOS, on the networking page, there is a button at the bottom left that allows you to configure the network settings. Click edit next to eth0 and find the checkbox to set the network to connect automatically.