What you're actually doing when you create a VM
Creating a virtual machine means installing software that carves out a separate, isolated space on your computer where you can run a different operating system. That software — called a hypervisor — acts like a referee between your real hardware (your processor, memory, hard drive) and the fake operating system running inside. When you create a VM, you're telling the hypervisor how much of your real computer's resources to hand over to this isolated space.
The VM itself is just a collection of files on your hard drive. One file holds the virtual hard drive, another holds the settings, another holds the memory snapshot. You can copy these files, move them, delete them, or run multiple copies at once. Nothing you do inside the VM touches your actual computer — if the VM crashes or gets infected, your real system stays safe.
Most people create VMs for one of three reasons: to test software without risking their main system, to run an older operating system that their hardware no longer supports, or to run Windows on a Mac (or vice versa) without restarting.
Key Takeaways
- You need hypervisor software (VirtualBox, VMware, or Hyper-V) installed on your computer before you can create a VM.
- Creating a VM requires an installation file for the operating system you want to run inside it, which you download from Microsoft, Apple, or Linux distributors.
- You must allocate disk space, memory, and processor cores to the VM when you create it, and these resources are reserved even when the VM is not running.
- The entire process from opening the hypervisor to having a working operating system inside usually takes 30 minutes to two hours, depending on your internet speed and hardware.
Choose and install hypervisor software
The hypervisor is the software that makes VMs possible. Your choice depends on what operating system your computer runs and what you want to do inside the VM.
VirtualBox is free, works on Windows, Mac, and Linux, and handles most common tasks. Download it from virtualbox.org, run the installer, and follow the prompts. It takes five minutes. VirtualBox is the easiest starting point if you have never created a VM before.
VMware Workstation Pro (Windows and Linux) and VMware Fusion (Mac) cost money but run VMs faster and handle demanding work better. If you are just testing software or learning, VirtualBox is enough. If you plan to run resource-heavy applications or professional work inside the VM, VMware is worth the cost.
Hyper-V comes built into Windows Pro, Enterprise, and Education editions — you do not need to download anything. Open Control Panel, go to Programs, then Programs and Features, click "Turn Windows features on or off," check the box next to Hyper-V, and restart your computer. If you have Windows Home edition, Hyper-V is not available and you must use VirtualBox or VMware.
Get the operating system installation file
You cannot create a VM without an installation file for the operating system you want to run inside it. This file is called an ISO image, and it is the same file you would use to install the operating system on a physical computer.
For Windows, go to microsoft.com/software-download and download the Windows installation media creation tool. Run it, choose "Create installation media for another PC," select your language and edition, and save the ISO file to your computer. The file is several gigabytes, so this takes 10 to 30 minutes depending on your internet speed.
For macOS, open the App Store, search for the macOS version you want, and click Get. The installer downloads automatically. You do not need to do anything else — the hypervisor will find it.
For Linux, go to the website of the distribution you want (ubuntu.com for Ubuntu, fedoraproject.org for Fedora, debian.org for Debian) and download the ISO file directly. Most distributions offer a choice between a full installer and a minimal installer. The full installer is larger but includes more software pre-installed.
Create the VM in your hypervisor
The exact steps vary slightly between hypervisors, but the process is the same: you tell the software how much disk space, memory, and processor power to give the VM, then point it to your installation file.
In VirtualBox, click the "New" button, give the VM a name, select the operating system type and version from the dropdown menus, then click Next. On the next screen, choose how much RAM to allocate — 2 to 4 gigabytes is enough for testing, 8 gigabytes if you plan to run demanding software. Click Next. Choose "Create a virtual hard disk now," click Create, then select VDI as the disk type. On the final screen, choose how much disk space to allocate — 20 to 50 gigabytes is typical — and click Create. The VM now exists, but it is empty.
In Hyper-V, right-click in the left panel and select "New" then "Virtual Machine." Name the VM, choose Generation 2 (unless you are running very old software), allocate memory on the next screen, leave networking as-is, then create a new virtual hard disk and choose its size. On the final screen, point Hyper-V to your installation ISO file and click Finish.
In VMware, click File, then New Virtual Machine, choose "Typical" setup, select your installation file, choose the operating system type, name the VM, and set the disk size. VMware asks fewer questions than VirtualBox and makes reasonable guesses about memory and processor allocation.
Install the operating system inside the VM
Once the VM exists, you start it up just like a physical computer. The hypervisor boots from your installation file and walks you through the operating system setup.
Select your VM in the hypervisor and click Start or Power On. A window opens showing the VM's screen. You see the operating system installer — the same screens you would see if you were installing on a real computer. Follow the prompts: choose your language, accept the license, select the virtual hard disk as the installation target, and wait for the files to copy. This takes 10 to 30 minutes depending on your hardware and internet speed.
When installation finishes, the VM restarts and boots into the new operating system. You may see a prompt to install "guest additions" or "VMware tools" — these are drivers that make the VM run faster and let you move your mouse smoothly between your real computer and the VM. Install them. After that, the VM is ready to use.
Allocate resources wisely to avoid slowdowns
The resources you gave the VM when you created it are reserved — your real computer cannot use them, even when the VM is shut down. If you allocated 8 gigabytes of RAM to a VM and your computer has 16 gigabytes total, only 8 gigabytes are left for your real operating system and other programs.
If your VM runs slowly, the problem is usually not enough memory or processor cores. You can change these settings after creation. In VirtualBox, right-click the VM, click Settings, and adjust the memory and processor count on the System tab. In Hyper-V, right-click the VM, click Settings, and change memory and processor allocation. In VMware, click Edit Virtual Machine Settings and adjust the same values. The VM must be powered off to change these settings.
Disk space is harder to change after creation. Most hypervisors let you expand the virtual hard disk, but it requires extra steps. It is better to allocate enough space when you create the VM — you can always delete the VM and create a new one if you guessed wrong.
Common mistakes that slow down or break VMs
The most common mistake is allocating too little memory. If you give a VM only 1 gigabyte of RAM, it will be painfully slow no matter what operating system is inside. Most modern operating systems need at least 2 gigabytes to run smoothly, and 4 gigabytes is better if you plan to run multiple programs at once.
The second mistake is allocating too much. If your computer has 16 gigabytes of RAM and you give 12 gigabytes to a VM, your real operating system has only 4 gigabytes left. Everything slows down. A good rule: give the VM half of what your computer has, or less.
The third mistake is not installing guest additions or VMware tools. These drivers let the hypervisor communicate with the VM efficiently. Without them, the mouse moves in jerky steps, the screen resolution is wrong, and the VM runs slower than it should.
The fourth mistake is creating the VM on a slow hard drive. If your computer uses a traditional spinning hard drive instead of an SSD, VMs will be slow. If you must use a spinning drive, allocate less disk space and fewer processor cores to the VM so it does not thrash the disk.
Frequently Asked Questions
Can I run a VM inside a VM?
Yes, but it is slow and rarely useful. A VM inside a VM (called nested virtualization) works, but each layer of abstraction costs performance. Most hypervisors support it, but you need to enable it in settings first. Unless you have a specific reason, avoid it.
What happens if I run out of disk space inside the VM?
The VM behaves like a real computer that is out of disk space — programs fail to save files, the operating system may become unstable, and you may not be able to shut down cleanly. You can expand the virtual hard disk after the fact, but it requires extra steps and is easier to avoid by allocating enough space upfront.
Can I move a VM to a different computer?
Yes. A VM is just a folder of files. You can copy the entire VM folder to an external drive, move it to another computer, and open it in the same hypervisor. The VM will run on the new computer as long as the hypervisor is installed and the new computer has enough resources.
Do I need to shut down the VM before I shut down my computer?
You should, but it is not required. If you shut down your real computer while a VM is running, the hypervisor saves the VM's state and resumes it when you restart. However, this is like pulling the power cord on a real computer — it can corrupt files inside the VM. Shut down the VM first, then shut down your computer.
Why is my VM so slow even though I allocated plenty of memory?
Check whether your computer's processor supports virtualization. Most modern processors do, but you may need to enable it in your BIOS settings. Restart your computer, press Delete or F2 during startup to enter BIOS, look for a setting called "Virtualization" or "VT-x," enable it, and save. If that does not help, your real computer may not have enough free resources — close other programs and try again.