How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

Posted on

Introduction on How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

An error in the form of no IP Address is available after installing CentOS 7. In the context of this article, the version of CentOS 7 is CentOS 7.5.1804. By typing a certain command in the operating system, the output will displays the detail version as follows :

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]#

Below is the output of the command execution ‘ip addr’. The main purpose of the command is to show the information of the IP Address of certain device. The command is executed in the operating system where there the problem of no IP Address exist. The following is the output of the command :

[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:56:6c:98 brd ff:ff:ff:ff:ff:ff
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:d8:ba:49 brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.101/24 brd 192.168.56.255 scope global noprefixroute dynamic enp0s8
       valid_lft 1178sec preferred_lft 1178sec
    inet6 fe80::e8bf:3425:d4c3:572d/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@localhost ~]# 

Description of the Linux CentOS VM in Virtualbox

As shown in the above output, there is one network interface device with no IP Address. It is the network device with the ‘enp0s3’ label. Before starting to solve the problem, below is the specification of the CentOS 7 VM :

1. It is a minimal and fresh installation of CentOS Linux release 7.5.1804.

2. It have two network interfaces available.

3. The first interface is a NAT. The following is the image showing the configuration of the first network interface :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

4. The second interface is a Host-only Adapter. Since the problem is not in the second interface. The image for the configuration of the second network interface is not related in this context.

 

Performing Steps for Solving No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

Using the specification in the above explanation, after searching for the proper solution, the problem is actually quite simple. The following are steps to solve the problem :

1. First of all, access the CentOS VM Guest Machine. The access is available from the second network interface via SSH remote connection. The access is also available from within the VirtualBox Virtual Manager.

2. In the next step, using the following command, access the network configuration utility of all the interfaces in CentOS VM Guest Machine :

nmtui

The following is the image of the output of the above command execution :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

3. Select Edit a connection from the above image. The following image will appears :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

The above image consists of all the available network interfaces. The available network interfaces are ‘Wired connection 1’ and the ‘enp0s3’ which is the main problem of the connection where there is no IP Address on it.

4. Select the appropriate network interfaces which in the context of this article, it is the ‘enp0s3’. The following image will display it :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

5. Click the Edit link as shown in the above image to edit the configuration of the network interface with the label of ‘enp0s3’. The following image will appears :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

6. Just click the checkbox Automatically connect as specifies in the above image. This is an important step to solve the problem. Since the configuration of the IP Address is dynamic, it must be set to ‘Automatically connect’. This option will automatically trigger the IP address request. Click the OK link to finish the configuration. The following image will appear :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

7. After that, click the Back link which exist in the above image. The following image will appear :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

8. Last but not least, click the Activate a connection link as shown in the previous image. It is an useful step for reactivating the new configuration of the network interface. The following image will appear :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

9. Click Deactivate link as shown in the above image. The change because of clicking the Deactivate link shows as follows :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

10. The previous step will turn off the network interface ‘enp0s3’. It is a necessary step in order to restart the function after the change in the network configuration of ‘enp0s3’. Finally, the last step is turning on back the network interface ‘enp0s3’. Just click the Activate link. After finishing on clicking the Activate link, the following image will appear :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

11. Click the Back link to get back to the first menu. The first menu for configuring network interface will appear as follows :

How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM
How to Solve No IP Address for NAT Adapter Virtualbox in Linux CentOS VM

12. Click the Quit link to quit from the network interface configuration menu. It is called the ‘NetworkManager TUI’. It appears whenever the ‘nmtui’ command is executed in the command line.

13. Last but not least, recheck the network interface configuration list. Type the command ‘ip addr’ again. If the network interface configuration is a success, there will be an IP Address assigned in the network interface. Below is the output of the command :

[root@10 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:56:6c:98 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global noprefixroute dynamic enp0s3
       valid_lft 85784sec preferred_lft 85784sec
    inet6 fe80::a7ab:b447:8238:537a/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:d8:ba:49 brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.101/24 brd 192.168.56.255 scope global noprefixroute dynamic enp0s8
       valid_lft 1082sec preferred_lft 1082sec
    inet6 fe80::e8bf:3425:d4c3:572d/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@10 ~]#

At last, the IP Address is exist. It is available for the network interface ‘enp0s3’. The IP Address in the above output is ‘10.0.2.15’.

Leave a Reply