For many students who are new to Linux, most of them choose to use a virtual machine to start learning. You can easily do experiments, modifications, and tests, and you don’t have to be afraid of problems, you can just mess around! At worst, if you change to a virtual machine, the original system will not be affected in any way. However, since it is not a physical PC, its use is inevitably limited. If the configuration is not good, later development will suffer!
For example, databases are used in many programs! MySQL, Redis. To establish a connection with them, especially remotely, you must specify the IP and port. How to configure a virtual machine so that Windows and Linux can be interconnected to facilitate access to the external network without frequent changes?
This short article explains the configuration of the Ubuntu operating system and graphical network environment in the Vmware virtual machine. The Vmware version used in this article is 15.1.0. The Ubuntu system version is 18.04.
First of all, before starting the configuration, you need to make preparations in advance and master some preparatory knowledge.
l Preparation: Make sure that ssh has been successfully installed in the Ubuntu system. You can use the aptitude command to view it.
l Preliminary knowledge: After successfully installing the Vmware virtual machine, we can find two network cards in our PC. Physical network card and virtual network card VMnet8. Physical network card, connected to WLAN. Virtual network card VMnet8, connected to the internal LAN. Make sure they are all enabled. If it is not enabled, right-click on the icon shown below and select "Enable".
Bridge mode configuration is the simplest! Use routers or switches to automatically allocate IP to achieve mutual access between windows and Linux.
The first step is to open the configuration page of the Vmware virtual machine. Select bridge mode.
Step 2 Click the "Network" icon in the Ubuntu system, select "Wired Settings", click the " " sign on the pop-up page, and add a wired connection.
The third step is to set the name of the newly added wired connection so that you can recognize it by name. Then use its default attributes in IPv4. Confirm that everything is correct and click the "Add" button.
The fourth step is to choose to use the newly configured connection. You can see the generated Linux IP address corresponding to the new configuration on the page.
Alternatively, you can also type the "ifconfig" command in the terminal of the Linux system to view it.
Use the "ipconfig" command in the windows terminal to view the IP address of the windows system:
test. The two systems ping each other using the IP address of the other end. Because of the bridge mode used, it can be understood that your virtual machine deceives the router, making the router think that your virtual machine is a physical machine and assign it an independent IP address.
After passing the test, the windows and Linux systems can access each other with the help of the router! And if the router can connect to the external network, then both systems can have free and independent scope of the World Wide Web.
However, this connection method has certain problems!
Previous page12 Next page Read the full text
The above is the detailed content of How to set up the network connection of the Linux system in the virtual machine?. For more information, please follow other related articles on the PHP Chinese website!