http://www.jianshu.com/p/a4dbdb40b72b
http://blog.csdn.net/briup_acmer/article/details/72125172
The two combine to do:
View network card name: Enter IFCONFIG-A in terminal
VirtualBox settings:
Interface Name selection (if your notebook has a wireless card and a wired card, you need to choose according to the current way of surfing)
Advanced-Control chip selection Pcnet-fast III
Advanced-Promiscuous Mode reject
Advanced-access Network cable Yes
(Automatic acquisition of virtual machine IP)
IP style:
IP is within the same network segment as the native IP
The gateway is the same as the native gateway
Ubuntu internal settings: Command plus sudo
1, first login with the root user, and then enter your root password. Such as:
2. Then edit the interfaces file, located under/etc/network/, and execute the following command:
Vim/etc/network/interfaces, enter,
3. Add:
# interfaces (5) file used by Ifup (8) and Ifdown (8) Auto Loiface Lo inet Loopback This is what is added to the file:
# The Primary network interface
Auto Eth0
Iface eth0 inet Static
Address 192.168.1.100 (Note that the network segment and host are consistent, such as the host is: 192.168.1.3, it can be set to: 192.168.1.*) (* denotes any number within the legal range)
Netmask 255.255.255.0
Gateway 192.168.1.1 (Note that the gateways and hosts remain the same)
4, after the addition, save the Exit (command: wq!), the next step is to configure DNS resolution, DNS resolution file/etc/resolv.conf.
Execution: vim/etc/resolv.conf, such as:
5. Add it under the file:
NameServer 192.168.1.1 (Note: The 220.170.64.68 is superfluous, should be deleted)
6, change the above, if restarted, or will become the original appearance, so let it change forever,
Therefore, the execution: Vim/etc/resolvconf/resolv.conf.d/base,
7, add in the inside
NameServer 192.168.1.1 (Note: The 220.170.64.68 is superfluous, should be deleted)
8, then save the exit (: wq!) and restart the server (reboot) to the basic completion of the static IP configuration
Note: When installing Ubuntu system in VirtualBox, you need to set up VirtualBox network connection mode: Bridge, otherwise the host cannot ping the IP address of the virtual machine (Ubuntu). And you need to set the virtual machine's gateway and host consistent, the IP address of the virtual machine and the IP address of the host in the same network segment. Otherwise not only can not ping each other, may also not connect to the Internet.
The strongest soy sauce
Links: http://www.jianshu.com/p/a4dbdb40b72b
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source. Briup_acmer
Links: http://blog.csdn.net/briup_acmer/article/details/72125172
Source: Csdn
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Virtual Sets the Ubuntu16.04 Network Bridge, the host and the virtual machine ping, the VM and the other machine ping through