Home > System Tutorial > LINUX > body text

How to set up the network connection of the Linux system in the virtual machine?

WBOY
Release: 2024-01-01 14:01:30
forward
638 people have browsed it

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?

Preparation Phase

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.

How to set up the network connection of the Linux system in the virtual machine?

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".

How to set up the network connection of the Linux system in the virtual machine?

Bridge Mode

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.

How to set up the network connection of the Linux system in the virtual machine?

How to set up the network connection of the Linux system in the virtual machine?

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.

How to set up the network connection of the Linux system in the virtual machine?

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.

How to set up the network connection of the Linux system in the virtual machine?

How to set up the network connection of the Linux system in the virtual machine?

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.

How to set up the network connection of the Linux system in the virtual machine?

Alternatively, you can also type the "ifconfig" command in the terminal of the Linux system to view it.

How to set up the network connection of the Linux system in the virtual machine?

Use the "ipconfig" command in the windows terminal to view the IP address of the windows system:

How to set up the network connection of the Linux system in the virtual machine?

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.

How to set up the network connection of the Linux system in the virtual machine?

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!

source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template