Tushar
Tushar

Reputation: 1186

How to configure internet on CentOS installation on VirtualBox

I am a beginner to linux. I have done the fresh installation of CentOS 7 on my Windows VirtualBox.

Over the tutorials for CentOs 6 they have mentioned to edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for the configurations.

But in my installation there is no such file. I have ifcfg-enp0s3 and ifcfg-lo files available.

Upvotes: 3

Views: 8419

Answers (4)

Angil Dismas
Angil Dismas

Reputation: 11

It worked for me like this on windows 10 -Change Adapter 1 Name to "Remote NDIS based Internet Sharing Device"

Upvotes: 1

Lamudu Mohotti
Lamudu Mohotti

Reputation: 27

  • Type nmtui in the terminal
  • Go to 'edit connection' and hit enter
  • Select 'enp0s3' and hit enter
  • Go down to 'Automatically connect' using down arrow key
  • Press space bar
  • Go down and press hit enter on 'Ok'
  • Go back and quit

Upvotes: 2

Seaward
Seaward

Reputation: 21

Same here! I installed CentOS 7 in Windows7 Virtulabox, there is no eth0, but enp0s3.

  • After first reboot, used command ip addr, enp0s3 had no ip address bundled;
  • Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3, changed ONBOOT=no to ONBOOT=yes, enp0s3 had ip 10.x.x.x, still useless;

Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3 according to the accepted answer of centos minimal installation static ip address, it works! As my IP address of Ethernet adapter VirtualBox Host-Only Network is 192.168.56.1, I set 192.168.56.35 to enp0s3, and my vbox NIC mode is Host-Only.

Upvotes: 2

pzed
pzed

Reputation: 837

From the CentOS tutorial, the eth0 portion of /etc/sysconfig/network-scripts/ifcfg-eth0 refers to the network interface. eth0 is the most common name for a standard ethernet interface in Linux. From your question, your system has two interfaces: enp0s3 and lo. lo is the loopback interface, so ignore that one. That leaves enp0s3.

Go ahead and follow the instructions with /etc/sysconfig/network-scripts/ifcfg-enp0s3. It should work, assuming that interface doesn't have any weird quirks associated with it.

Upvotes: 3

Related Questions