Article title: Virtual Machine Linux network configuration. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
There are four network connection methods for virtual machines: Bridged (network Bridge), NAT, Host-only, and Custom. Generally, the following two methods are rarely used by users. here we will only introduce the usage and configuration methods of the first two methods. No matter which method, it involves three settings: host system (this book corresponds to Windows system), virtual machine, and virtual system (this book corresponds to Linux system ).
(1) Bridged mode
If your real host is on an Ethernet network, this method is the easiest way to connect your virtual machine to the network. A virtual machine is like a new computer with the same physical status as a real host. in the bridging mode, you can enjoy all available services, including file services and printing services.
To connect a virtual machine to the Internet through a Linux system, you must set the IP address of the Linux system to the same network segment as that of the Windows system. for example, if the IP address of the Windows system is 10.62.85.1, in Linux, the IP address must be set to 10.62.85.x (x = 2 ~ 254 ). Specific operations include the following steps:
* Set the Windows IP address to 10.62.85.1.
* Set the network connection mode of the VM to Bridged, as shown in Figure 4-2-1.
* In the Linux System startup bar, run "System"> "Administration"> "Network". in the displayed "Network Settings" dialog box, select "Wired connection, click "Properities". in the pop-up "eth0 properities" dialog box, set the Ubuntu IP address to 10.62.85.2. the subnet mask and Gateway settings are the same as those in Windows.
In this way, start the browser in Linux to see if it can be connected to the Internet.
You also need to configure the Proxy server (if your Windows System is connected to the Internet through the Proxy server), run "System"-> "preferrences"-> "Network Proxy ", set the IP address and port of the proxy server.
(1) NAT mode
In the networkaddresstranslation mode, you can easily connect virtual machines to the public network. The cost is that other functions in the bridge mode cannot be used. The configuration in this mode is quite simple. as long as the real host is connected to the Internet, set the network connection mode of the virtual machine to NAT, and then set the network in the Linux system to DHCP, then the Linux system can access the Internet. If your Windows system is connected to the Internet through a proxy server, configure the proxy server as well.
In embedded Linux development, if the host Linux system needs to connect to the Internet, you can set the virtual machine to the Bridged or NAT mode as described above. However, to implement network communication between the host Linux system and the target machine, you must configure the network connection mode of the virtual machine to Bridged, then, set the IP address of the target machine to the IP address of the Linux system on the host machine in the same network segment.