Specific treatment methods are as follows:
1. Start VirtualBox and select “Administration” –>; “Global Settings”, in the pop-up window, select “Network”, and then in the right window, select the “Host-only Network” TAB, as shown below;

If you don’t have a VirtualBox Host-only Ethernet Adapter, you can add it by clicking “+” on the right.
Then double-click the VirtualBox Host-Only Ethernet Adapter and the following image will pop up:

Select “DHCP Server” and uncheck the “Enable Server” status.

2. Start the virtual machine
Enp0s3 and enp0s8 represent two network cards: Enp0s3 and enp0s8 represent two network cards:
[[email protected] ~]$ ifconfig
enp0s3: flags=4163< UP,BROADCAST,RUNNING,MULTICAST> MTU 1500
inet6 fe80::a00:27ff:fe4c:2f5b prefixlen 64 scopeid 0x20< link>
ether 08:00:27:4c:2f:5b TXQueuelen 1000 (Ethernet)
Packets 28 bytes 3361 (3.2 Kib)
R>rors 0 dropped 0 overruns 0 frame 0
Tx Pack>58 Bytes 6795 (6.6kib)
errors 0 dropped 0 overruns 0 carrier 0 Collision-losing 0
br> <>bb3 enp0s8: flags=4163< UP,BROADCAST,RUNNING,MULTICAST> MTU 1500
inet6 Fe80 :: A00:27ff: Fe46: D7F8 Prefixlen 64 scopeid 0x20< link>
ether 08:00:27:46: D7: F8 TXQueuelen 1000 (Ethernet)
Packets 24 bytes 6616 (6.4Kib)
R>rors 0 dropped 0 overruns 0 frame 0
Tx Pack>81 9555 bytes (9.3 KiB)
the TX errors 0 dropped overruns carrier collisions 0 0 0 0
In the directory CD /etc/sysconfig/network-scripts, you will see the presence of IFCFG-ENP0S3 file, copy a copy and change the name to IFCFG-ENP0S8, then edit IFCFG-ENP0S8, the final file contents are as follows:
TYPE=Ethernet
HWADDR= 08:00:27.46 :d7:f8 This indicates that the virtual network card address)
BOOTPROTO = static (here to change into the static)
DEFROUTE = yes
PEERDNS = yes
PEERROUTES = yes
IPV4_FAILURE_FATAL = no
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_PEERDNS = yes
IPV6_PEERROUTES = yes
IPV6_FAILURE_FATAL = no
NAME = enp0s8
UUID = 3 d54f693 – c56 bbef – 4-8984 – e0495a7c21s2 (this unlike enp0s3 coding)
DEVICE = enp0s8
ONBOOT = yes
IPADDR = 192.168.56.103
NETMASK = 255.255.255.0
GATEWAY = 192.168.56.1
Once this is done, start Service Network Restart and everything is OK.
Read More:
- mysql problem solving: mysqladmin: connect to server at’localhost’ failed
- The deployment of etcd storage and flannel network configuration for kubernetes / k8s multi node deployment
- VBoxManage.exe: error: Failed to create the host-only adapter
- Determining IP information for eth0… failed; no link present. Check cable?
- This error may also indicate that the docker daemon is not running.
- Hadoop download and install cloudera virtual machine (VM)
- VirtualBox problem solving set -[ drm:vmw_ host_ log [vmwgfx]] *ERROR* Failed to send host log message
- Modify the VDI path of VirtualBox on MacOSX, and transfer the virtual machine
- VirtualBox for macOS NS_ ERROR_ Failure (0x80004005) problem solving record
- Virtualbox failed to attach usb, VERR_PDM_NO_USB_PORTS problem solved
- Ubuntu cannot access USB device, failed to create a proxy device for the USB device
- The most complete solution for service network restart failure under CENTOS 7
- A solution to the default invalid host only mode of CentOS virtual machine in VirtualBox
- virtualbox Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT)
- Shortcut to exit zoom mode in VirtualBox [off]
- Vacuum box installation CentOS encountered the pit
- IP address cannot be viewed through ifconfig in virtual machine
- VirtualBox Failed to start LSB:Bring up/down Networking problem
- The solution to the problem that the virtual machine and the host SSH can’t connect on vmvare
- CentOS 7 installation error: Cannot find a valid baseurl for repo: base/7/x86_6