What you need before you start

A virtual machine is a software copy of a computer that runs inside your actual computer. To create one, you need three things: a hypervisor (the software that creates and runs virtual machines), enough disk space on your computer (usually 20 to 100 gigabytes depending on what you plan to do), and an operating system file to install inside the virtual machine.

The hypervisor is the foundation. On Windows, you can use Hyper-V (built into Windows Pro and Enterprise editions, not Home). On Mac, use UTM or Parallels Desktop. On Linux, use VirtualBox or KVM. VirtualBox is free and works on all three operating systems, which is why most people starting out choose it.

You also need the operating system you want to run inside the virtual machine — usually Windows, macOS, or Linux. You can read these as ISO files (disc images) from the official sources: Microsoft for Windows, Apple for macOS, or Ubuntu or Fedora for Linux. These downloads are free.

Key Takeaways

  • read and install a hypervisor like VirtualBox first, then read an operating system ISO file from the official source.
  • When you create a new virtual machine, you assign it a portion of your computer's RAM and disk space — these resources are reserved and unavailable to your main computer while the VM runs.
  • The installation process inside the virtual machine works exactly like installing an operating system on a physical computer, using the same steps and taking 20 to 60 minutes.
  • Once installed, you can start and stop the virtual machine like any other program, and it will remember everything you saved inside it.

Installing the hypervisor software

Start by downloading VirtualBox from virtualbox.org. Click the read link for your operating system (Windows, Mac, or Linux), run the installer, and follow the prompts. On Windows and Mac, this is straightforward — accept the defaults and click through. On Linux, you may need to use your package manager instead (apt on Ubuntu, dnf on Fedora), but the VirtualBox website has specific instructions for each distribution.

Once installed, open VirtualBox. You will see an empty window with a blue "New" button in the top left. This button is how you create a virtual machine. Do not click it yet — first, read the operating system file you want to install.

Downloading the operating system file

Go to the official source for the operating system you want. For Windows 10 or 11, visit microsoft.com/software-read. For Ubuntu Linux, visit ubuntu.com/read/desktop. For macOS, open the App Store on a Mac and search for the version you want (Monterey, Ventura, Sonoma, etc.), then click "Get" — it will read to your Applications folder.

For Windows and Ubuntu, you will read an ISO file — a single large file (usually 4 to 6 gigabytes) that contains the entire operating system. Save this file somewhere you can find it, like your Downloads folder or Desktop. Do not unzip or extract it; leave it as a .iso file.

The read may take 30 minutes to an hour depending on your internet speed. While you wait, check that your computer has enough free disk space. Open your file manager, right-click on your main drive (C: on Windows, Macintosh HD on Mac), and choose Properties or Get Info. You need at least 50 gigabytes free if you are creating a Windows virtual machine, or 30 gigabytes for Linux.

Creating the virtual machine in VirtualBox

Open VirtualBox and click the blue "New" button. A dialog box will appear asking for basic information. Type a name for your virtual machine — something like "Windows 11 Test" or "Ubuntu Practice". Below that, click the folder icon next to "Machine Folder" and choose where to store the virtual machine files. Your main drive is fine.

In the "ISO Image" field, click the dropdown and select "Other". Navigate to the ISO file you downloaded and select it. VirtualBox will automatically detect the operating system type. If it does not, click the "Type" dropdown and select the correct one manually (Microsoft Windows for Windows, Linux for Ubuntu).

Click "Next". You will now set how much of your computer's resources to give the virtual machine. For "Base Memory", assign at least 4 gigabytes (4096 MB) if you have 16 gigabytes or more on your computer. If you have 8 gigabytes total, assign 2 gigabytes. For "Processors", assign 2 if your computer has 4 or more cores, or 1 if it has fewer. These numbers are not permanent — you can change them later if the virtual machine runs slowly.

Click "Next" again. You will set the disk size. For Windows, choose at least 50 gigabytes. For Linux, 20 gigabytes is usually enough. This space is reserved on your hard drive but does not use it all when ready — the virtual machine file grows as you add files inside it. Click "Finish".

Installing the operating system inside the virtual machine

VirtualBox will now show your new virtual machine in the left panel. Click it to select it, then click the green "Start" button at the top. The virtual machine will boot from the ISO file you selected, and you will see the operating system installer appear in a window.

From this point forward, the process is identical to installing an operating system on a physical computer. Follow the on-screen prompts: accept the license agreement, choose where to install (the virtual hard drive), create a user account, and set a password. This takes 20 to 60 minutes depending on the operating system and your computer's speed.

During installation, the virtual machine window may appear to freeze or show a black screen for several minutes. This is normal — the installer is working in the background. Do not close the window or restart your computer.

Once installation finishes, the virtual machine will restart automatically and boot into the operating system. You will see a login screen. Log in with the username and password you created during installation.

Starting and stopping your virtual machine

To shut down the virtual machine, use the operating system's normal shutdown process — click the power menu and select Shut Down, just as you would on a physical computer. The virtual machine window will close, and you will return to VirtualBox.

To start the virtual machine again, select it in VirtualBox and click the green "Start" button. It will boot up and remember everything you saved inside it. Your files, settings, and installed programs are all preserved, because the virtual machine's hard drive is a file on your actual computer.

If the virtual machine becomes unresponsive, you can force it to shut down by clicking the X button on the window and selecting "Power Off Machine". This is like pulling the power cord on a physical computer — it can cause data loss if you have unsaved work, so use it only as a last resort.

Adjusting performance and troubleshooting

If the virtual machine runs slowly, you can increase the resources you assigned to it. Right-click the virtual machine in VirtualBox, select "Settings", and adjust the memory and processor count. Shut down the virtual machine first, make the change, then start it again.

If the virtual machine does not recognize your mouse or keyboard properly, you may need to install VirtualBox Guest Additions. This is a small software package that improves how the virtual machine interacts with your computer. Inside the virtual machine, click the "Devices" menu at the top of the window and select "Insert Guest Additions CD Image". Follow the prompts to install it, then restart the virtual machine.

If you run out of disk space inside the virtual machine, you can expand the virtual hard drive. This requires using command-line tools or third-party software, so it is more advanced. For most people, it is easier to create a new virtual machine with a larger disk size and reinstall the operating system.

Frequently Asked Questions

Can I run a virtual machine and use my computer normally at the same time?

Yes. The virtual machine uses only the resources you assigned to it — if you gave it 4 gigabytes of RAM and 2 processor cores, your main computer still has the rest available. You can switch between the virtual machine window and other programs just like any other window. Performance depends on how much you assigned and how much your main computer has total.

What happens to files I create inside the virtual machine?

They are stored in the virtual machine's hard drive file, which lives on your actual computer. If you delete a file inside the virtual machine, it is gone. If you want to move files between your main computer and the virtual machine, you can copy and paste them, or use a shared folder (set up in VirtualBox Settings under Shared Folders).

Can I delete a virtual machine?

Yes. Right-click the virtual machine in VirtualBox and select "Remove". You can choose to keep the files or delete them. If you delete the files, all data inside the virtual machine is permanently removed. The space on your hard drive is freed up.

Do I need to restart my computer after creating a virtual machine?

No. VirtualBox runs as a normal program on your computer. You can create and run virtual machines without restarting, and you can close VirtualBox without affecting your main operating system.

Can I run the same operating system inside a virtual machine as I have on my main computer?

Yes. You can run Windows inside a virtual machine on Windows, or macOS inside a virtual machine on macOS. This is useful for testing software or keeping work separate from personal use. The virtual machine and your main computer operate independently.