当前位置:首页 > 虚拟机 > 正文

虚拟机可以用来干什么(虚拟机是具体用来干什么的)

What is the use of virtual machines?

In layman's terms, a virtual machine virtualizes a computer to realize the functions of one computer with multiple computers. However, the performance of the entire machine will also be allocated and divided by each virtual machine, so the division The more virtual machines there are, the fewer CPU, memory, and storage space resources allocated to each virtual machine. Therefore, the higher the configuration, the better when setting up virtual machines. Therefore, it is widely used in server and other industries.

The role of virtual machines in reality is quite large. For example, in the simplest case, our computer does not have an optical drive. If we want to install a system, we can use a virtual machine to install the system. The virtual machine has a virtual optical drive inside, which supports Open the system image file directly to install the system. In addition, virtual machine technology is also very practical in the eyes of game enthusiasts. For example, we know that many games on a computer generally do not support multiple games at the same time, but we can create several more virtual machines on the computer. Then you can run the program separately in the virtual machine system, so that one computer can open multiple games at the same time. In addition, there are many functions of virtual machines, so I won’t introduce them one by one here.

In fact, virtual machines are widely used in enterprises. Because servers usually have very high configurations, many server network providers usually divide one server into multiple virtual machine servers in order to meet the needs of small and medium-sized webmasters. Each website can be allocated a portion of independent server resources without affecting each other and can be assigned an independent IP address, which greatly solves the problem of high costs for small and medium-sized enterprises to use independent servers. Currently, all VPS servers purchased use this technology. The virtual space used by friends of the website in the early days is also based on this principle. Friends who are interested may wish to learn about it.

What are virtual machines generally used for?

Virtual machine (VirtualMachine) refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.

When installing a virtual machine, the computer will become stuck.

A virtual machine can simulate other types of operating systems. It needs to simulate the underlying hardware instructions, so the application running speed is much slower than the virtual system.

Popular virtual machine software includes VMware (VMWareACE), VirtualBox and VirtualPC, all of which can virtualize multiple computers on Windows systems.

Extended information:

Virtual machine resources involve many aspects: CPU, memory, network and disk. The relationship between these resources should be considered when planning virtual machines. Otherwise, unreasonable allocation of resources will lead to poor application performance within the virtual machine.

1. CPU

Each vCPU of a virtual machine only runs on one physical core, so the higher the CPU frequency, the higher the running speed of the virtual machine. A larger number of vCPUs helps improve application performance. One complicating factor is that within an ESXi server, all virtual machines share the same physical CPU. The more cores an ESXi server has, the greater the core share each vCPU gets.

2. RAM

RAM resources in ESXi servers are usually limited, so you need to be extra careful when allocating RAM to virtual machines. The VMkernel is very clever when it comes to handling RAM; it allows virtual machines to use all the physical memory of the ESXi server and tries to avoid occupying physical memory without actually using it.

After the physical memory is completely used up, the VMkernel must determine which virtual machines can retain physical memory and which virtual machines need to release physical memory. This is called "memory recycling". When the physical memory occupied by a virtual machine is reclaimed, there is a risk that it will affect the performance of the virtual machine. The more memory that is reclaimed by a virtual machine, the greater the corresponding risk.

It is wisest to allocate only the memory that a virtual machine needs to do its job. Allocating additional memory will increase the risk of collection. On the other hand, when the virtual machine operating system uses unused memory as disk cache, it will significantly reduce the performance requirements on the disk system, so there is a trade-off issue here.

For database servers and VDI desktops, it is often more cost-effective to allocate more memory to virtual machines—running fewer virtual machines on an ESXi server—rather than purchasing high-performance disk arrays. The key is to allocate enough memory for the workload of the virtual machine without wasting it.

3. Network bandwidth

Network bandwidth includes two aspects: one is the bandwidth between the virtual machine and the virtual switch, and the other is the bandwidth between the virtual switch and the external network. If you want the virtual machine to get maximum bandwidth, you should use the VMXNET3 network adapter.

For connections to external physical networks, be sure to ensure that the ESXi host has the fastest physical network card. Virtual machines that perform a large number of network transmissions, virtual machines, and data packet transmission will consume CPU time.

4. Disk performance

Virtual machine disk performance is limited by the number and type of array disks and the number of virtual machines running on them. Because a centralized shared storage architecture will result in all virtual machine disks being accessed from the same location, it is easy for the array's storage controller and disks to become overloaded, leaving virtual machines waiting for a response from the storage.

The effects of virtual machines waiting for disk IO and virtual machine CPU idleness on performance are very different. A VM waiting for IO cannot do other work, so high I/O wait time means performance will definitely degrade. Careful storage design is critical to avoid the above situations.

Reference source: Baidu Encyclopedia Virtual Machine

What is a virtual machine? What are the benefits of having a virtual machine installed on your computer?
A more popular answer (suitable for friends who have no computer knowledge) A virtual machine, as the name suggests, is a virtual computer. This virtual computer is almost exactly the same as a real computer. The difference is that its hard disk is It is virtualized in a file, so you can modify the settings of the virtual machine at will without worrying about causing damage to your computer, so it can be used for experiments and so on. Haha, that's about it. I don't know what I mean. Do you understand? ^_^ To put it simply, you can do anything with the virtual computer. A more professional answer (suitable for friends with a little computer knowledge) A virtual machine refers to an application running on a Windows or Linux computer. This application "simulates" a standard PC environment based on x86. This environment is the same as an ordinary computer, with chipset, CPU, memory, graphics card, sound card, network card, floppy drive, hard disk, optical drive, serial port, parallel port, USB controller, SCSI controller and other devices, providing the "window" of this application "It's the monitor of the virtual machine. On a computer, part of the hard disk and memory are taken out to virtualize several machines. Each machine can run a separate operating system without interfering with each other. Each of these "new" machines has its own independent CMOS, hard disk and operating system. You can partition, format, install systems and application software just like ordinary machines, and you can also connect these operating systems into a network. After the virtual system crashes, it can be deleted directly without affecting the local system. Similarly, after the local system crashes, the virtual system will not be affected. You can reinstall it next time and then add the previously created virtual system. It is also the only virtual computer software that can run on Windows and Linux host platforms. Virtual machine software allows you to use multiple OSs on the same computer without restarting, which is not only convenient but also safe. Virtual machines can play a big role in learning technology.