16

I just now installed Cent OS 7 on my VMware 8 and I am not able to connect it to a network.

I checked the VM network and its mapped to the physical NIC. The same setting work like charm on my CentOS 5 running on VM8.

Running the ip a command shows the following output:

ip output

5
  • Forgot to mention i didnt find resolve.conf file on the system too (Read an article suggestion issues with resolve.conf so tried looking it up and it was missing )
    – Atul
    May 28, 2015 at 23:58
  • So when you get out of full screen when you click on the network cable icon on the bottom right and click preferences, what kind of connection you have there?
    – VaTo
    May 29, 2015 at 2:31
  • What kind of system r u using 32-bit or 64-bit? centos7 is basically designed to work on a 64-bit system. If 32-bit system, while installing on vmware try installing using centos as 64-bit then u wont find any network issues.
    – user117244
    May 29, 2015 at 5:19
  • I have tried briged and NAT both and had no luck. The NAT works fine on my other machine ie CentOS 5
    – Atul
    May 29, 2015 at 6:41
  • When you created the VM and it asked what kind of OS was to be installed did you select Linux or windows? If created as a "Windows" VM you'll get a different NIC type that may not work, and it's a hassle to change after the fact (you can't change it through the GUI).
    – Centimane
    Sep 22, 2016 at 13:33

9 Answers 9

25

You have to activate the interface. One way of doing that is with Network Manager's utility nmtui.

Open nmtui with:

$ sudo nmtui

And you'll get a text based interface like this:

enter image description here

Navigate by using TAB and ENTER.

In nmtui you can activate your interface, edit connection's and set hostname.

After you're done, restart network with:

$ sudo systemctl restart network
7
  • 1
    I tried configuring the wifi connection hoping it will connect to my wifi and get on the network however it did nothing. Ip a shows no interface again. Should i be selecting a different connection type?
    – Atul
    May 29, 2015 at 6:38
  • @Krt sudo nmtui and then activate connection is working for me. But whenever I power off the VM the configuration is gone. Is there a way to make it permanent.
    – Vikash
    Feb 8, 2018 at 9:33
  • 1
    Should be marked as valid answer
    – 1020rpz
    Nov 2, 2018 at 8:17
  • 2
    @Vikash check the files ifcfg-eth* in /etc/sysconfig/network-scripts/ for the line ONBOOT. That should be set to yes.
    – Edward
    Jun 19, 2019 at 14:21
  • after i restart network interface gets deactivated and i need to Activate the interface again, how to fix this? Jan 20, 2021 at 7:11
11

In my case, I installed two CentOS virtual machine by using VMware Player (Host OS: CentOS7). I found no IP address for both of virtual machines. The IP address set by following the below procedures.

Check the current connection on your VM:

# nmcli con show
NAME      UUID     TYPE      DEVICE
ens33     xxxxxx   ethernet  ---

The network is not activated yet after virtual machine installation.

Lets, activate the network connection by using this command:

# nmcli con up ens33
Connection successfully activated xxxxxxx

Check whether the newly activated network is ready:

# nmcli con show
NAME        UUID        TYPE        DEVICE
ens33       xxxxxx      ethernet    ens33

Now check your IP address on CentOS virtual machine:

# ip address show | grep inet
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
inet 192.168.xxx.xxx/xx brd 192.168.xxx.xxx scope global noprefixroute dynamic ens33
inet6 xxxxxxx

Your IP address for the CentOS virtual machine is : 192.168.xxx.xxx/xx

1
2
  1. Run the follwing command:

nmcli d

Output:

DEVICE      TYPE      STATE      CONNECTION 
virbr0      bridge    unmanaged  --         
ens33       ethernet  unmanaged  --         
lo          loopback  unmanaged  --         
virbr0-nic  tun       unmanaged  --     
  1. Run the following command for your respective device:

ip link set dev ens33 up

dhclient -v ens33

Output:

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/ens33/00:0c:29:6d:49:7e
Sending on   LPF/ens33/00:0c:29:6d:49:7e
Sending on   Socket/fallback
DHCPDISCOVER on ens33 to 255.255.255.255 port 67 interval 5 (xid=0x7ea0b970)
DHCPREQUEST on ens33 to 255.255.255.255 port 67 (xid=0x7ea0b970)
DHCPOFFER from 192.168.153.254
DHCPACK from 192.168.153.254 (xid=0x7ea0b970)
bound to 192.168.153.128 -- renewal in 724 seconds

Try executing ifconfig now

1
1

I user bridged network,you should attach your guest OS's network interface to host interface,you need edit vmware's network editor:

Edit ->  Virtual Network Editor -> bridged to host interface

picture:

enter image description here

1
0

Open my.vmx which contain your VM configurations and Added the following line to my.vmx:

ethernet0.virtualDev = "e1000"

My problem was solved by this line.

0

In the nmtui, edit the connection and then select Automatically Connect check box. Restart the network and you should be back in business :-)

0

I had a similar issue with a VM running Red Hat Enterprise Linux (RHEL) V6.4 with VMWare 10. I was able to fix it using the "Restore Defaults" button in VMWare's Virtual Network Editor. In my case, somehow the bridged network had been deleted at some time in the past.

0

For me, the problem was "onboot" parameter in the interface network script (/etc/sysconfig/network-scripts/ifcfg-enp0s3). To fix I, changed it from "no" to "yes"

0

All scenario (following @KRT)

Step 1: to check ip address statement by ip a or ifconfig enter image description here enter image description here

Step 2: to use "sudo nmtui" enter image description here Step 3: to use TAB and ENTER for your choice (for my example "ENTER" to my virtual network card) enter image description here Step 4: to check "Automatically connect" enter image description here Step 5: to restart network

sudo systemctl restart network

Step 6: to check the network statement by ip a or ipconfig enter image description here

You must log in to answer this question.

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