I recently needed to install a CentOS virtual machine, recommended by a colleague I bought the compact VirtualBox to replace the "bulky" VMware, so I tried to install the CentOS-6.7 virtual machine on VirtualBox.
The process of installing a virtual machine is similar to that of VMware. If you are familiar with VMware, it will not be a problem. However, the newly installed virtual machine has always been unable to connect to the network and encountered many problems.
My VirtualBox version is 4.3.24 r98716, and the CentOS-6.7 kernel version is 2.6.32-513.3.1.el6.i686.
This is the first problem I encountered. Although I set up the Bridge connection method and re-established the ifcfg-eth0 file, I still encountered the prompt No. There is a problem with network equipment. The specific screenshots are as follows:
For this problem, we can learn from online solutions:
After comparison, the two values are indeed inconsistent, so the configuration file is modified again; however, after running, it is found that there is still a problem with the eth0 port :
The first thing I thought of here was to add the parameter NM_CONTROLLED=yes in the ifcfg-eth0 configuration file, and then restart the system. The problem remains. I continued to search for information on the Internet, and finally found the cause of the problem. In CentOS-6.0 or above systems, the problem occurred when NetworkManager and Network services managed the network card at the same time. The solution was to execute the following commands in sequence:
Then the problem is solved, but My CentOS still cannot connect to the Internet through the VirtualBox bridge. I thought the problem should be in the VirtualBox settings. Sure enough, I need to allow virtual networks in the network settings:
Finally the problem is solved and the network can be connected.
It is also worth mentioning that before I used VMware or VirtualBox to use NAT to create CentOS-6.7 virtual machines, the network was always unable to connect. Later, I used Bridge mode. Bridge mode is more convenient than NAT mode. Be more stable.