Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ubuntu 12.10 on which i installed virtual box on which I setup centos 6.4 i386. On Ubuntu I have: 3.5.0-17-generic kernal running.

On virtual box I install centos 6.4 and everything works fine, however when i boot into VM machine, there is only on loopback interface. Nothing else. I tried to manually add ifcfg-eth0 file but nothing happens. On VM settings i have added NAT and HostOnly interfaces but whenever I boot into centos there is just lo interface. What should I do?

share|improve this question

You need to enable networking during installation. You can do it post install as well. This is a change in the CentOS installation in the 6.x versions which throws a lot of people off, including myself.

Starting with CentOS 6.x you can either opt to have NetworkManager manage your network setups or still do it the old fashion way and set them up manually using /etc/sysconfig/network-scripts/ifcfg-eth0 types of files. Given this is a VM I'd recommend using NetworkManager.

To invoke the connection editor tool do the following:

$ nm-connection-editor

You'll be presented with a GUI like this:

                         ss of conn. editor

From this GUI you'll need to edit the eth0 setup like so:

                         ss of nm #1

                         ss of nm #2

                         ss of nm #3

Without a GUI

If you're attempting to do this on a headless server you can edit the following files and reboot to get your eth0 networking device to come up enabled and acquire an IP address from a DHCP server. Change these 2 options in the file, /etc/sysconfig/network-scripts/ifcfg-eth0:



share|improve this answer
Centos 6.4 "nm-connection-editor not found" ... no GUI running. Headless server. no joy. :( – Mojo Jul 22 '13 at 19:10

When you make a new virtual machine (i.e. a guest OS) with VirtualBox it will, by default, make the NIC an Am79C973. Whilst this NIC may be supported by many OSes, this particular NIC does not seem to be supported by CentOS 7. This means that the only NIC which will show up inside your new CentOS 7 VM will be the loopback NIC. What you need to do is change the NIC to one which is supported like the 82543GC.

First, stop the CentOS VM if you haven't already, and then change the NIC using this command on your VirtualBox host:

vboxmanage modifyvm "testvm" --nictype1 82543GC

Now, start your CentOS VM again and you will notice that it has now has an NIC.

I hope that this helps.

share|improve this answer
+1 this is the real answer to the OP question – aliopi Jan 20 at 8:41

have a look at the NIC-configurationfiles /etc/sysconfig/networking/devices/ifcfg-ethX and check if the parameter ONBOOT exists. If not – add it.

grep "ONBOOT=yes" /etc/sysconfig/networking/devices/*

Reboot or /etc/init.d/network restart after the change should bring your interface up.

share|improve this answer

Run the command:

$ ip a

This will show the the interfaces. Got to /etc/sysconfig/network-scripts open the corresponding ifcfg file and set on boot to yes. Restart the system and you are down.

By default this is set to no in Centos 7

share|improve this answer
Does it matter if you're running in a VM? Because I've done all of this a bunch of times, and it STILL says the network is unreachable, and I can't install the VirtualBox guest additions without the network, because CentOS doesn't include bzip2 for some retarded reason. – MarcusJ Dec 15 '15 at 15:18

I think it's probably the network-setting that throws it. I've found mine work best with "Bridged Adapter", as you then use the host's network card directly. It'll also allow the virtual-computer to use DHCP to get it's own internal-IP from your router.

NAT is a bit strange, as you use only one IP-address (the same as the host's?) and instead relay on translation of ports - thus it's not really a separate IP for the virtual-computer. HostOnly I think only allows the virtual-computer to make "local network" with your host - ie. no external Internet. And that pretty much leaves you with just the loop-back device.

share|improve this answer

I ran into the same problem; I solved it configuring the network in the virtualBox configuration → network setting page: I selected "Bridged Networking".


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.