An environment:
ubuntu v8.04
virtualbox _v4.3
Two operations
1 Press to create a new virtual machine as normal, and then choose to use the old ubuntu virtual machine in the select virtual hard disk interface
2 Open the virtual machine and delete the file containing net under /etc/udev/rules.d/ This example is 70-persistent-net.rules
3 Open /etc/network/interfaces and add the following statement
auto eth0
iface eth0 inet dhcp
then save and close
4 Shut down the virtual machine, and then set the network of the virtual machine to "Network Address Translation (NAT)". After saving and confirming, start the virtual machine. If it is normal, use ifconfig to see that the virtual machine has obtained the ip address.
Three pairs of operations explained
1 70-persistent-net.rules saves the network card information saved by the modified virtual machine. Every time the virtual machine is replaced, a network card will be added, and the interface name will be added to the original network card. 1 eg: eth1. Delete and After restarting, from the perspective of the virtual machine, a new network card is added. Naturally, the name of this network card is named eth0.
2 /etc/network/interfaces is the setting information of the currently used network card, dhcp is the dynamic acquisition