虚拟机可以让您在安全的环境中试验和使用操作系统。它就像一台沙盒计算机,您可以使用它来尝试在您的实际系统上无法运行的应用程序。此外,由于它是虚拟的,因此如果您搞砸了,您不必重新安装操作系统。您所做的一切都与您的真实系统隔离。
虚拟机是有用的工具,所以在本文中,我们将看看是什么让它们运转起来,以及你需要什么来设置它们。
虚拟机解释
虚拟机(Machine),简称 VM,就像系统内部的一个单独的计算机系统,但它不以物理形式存在。虚拟机存在于虚拟环境中,它使用自己的虚拟设备、资源和存储。
了解什么是虚拟机的最佳方法是将其想象为您计算机上的一个文件,它充当单独的实际计算机。即使 VM 是一个虚拟环境,它也有自己的存储空间,您可以在其中保存不同的文件,并且它可以连接到 Internet。
运行虚拟机的软件称为管理程序。其目的是将虚拟机与您的默认操作系统分开和隔离。这意味着您在 VM 中所做的任何事情都不会影响您的主操作系统和设备。但是管理程序还通过将CPU、内存和存储等物理资源分配给虚拟机来管理 VM。但它是您设备的物理硬件将执行虚拟机的所有进程。
虚拟机(Virtual Machines)的主要好处是您可以在一台设备上运行多个操作系统,如Linux、Windows和 macOS。您的设备是主机,其上的所有虚拟机(Virtual Machines)都是访客。您为 VM 选择的操作系统称为来宾操作系统。
虚拟机上的虚拟操作系统以与主操作系统相同的方式运行,也称为主机操作系统在您的物理设备上运行。这意味着您使用虚拟机的体验几乎与您的计算机运行的主要实时操作系统的体验相同。
虚拟机如何工作?
虚拟化(Virtualization)技术使得在一台机器上拥有多个操作系统成为可能。为了创建虚拟机,管理程序将从托管来宾 VM 的物理计算机中借用CPU、内存和存储。这些资源的分配始终考虑到 VM 的需求。
当您运行虚拟机并且它需要比分配给它的管理程序更多的资源时,管理程序会将请求安排到物理设备以重新分配更多资源。这是因为管理程序将CPU、内存和存储视为共享资源池,它可以从中获取运行虚拟机所需的资源。
有两种类型的管理程序。
类型 1
裸机虚拟机管理程序,或简称为Type 1,直接在您的物理设备上运行,并且可以立即访问所有资源。正因为如此,Type 1 hypervisor 被认为比 Type 2 更高效,并且便于创建虚拟服务器、桌面和应用程序。
类型 2
托管管理程序或类型 2 安装在已具有主操作系统的主机上。主操作系统管理对资源分配的调用。因此,Type 2 管理程序用于创建具有单一目的的特定环境。例如,应用程序开发人员将创建一个非常适合构建和测试各种应用程序的环境。
尽管虚拟机和管理程序不需要专用硬件,但您的计算机需要能够运行它们。它需要有足够的硬件资源来运行管理程序、构建虚拟环境并在其中工作,同时还要运行主操作系统。无论虚拟机的需求多么小,您都需要一台强大的计算机。
虚拟机有什么用途?
虚拟机对专业人士和非专业人士都有广泛的用途。如果您精通技术和极客,您可能会发现玩虚拟机特别有趣。许多这些用途包括可能破坏机器。VS 确保您的设备和主操作系统完全不会受到影响。以下是 VS 的一些最流行的用途。
1. 试用新操作系统
使用虚拟机,您可以尝试以前从未使用过的操作系统,对其进行测试、了解它们并确定您是否足够喜欢它们以使其成为您的主要操作系统。如果您是Windows(Windows)的长期用户,您可以试用Linux或其他一些鲜为人知的操作系统,而无需先从计算机中删除Windows。
此外,您可以尝试新的和不稳定版本的默认操作系统,而不必担心您可能会丢失重要文件。因为虚拟机是一个安全的虚拟环境,你甚至可以测试新操作系统到你破坏它们的程度,它不会对你的物理机产生任何影响。
2.运行旧软件
一些旧软件需要不再使用的过时系统。很可能您没有备用的旧机器,但您仍想试用仅与Windows XP等兼容的旧应用程序。
虚拟化允许您在虚拟机上安装Windows XP,并使用它来试用特定的旧软件。这对游戏玩家特别有用,因为一些旧的但仍然相关的游戏与现代设备和操作系统不兼容。
3.运行(Run Software Developed)为不同操作系统开发的软件(Different OS)
假设您是Linux用户,但您确实需要运行为Windows开发的应用程序或游戏。虚拟化(Virtualization)将允许您在虚拟环境中拥有Windows 操作系统(Windows OS),并享受为其开发的所有应用程序。请注意,某些应用程序同时存在于不同的操作系统中,但大多数不存在。诚然(True),它们可能在不同的系统上开发了它们的对应物,但它们永远不会完全相同。
4.不同平台(Different Platforms)的测试软件(Test Software)
如果您是应用程序开发人员,则虚拟化(Virtualization)将允许您测试针对不同设备的软件构建。假设您正在开发一款可在 PC 和手机上运行的游戏。使用虚拟机,您无需在设备之间来回移动安装程序文件。您可以模拟手机和其他设备,并在您的计算机上一次性进行测试。
5. 安全地处理潜在的恶意软件(Potential Malware Safely)
如前所述,虚拟机与计算机的其余部分隔离。这使得测试潜在恶意软件非常安全,您可以承担通常会避免的风险。当您想试用来自不可靠来源的软件时,这非常有用。如果它被感染,它会在虚拟操作系统中显示,但不会损害您的主操作系统。您还可以使用 VS 测试您可以在不冒感染计算机的情况下将防病毒程序推送到多远。
请注意,您仍然需要非常小心。现代恶意软件可以识别虚拟环境并尝试突破。风险很低,但并非完全不存在。
6.在一台 PC 上
编译多个服务器(Compile Multiple Servers)
许多企业运行多台服务器。如果您参与此类业务,虚拟化(Virtualization)可以在一台设备上编译不同的服务。您可以创建多个虚拟机并在其中存储服务器,而无需投资多个硬件系统。在一个操作系统上运行不同的服务器是一种不必要的安全风险。
使用虚拟机(VMs)有什么好处(Benefits)?
既然您已经了解了虚拟机的许多不同用途,那么您大概可以了解它们的好处了。但是让我们来看看虚拟机(VMs)可以为您的职业生活带来的一些优势,让您的休闲时光更加愉快。
1.它们具有成本效益
由于虚拟化不需要多个硬件,因此您无需在不同的设备上投资。您需要做的所有事情,现在都可以在一台机器上完成。即使您运行多台服务器,维护成本也会降低,因为它们都存储在同一台物理服务器上。
2.他们很容易被移动
由于虚拟机作为文件存储在您的设备上,因此您可以将它们复制并随身携带在USB设备上。您可以稍后将它们安装在不同的硬件上或将它们重新分配给不同的主机服务器。
3.他们提供安全
由于VM(VMs)是隔离的虚拟环境,因此您在其中所做的一切都不会影响您的主系统。这使得它们使用起来非常安全。虚拟机在那些关心其安全性的人中也很受欢迎。您可以使用虚拟机访问不可靠的网站或下载可疑软件。
4.它们非常(Experimenting)适合(Perfect)测试和实验(Testing)
假设您使用 VM 将应用程序测试到临界点。您的虚拟机操作系统(VM OS)可能在测试期间损坏。不用担心,您可以使用快照或备份等功能恢复到操作系统损坏之前的先前版本。这对于摆脱受损或损坏的虚拟操作系统也很有用。
云计算中的虚拟机
您(Did)知道虚拟机可以基于云吗?它们旨在取代物理机器,并且如果安装在个人计算机上,仍然可以让你做任何 VM 会做的事情。云计算中有两种类型的虚拟机:ProcessVM和System VM。
Process VM旨在以应用程序的形式在主机上运行单个进程。例如,Java 虚拟机(Java Virtual Machine)将允许任何系统运行所有Java应用程序。它是进程虚拟机(Process Virtual Machine)的典型示例。系统 VM(System VM)旨在用虚拟机完全替换物理机
。
基于云的虚拟机的优点是您的物理计算机将无法访问它,并且不会尝试与 VM 调和。这意味着云计算环境非常适合虚拟机以及您在其中所做的所有工作,无论是测试恶意软件还是新的不稳定操作系统。
最好的虚拟机软件
要在您的计算机上设置 VM 环境,您需要特殊的虚拟机软件。您将在下面找到最受欢迎的选项。
1. VMWare 工作站播放器(VMWare Workstation Player)
VMWare是一个综合性的虚拟化产品包。它提供适用于Apple Mac的(Apple Mac)Fusion和适用于 PC 的WorkstationPlayer。它们是为不同的主机操作系统量身定制的,但本质上提供了相同的解决方案。作为少数支持DirectX 10的虚拟化软件之一,对于那些对GPU虚拟化感兴趣的人来说,它是一个不错的选择。VMware可供个人免费使用,但企业用户需要购买Pro和Fusion Pro版本。
2.Oracle VM VirtualBox(Oracle VM VirtualBox)
VirtualBox支持广泛的主机和来宾操作系统,这使其成为想要进行实验的人的绝佳选择。您可以使用Windows XP、Windows NT、Linux 2.4、OpenSolaris、Server 2003甚至IBM OS/2VM(VMs)。Apple用户可以运行Mac VM会话。但最重要的是,VirtualBox是开源且完全免费的,甚至是为企业开发
的企业版。(Enterprise)
3.微软Hyper-V(Microsoft Hyper-V)
Hyper-V于 2008 年由Microsoft开发,现在可供所有Windows 10和 11专业版(Pro)、企业版(Enterprise)和教育(Education)版用户免费使用。但是这个免费版本非常有限,从长远来看并没有真正的回报。它缺乏GPU支持,但您可以使用它来创建Windows XP或更高版本的虚拟环境,以及具有至少 3.4 Kernel和FreeBSD的(FreeBSD)Linux。Microsoft Hyper-V不会创造奇迹,但对于想要尝试虚拟化的初学者来说,它是一个不错的入门选择。
无论您是普通 PC 用户还是专业人士,虚拟机都将打开一个充满可能性的全新世界。使用它们来测试您想知道的新操作系统。试用不适用于您的Windows系统的Linux应用程序。(Linux)做你想做的一切,而不会让你的电脑处于危险之中。
在下面的评论中让我们知道您为什么以及如何使用虚拟机!
What Is a Virtual Machine and What Can It Be Used For?
A virtual machine can let you experiment and play around with an operating system inside a safe environment. It’s like a ѕandboxed computеr that you can use to try apps that don’t work on your actual system. Also, since it’s virtual, іf you mess something up you won’t have tо reinstall your operating syѕtem. Εverything you do is isolated from your real system.
Virtual machines are useful tools, so in this article, we’ll take a look at what makes them tick and what you need to set one up.
Virtual Machines Explained
A Virtual Machine, or VM for short, is like a separate computer system inside your system but it doesn’t exist in physical form. A virtual machine exists in a virtual environment and it uses its own virtual devices, resources, and storage.
The best way to understand what a virtual machine is is to imagine it as a file on your computer, that acts as a separate actual computer. Even though the VM is a virtual environment, it has its own storage where you can save different files, and it can connect to the internet.
The software that runs the Virtual Machine is called a hypervisor. Its purpose is to separate and isolate the Virtual Machine from your default operating system. That means anything you do in the VM won’t influence your main OS and your device. But the hypervisor also manages the VM by allocating physical resources such as CPU, memory, and storage to the virtual machine. But it is the physical hardware of your device that will execute all processes of a virtual machine.
The main benefit of Virtual Machines is that you can run multiple operating systems like Linux, Windows, and macOS on one device. Your device is a host computer, and all Virtual Machines on it are guests. The operating system you choose for your VM is known as a guest OS.
The virtual OS on a virtual machine runs in the same way as the primary, also known as the host OS runs on your physical device. That means that your experience with a VM is nearly identical to the experience of your primary real-time OS run by your computer.
How Does a Virtual Machine Work?
Virtualization technology makes it possible to have several operating systems on one machine. To create a virtual machine, the hypervisor will borrow CPU, memory, and storage from the physical computer that will host the guest VMs. The allocation of these resources is always done with the VM’s needs in mind.
When you’re running a Virtual Machine and it demands more resources than the hypervisor allocated to it, the hypervisor will schedule the request to the physical device to reallocate more resources. This is because the hypervisor treats the CPU, memory, and storage as a shared pool of resources from which it can take what is needed to run the virtual machine.
There are two types of hypervisors.
Type 1
A bare-metal hypervisor, or simply called Type 1, runs directly on your physical device and has immediate access to all resources. Because of this, Type 1 hypervisors are considered to be more efficient than Type 2, and convenient for creating a virtual server, desktop, and apps.
Type 2
A hosted hypervisor or Type 2, is installed on a host machine that already has a primary OS. The primary OS manages the calls to resource allocation. Because of this, Type 2 hypervisors are used to create specific environments with a single purpose. For example, an app developer will create an environment perfect for building and testing various applications.
Although virtual machines and hypervisors don’t demand dedicated hardware, your computer needs to be able to run them. It needs to have enough hardware resources to be able to run a hypervisor, build a virtual environment, and work in it, all while running the primary OS as well. No matter how small demands a virtual machine might have, you will need a strong computer.
What are Virtual Machines Used For?
Virtual machines have a wide array of uses for professionals and non-professionals. You may find virtual machines especially fun to play with if you are tech-savvy and geeky. Lots of these uses consist of potentially breaking the machine. VS makes sure your device and the primary OS won’t be influenced at all. Here are some of the most popular uses for the VS.
1. Try Out New Operating Systems
With a virtual machine, you can try out operating systems that you have never used before, test them, understand them and decide if you like them enough to make them your primary OS. If you are a long-term Windows user, you can try out Linux, or some other lesser-known OS, without having to first remove Windows from your computer.
Moreover, you can try new and unstable versions of your default OS without having to worry that you might lose important files. Because VM is a safe and virtual environment, you can even test the new OS to the point where you break them, and it will not have any effect on your physical machine.
2. Run Old Software
Some old software requires outdated systems that are no longer in use. It is likely you don’t have a spare old machine, but you still want to try out an old app that is compatible only with, for example, Windows XP.
Virtualization allows you to install Windows XP on a virtual machine, and use it to try out that particular old software. This is particularly useful for gamers as some old, but still relevant, games are not compatible with modern devices and operating systems.
3. Run Software Developed for Different OS
Let’s say you are a Linux user, but you really need to run an app or a game developed for Windows. Virtualization will allow you to have a Windows OS in a virtual environment, and enjoy all the apps developed for it. Note that some apps exist for both across different operating systems, but most don’t. True, they might have their counterparts developed on a different system, but they will never be exactly the same.
4. Test Software for Different Platforms
If you are an app developer Virtualization will allow you to test your software builds for different devices. Let’s say you are developing a game that will work on both PC and phones. With a virtual machine, you won’t need to move the installer files back and forth from device to device. You can emulate a phone as well as other devices and test all at once on your computer.
5. Deal with Potential Malware Safely
As mentioned before, the virtual machine is isolated from the rest of your computer. This makes it extremely safe for testing potential malware and you can take risks you would typically avoid. This is very helpful when you want to try out software that comes from an unreliable source. If it is infected, it will show as such in the virtual OS, but it will not harm your primary OS. You can also use VS to test how far you can push your antivirus program without risking infecting your computer.
Note that you still need to be very careful. Modern-day malware can recognize virtual environments and can try to break out. The risk is low, but not completely nonexistent.
6. Compile Multiple Servers on One PC
Lots of businesses run multiple servers. If you are involved in such a business, Virtualization makes it possible to compile different services on one device. You can create multiple virtual machines and store servers in them, without having to invest in multiple hardware systems. Running different servers on one operating system is an unnecessary security risk.
What Are the Benefits of Using VMs?
Now that you know many different uses for virtual machines, you can probably fathom how beneficial they are. But let’s take a look at some advantages that VMs can bring to your professional life and make your leisure time more enjoyable.
1. They Are Cost-effective
Since virtualization doesn’t demand multiple hardware, you won’t need to invest money in different devices. Everything you need to do, you can now do on one machine. Even if you are running multiple servers, the maintenance costs will be cut down as they are all stored on the same physical server.
2. They Are Easily Moved
Because virtual machines are stored as files on your device, you can copy them and take them with you on a USB device. You can later install them on different hardware or reassign them to a different host server.
3. They Provide Security
Because VMs are isolated virtual environments, everything you do in them will not influence your primary system. This makes them extremely safe to use. Virtual machines are very popular among those who are concerned about their security too. You can use a VM to access unreliable websites or download suspicious software.
4. They Are Perfect for Testing and Experimenting
Let’s say you used a VM to test an app to a breaking point. Your VM OS might be damaged during the test. Don’t worry, you can use such features as a snapshot or backup to return to the previous version of the OS before it was broken. This is also useful for getting rid of compromised or corrupted virtual OS.
Virtual Machine in Cloud Computing
Did you know virtual machines can be cloud-based? They were designed to replace the physical machines and still let you do anything VM would do if installed on your personal computer. There are two types of virtual machines in cloud computing: ProcessVM and System VM.
A Process VM is designed to run a single process on a host machine, in the form of an application. For example, Java Virtual Machine will allow any system to run all Java applications. It is a typical example of a Process Virtual Machine. A System VM is designed to completely replace a physical machine with a virtual one.
The advantage of cloud-based virtual machines is that your physical computer will have no access to it, and won’t try to temper with the VM. This means that the cloud computing environment is perfect for virtual machines and all the work you would do in it, be it testing malicious software, or a new unstable operating system.
The Best Virtual Machine Software
To set up a VM environment on your computer, you need special virtual machine software. Below you’ll find the most popular options.
VMWare is a comprehensive package of virtualization products. It offers Fusion for Apple Mac and WorkstationPlayer for PC. They were tailored for different host operating systems but essentially offer the same solutions. Being one of the rare virtualizing software that supports DirectX 10, it is a solid choice for those interested in GPU virtualization. VMware is free for personal use, but business users will need to invest in Pro and Fusion Pro versions.
VirtualBox supports a wide range of host and guest operating systems which makes it an excellent choice for those who want to experiment. You can create VMs with Windows XP, Windows NT, Linux 2.4, OpenSolaris, Server 2003, and even IBM OS/2. Apple users can run Mac VM sessions. But most importantly, VirtualBox is open-source and completely free of charge, even the Enterprise version developed for businesses.
Developed by Microsoft back in 2008, Hyper-V is now available for free for all Windows 10 and 11 Pro, Enterprise, and Education users. But this free version is extremely limited and doesn’t really pay off in the long run. It lacks GPU support, but you can use it to create Windows XP or later virtual environments, as well as Linux with at least 3.4 Kernel, and FreeBSD. Microsoft Hyper-V won’t perform miracles, but it is a good starting choice for beginners who want to experiment with virtualization.
Whether you’re a casual PC user or a professional, virtual machines will open a whole new world of possibilities. Use them to test a new OS you’re wondering about. Try out Linux apps that don’t work on your Windows system. Do everything you want without putting your computer at risk.
Let us know in the comments below why and how you’re using virtual machines!