4

I have just installed CentOS 6.5 on my virtualbox. I wanted to install the GUI, using this command :

yum groupinstall -y 'X Window System'

but it gave me the following error message : "couldn't retrieve mirror list, could not resolve host mirrorlist.centos.org".

I tried ifconfing to check if the machine has obtained an IP but the output should the loopback address only.

Is this a problem with the Centos or my virtualbox settings? Can anyone help me to fix it?

EDIT: I used the minimal image to create the virtual machine

3 Answers 3

8

If you just see Loopback interface with ifconfig command

Then issue

ifconfig -a

This will list all of your adapters on VM OS.

Lets assume that you have eth0 as your primary adapter, then simply write following command:

ifup eth0

After interface goes up, you'll be able to see it listed in ifconfig output and you should be able to ping outside world.

1
  • ifup eth0 worked for me.! Thanks :)
    – Deep Mehta
    Commented Sep 9, 2015 at 7:51
2
  1. Shutdown the CentOS VM.
  2. In virtualbox menu select the CentOS and click on setting.
  3. Select Network -> Enable one n/w adapter.
  4. Choose NAT and press OK.
  5. Now start the CentOS VM.
  6. Check inside the VM, if you are able to connect to internet.
  7. If in your host OS is connected to internet, then definitely able to get a NAT IP and your yum will work
5
  • I did that, still it seems that the CentOS is not connected, I don't have GUI so I checked it by trying ping it didn't work. Any other suggestion?
    – Alaa
    Commented Feb 26, 2014 at 9:30
  • Are you able to connect to internet from your host OS ?
    – kumarprd
    Commented Feb 26, 2014 at 9:32
  • yes I am, I'm currently using the host OS
    – Alaa
    Commented Feb 26, 2014 at 9:33
  • I think your network service is stopped in the CentOS VM. Run these 2 commands in CentOS as root user. service network start and then chkconfig network on
    – kumarprd
    Commented Feb 27, 2014 at 2:27
  • I did that but it didn't work
    – Alaa
    Commented Feb 27, 2014 at 8:13
2

I had a similar problem (no yum and couldn't even ping the mirrorlist) and I had to go through the following steps to at least get to ping the mirrorlist:

  1. Set the network for one adapter to 'Attached to:' NAT as kumarprd said
  2. Change the file /etc/sysconfig/network-scripts/ifcfg-eth0 (for example using vi):

    BOOTPROTO=dhcp
    ONBOOT=yes
    NM_CONTROLLED=no
    
  3. Restart the network with: service network restart

  4. If you still have problems: Check if your machine isn't behind some and try to set the necessary settings in File->Preferences->Proxy. Alternatively, bypass the proxy if you can do so.

Reason for step 4: After doing steps 1 to 3 I could ping servers. However, I was still having problems using yum (I can ping mirrorlist.centos.org, but yum still gives that error). This was due to my local machine being on a network that used a proxy with authentication using my windows logon. I fixed this by going off the local network onto the guest wifi which doesn't happen to go over that proxy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .