Quick Links

If you've heard about virtual machines but never tried one yourself, you've probably wondered why you'd use one. Let's explore what virtual machines offer and the reasons you might find them useful.

What Is a Virtual Machine?

A virtual machine is an emulated computer system. Virtual machines rely on hypervisors (also called virtual machine monitors), which are pieces of software that handle mapping your computer's resources into virtual hardware.

As an example, VirtualBox is a popular free hypervisor. The software takes care of allocating parts of your computer's CPU, RAM, storage disk, and other components so that a virtual machine can use them to run properly. Once you use VirtualBox to install an OS onto a virtual disk, you have a fully functional virtual machine. The virtual OS thinks it's running on a real system, but the VM runs just like any other app on your computer.

Now, what's the purpose of virtual machines for everyday people? Here are some practical uses for virtual machines anyone can take advantage of.

1. Try New Operating Systems

VirtualBox List of VMs

Perhaps you've been a Windows user all your life, but you're feeling adventurous and want to check Linux out. While you have several options for running another operating system, including dual-booting, virtualization is the best way to try another OS with little risk.

You simply need to install VirtualBox (or another hypervisor), create a new VM, and attach the installation ISO for a Linux distribution. After installing Linux in the VM like you would on a real computer, you can then run Linux (the guest OS) in a window within your Windows system (the host OS) like any other program. Our guide to installing Ubuntu in VirtualBox is a great beginner walkthrough.

Don't worry about running into problems, since the virtual machine acts as a sandbox. If something goes wrong in the guest OS, such as a malware infection or corrupted setting, your host OS won't be affected.

If the VM won't boot for some reason, you can recreate the virtual machine and reinstall the OS. There's no worry of crashing your computer just because you tried an unfamiliar OS.

2. Run Old or Incompatible Software

Windows XP Login Screen in VirtualBox

Maybe you switched to using a Mac years ago and there's one Windows-only piece of software you miss. Or perhaps you need to run an ancient program that doesn't run on modern versions of Windows.

Virtual machines provide a great environment for running software that's not compatible with your current machine. As long as you have access to the program's installer file, you should have no trouble installing it on a virtual OS.

Plus, running outdated software this way is much safer because it's sandboxed inside the virtual machine. Hopefully, you don't have to run Windows XP-only software these days, but the option is there—even if you just get nostalgic for an old PC game.

If you use VirtualBox for this purpose, make sure you install the VirtualBox Guest Additions. Among other benefits, doing so allows you to run apps in seamless mode, which puts them side-by-side with apps from your host OS.

3. Develop Software for Other Platforms

Another important use for virtual machines is simplifying the workflow for testing apps and websites across multiple platforms.

For example, say you're developing a game that works on both desktop and mobile platforms. You can use emulation to test the various versions right on your computer. Instead of moving installer files back and forth to your phone and other test computers, you can emulate them.

Virtualization also lets you compile to other executable types. Even if you use a cross-platform framework, you may only be able to compile .APP files on Mac and .EXE files on Windows. Instead of dual-booting for every build, virtualization simplifies the process.

Sometimes there's no substitute for running apps on real hardware, as emulation isn't perfect. But for many uses, emulation is a convenient way to run your programs on other OSes without much hassle.

4. Handle Potential Malware Safely

A screenshot of Malwarebytes

As we've seen, one of the major benefits of a virtual machine is its isolation from your main system. This means you can take security risks in the VM that you would normally avoid.

For instance, you may want to download a program but aren't sure if the site it came from is legitimate. Or maybe you want to test your antivirus software to make sure it's up to the job—without risking an infection getting through.

Less practically, maybe you're bored and want to see what a virus does to an operating system. You could even test theories that will break your computer, like deleting Windows system folders you should never touch.

This isn't 100% safe: there's always a small chance that a piece of malware could detect it's running in a virtual environment and try to break out. While the risk is low, you shouldn't be reckless.

5. Reverse OS Changes Easily

Virtual machines allow you to explore and experiment with an operating system without fear of the consequences. This can be an interesting way to learn more about an OS or test changes you're nervous about making on your main system.

For example, you can virtualize a second copy of Windows 10 within Windows 10 and use the guest version to tinker with a Registry tweak. Maybe you want to learn some file manipulation commands in Linux without fear of accidentally screwing something up. In a VM, it's much easier to recover from a mistake than on a live system. This is largely due to snapshots: one of the best VM features that allow you to undo mistakes with little hassle.

Taking a snapshot "bookmarks" the complete state of your VM so you can restore it later. If you make a change you decide you don't want, or run into a critical problem, you don't need to reinstall the OS—rolling back to a snapshot is much faster. You could also keep multiple snapshots to switch between configurations (like Windows feature updates) that wouldn't be possible on real hardware.

VirtualBox List of Snapshots

What's more, snapshots are saved as single files. You can thus move them elsewhere on your host machine or even send them to a friend. This is also the case for the VM files in general; since everything in your VM is stored in a few files, it's easy to transfer them to another machine.

6. Create a Homelab

A "homelab" refers to running a computer in your home as a server for other machines on your network. You might use this as a central backup location, to run CCTV cameras, as a media server for home streaming, or just to learn how running a server works.

A virtual server in a VM you control is a great option for this. It doesn't come with any additional cost, unlike running a VM in the cloud (using services like Azure) or spending money on a new machine. Especially if you have a powerful computer that can handle running a VM all the time, this is an excellent way to "get a second computer" without taking up physical space.

Now you don't have to wonder why you'd ever use a virtual machine; hopefully one or more of these reasons has you excited to try one. As long as your computer has enough resources to spare for a VM, try spinning one up and see what you think.