Sub topic 8
Why Use a Virtual Machine on a Client PC
This chapter assumes you already know what a host, a guest, and a virtual machine (VM) are, and that you can tell a Type 1 hypervisor from a Type 2 hypervisor. It covers the reasons a technician puts a VM on a client PC, and the mistakes people make when they pick a VM for the wrong job.
The working model
A client-side VM is a guest operating system (OS) that runs inside a window on an ordinary workstation or laptop. The host OS stays in control of the hardware. The hypervisor, usually a Type 2 product such as VirtualBox, VMware Workstation, or Windows Hyper-V, gives the guest virtual hardware. That hardware includes a virtual CPU, virtual RAM, a virtual disk, and a virtual network adapter.
The guest cannot see the host's real files unless you share them on purpose. It also cannot change the host's real disk. These two properties explain almost every reason to use a client-side VM. The reasons fall into four groups: sandbox, testing, legacy software, and cross-platform use.
Sandbox use
A sandbox is an isolated environment where you can run untrusted code or open untrusted content without risking the host. A VM works well as a sandbox for these tasks:
- Opening an email attachment you do not trust.
- Running a downloaded installer to see what it does.
- Visiting a website you suspect is malicious.
- Analyzing malware, as a security analyst does.
If the guest becomes infected, you do not clean it. You discard it. Most hypervisors let you restore the guest to a saved state, or delete the guest and start again from a clean copy.
Snapshots
A snapshot is a saved copy of a VM's state at one moment. It records the disk contents and, optionally, the contents of memory. The workflow looks like this:
- Build the guest and configure it the way you want.
- Take a snapshot and give it a clear name, such as
clean-baseline. - Do the risky work.
- Revert to the snapshot, and the guest returns to the saved state.
A snapshot is not a backup. It usually depends on the original virtual disk file, so if that file is lost or damaged, the snapshot is lost too. Long chains of snapshots also slow the guest and use more disk space.
Testing
Technicians and developers use VMs to test changes before they touch a real machine. Typical cases include:
- Patches and updates. Install an OS update or a driver in a guest that matches your users' setup. If it breaks something, revert.
- New software. Check that an application installs, runs, and uninstalls cleanly.
- Configuration changes. Try a new group policy, registry change, or script on a copy.
- Training and practice. Learners can practice partitioning disks, installing an OS, or troubleshooting without any risk to a working computer.
- Multiple configurations. One host can hold many guests, each with a different OS version, browser, or software set.
Testing in a VM is cheap and fast to repeat. You can clone a guest, which creates an independent copy, and run two experiments side by side.
Legacy software and operating systems
Some organizations depend on an application that only runs on an old OS. The vendor may be gone, or the upgrade may cost too much. Running the old OS on modern hardware directly can be impossible, because the old OS may lack drivers for current hardware.
A VM solves this because the hypervisor presents simple, well-known virtual hardware that older systems can often use. The legacy application keeps working inside the guest while the host runs a current, patched OS.
There is a security cost. An unsupported OS no longer receives security updates. Reduce the risk by using a restrictive network mode (see the chapter on virtual network modes), limiting what the guest can reach, and not using the guest for general browsing.
Cross-platform use
A cross-platform VM lets one machine run an OS that differs from its host OS. Examples:
- A Linux or macOS user runs a Windows guest to use a Windows-only program.
- A Windows user runs a Linux guest to learn Linux or to use Linux command-line tools.
- A support technician keeps several OS versions on a laptop to reproduce a customer's problem.
The guest OS must be built for the same CPU architecture as the host. A VM on an x86-64 PC runs x86-64 guests well. Running an ARM guest on an x86-64 host is a different task, because it needs emulation. The emulators chapter covers that difference.
Choosing the right purpose
| Need | Why a VM fits | What to configure |
|---|---|---|
| Open a suspicious file | Isolation protects the host | Snapshot first, restrictive network, no shared folders |
| Test a patch | Revert after a failure | Match the guest to the production OS version |
| Run an old application | Old OS runs on current hardware | Isolated network, no general browsing |
| Use a different OS | Two OSes on one PC | Enough RAM and CPU cores for both |
| Practice for training | Mistakes cost nothing | Snapshot a clean install |
Common errors
Intermediate learners tend to make these mistakes:
- Treating a VM as perfectly safe. Isolation is strong but not absolute. Shared folders, a shared clipboard, drag-and-drop, and a bridged network connection all create paths between guest and host. A flaw in the hypervisor could also let malware escape, which is rare but real.
- Skipping the snapshot. People start risky work first and find they have no clean state to return to.
- Confusing snapshot with backup. A snapshot lives with the VM. A backup is a separate copy stored elsewhere.
- Forgetting the guest needs a license. A Windows guest needs its own valid Windows license, just like a physical PC.
- Starving the host. Giving the guest too much RAM or too many CPU cores slows the host and the guest. The sizing chapter covers this.
- Assuming the VM works on any PC. The CPU and firmware must support and enable hardware virtualization. The next chapter shows how to check.
- Expecting full graphics speed. A guest sees virtual graphics, so heavy 3D work or games often run poorly.
Exam angle
A+ Core 1 questions usually describe a situation and ask which tool or setup fits. Look for these keywords:
- "Test a patch without affecting production," "try risky software," or "isolate" point to a VM used as a sandbox or test environment.
- "Old application that will not run on the current OS" points to a VM running a legacy OS.
- "Run a Windows program on a Linux or macOS laptop" points to a cross-platform VM.
- "Revert to the previous state" points to a snapshot.
Check your understanding
Exercise
A technician must test a risky driver update. The test PC has one Windows 10 installation that users depend on. Which approach protects the working system, and what should the technician do before installing the driver?
Show answer
Run a Windows 10 guest in a VM on the host and install the driver there. Before installing, take a snapshot of the guest. If the driver causes problems, revert to the snapshot. The host's real installation is never touched.
Exercise
A company must keep running an application that only works on an unsupported version of Windows. Why is a VM a good choice, and what security step should you add?
Show answer
The hypervisor presents simple virtual hardware that the old OS can use, so the application runs on a modern, patched host. Because the guest no longer receives security updates, isolate it with a restrictive network mode, limit its access to other systems, and avoid general web browsing in it.
Exercise
A user says, "I took a snapshot, so I do not need to back up my VM." What is wrong with this statement?
Show answer
A snapshot depends on the VM's original virtual disk and is stored with it. If that file is lost, corrupted, or deleted, the snapshot is lost too. A backup is a separate copy kept on other storage.