Application of VMware in Embedded Linux

Source: Internet
Author: User
Tags ftp client linux ftp client

1. Introduction to Vmware

1.1 What is VMware.

VMware is a popular virtual software. It can simulate a virtual machine on Windows and install any x86-based operating system.

-It also has the Linux version, so that you can install windows in Linux

-The updated server version VMware ESX does not require an operating system. directly Virtualize n machines on one hardware. Now many IDCs (Internet server vendors) use this technology to separate multiple core machines into n virtual machines for different websites.

VMware also has a Linux version.

1.2vmware advantages

-A set of standard hardware is virtualized by fully utilizing the host machine hardware.

-Easy to install. There are actually several files in all the information. If an error occurs, you can delete the files without affecting the host. Backup is also easy. Just copy the files directly.

-In addition, it can be used on any other machine. For example, if you place the Virtual Machine Installation File on mobile hardware, you can use it everywhere.

-The pause function is supported. Long-time operations can be paused temporarily. You can run the function again next time. Real machines cannot do this.

-You can use the image file of the disc to convert it into an optical drive for installation. In this way, you do not need to burn the downloaded file from the network to a disc like a real machine to install the operating system.

-You can simulate more hardware for testing. For example, you can simulate a machine with multiple NICs for firewall testing.

1.3. application scenarios of Vmware

Install one operating system and try another Operating System

-For example, if windows is installed, Linux is used for development or testing, it is much safer to use VMware than to install dual operating systems.

Virus and Trojan Analysis

-Use a virtual machine to make these guys do whatever they want for analysis.

Operating system debugging

-For example, if the hardware is directly installed on a single machine, many tools cannot be used, and it is much more convenient to use virtual machines.

1.4. Why install linux on Vmware?

The entire architecture of the teaching environment is still windows, and most of the students are familiar with windows, because the entire learning and development environment is Windows-based. The best solution is to install windows in VMware.

VMware Linux can directly use the original Virtual Machine file without installation.

Students can also install virtual machines unrelated to teaching.

2. network types of VMWare virtual machines

Because the development of virtual machines requires a lot of communication with the outside world, how to configure the virtual network is crucial.

2.1 VMWare has three statuses:

-Bridge Mode (Bridge Mode)

-Hostonly Mode

-Nat Mode

The three modes adopt different communication mechanisms. The bridge mode is to bind a filter to the real Nic. The hostonly mode is to create a virtual Nic vmnet1 in the host operating system, and then the VM communicates with vmnet1. in Nat mode, vmnet8 is used to communicate with virtual machines.

2.2 Bridge Mode

The premise is that you must connect to the network; otherwise, you cannot communicate with the host, because the real network card must be connected to the network before activation.

2.3 host only mode

Use vmnet1 to communicate with the host machine and cannot connect to the LAN.

2.4 Nat Mode

Use the virtual network card vmnet8 to communicate with the host machine and cannot connect to the LAN. Implement a NAT server on the host machine.

-Note: For Nat servers, VMWare has a Windows application, which is only required for demonstration.

2.5 bridge filter

The bridge mode is implemented by binding a filter to the real Nic. This indicates that the bridge must be bound to a real Nic. When multiple NICs exist, you must specify the NIC to which the NIC is bound.

Two virtual NICs

2.6. Select the VM Creation Mode

If the VM is located on a host in an IP network and needs to communicate with other hosts on the network, select Bridge Mode.

If it is a single machine with no network connection to the outside world, the network card is not activated at this time, the bridge mode will be invalid. the better choice is hostonly, so that the IP address of the VM Nic and the IP address of the vmnet1 Nic can communicate in the same network segment.

Nat has one more built-in NAT Gateway than the hostonly mode. The remaining configurations are similar.

3. Putty access to Linux in the VM

Putty Control for Linux is more convenient than directly operating on the VM console, so it is used more often, but if the configuration is incorrect, it is often prone to access failures.

In most cases, developers want the Windows operating system to communicate with VMware Linux over the network, such as using Putty to log on to Linux and Samba to share files. In different environments, VMware uses Linux for different configurations. Many beginners often cannot configure the network between the two.

3.1 first: Set the Virtual Machine Network Mode

-If the host is in the hostonly mode and the network host is in the bridge mode, the NIC is not activated because the NIC is not activated, the network still cannot be connected, and the network host can also select the hostonly mode. The disadvantage is that only the local machine can access the virtual machine, and other hosts on the network will not be able to access the virtual machine.

-Select a vmnet1 Nic for the hostonly mode,

-In Bridge Mode, select vmnet0 bound to the physical network card. If multiple physical network cards exist on one machine, you can use the manager virtual networks function to specify that vmnet0 is bound to one network card.

3.2 Step 2: confirm the host access mode.

-If you need to access a Windows host from a virtual machine, check whether the firewall of Windows is disabled. Generally, You need to disable the firewall to access the host (or set the service to be accessed as a firewall exception, which is a little troublesome)

For example, access a Windows FTP server from a Linux FTP Client

If you use the firewall that comes with windows, view and set it in the ± Control Panel> Windows Firewall ¡±.

However, if a Windows host is located on the network, it is in a dangerous state without firewall protection. You can select hostonly mode to disable the firewall, but this means that other hosts on the network cannot directly access the virtual machine.

-If you need to access the virtual machine from windows, check whether the Linux firewall of the virtual machine is disabled. Generally, You need to disable the firewall to access the Virtual Machine. Putty adopts this mode.

You can close and open the interface, choose ± Main Menu> system Settings> Security Level interface, and view and set

3.3 Step 3: Configure an IP Network

-In the same LAN, the two hosts must process one IP subnet for communication.

The method to determine whether to process a subnet is to compare the local IP address with the upper subnet mask. If the result is obtained, it indicates the network number. If it is consistent, it indicates that it is located in the same subnet.

If the IP address of the local machine is 192.168.1.136 and the subnet mask is 255.255.255.0, then the network number 192.168.1.0

-Use ifconifg to configure Linux IP addresses and masks

Ifconfig eth0 192.168.1.136

-In Windows, use ¡± network connection on the GUI-> NIC-> TCP/IP configuration. You can use ipconfig/all to view IP addresses.

-If you use Putty to access Linux, you must ensure that you can ping Linux using the ping command in windows. If you are connected, you can use Putty to access Linux.

4. Embedded Linux virtual machine configuration

For Embedded Linux development. To facilitate development in different scenarios. I want to configure the following structure to facilitate development.

4.1 dual Nic Mode

The default Nic is set to bridge mode, which is used to communicate with other machines. Generally, it is the network segment 192.168.1.x.

After a virtual machine is created, it stops running. In virtual machine settings. Then a new Nic is added. The hostonly mode is used. Generally, the CIDR block is set to 192.168.2.x.

The second network card is saved in any situation (single-host, network), so that putty and Samba can access the virtual network with a fixed address.

4.2 about using USB reexport serial port for virtual machines

Generally, there is no serial port in the notebook. use USB to serial port to connect to the Development Board. If you want to use this serial port for both the Virtual Machine and windows, make the following configurations on the virtual machine. Select Add a serial port. Make the following configurations in the serial port configuration.

Use the physical serial port, and select "USB serial port" on the physical serial port to apply the device name. In the virtual machine, you can directly use/dev/ttys0 to operate the serial port.

Note: The VM is still an application. Therefore, if other applications use serial ports. The serial port cannot be opened in the virtual machine. In turn, if you need to temporarily disable the serial port of the virtual machine, you can remove the "connected" mark in the serial port configuration.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.