configure network
Use the ifconfig -a command to check the status of the network card, whether there is an eth0 Ethernet network card
1. Check whether there is auto eth0 related information in the /etc/network/interfaces file
If there is no auto eth0 related information in the file, directly add the following content to the file:
car eth0
iface eth0 inet dhcp
For example, if it prompts that there is no permission, you need to switch to the root account
Enter: sudo su to temporarily obtain root privileges
restart network card
Execute the /etc/init.d/networking restart command to restart the network card
2. If you still can’t connect to the network, reset the virtual network (restart method: edit – virtual network editor). View the contents of /etc/NetworkManager/NetworkManager.conf:
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
Change managed=false to managed=true. Finally, bring up the eth0 NIC with the ifup eth0 command.
3. Set the virtual machine network adapter to bridged mode
4. Win+r input: ncpa.cpl to open the network connection to add network services
4. Select NAT mode
enable networking
restart network card
systemctl restart Network-manager
Execute the /etc/init.d/networking restart command to restart the network card