Installing and setting up a virtual machine

Virtualization has transformed from a high-end enterprise tool into an accessible technology for everyday users. Whether you are a developer testing code, a security enthusiast sandboxing suspicious files, or someone looking to run legacy software, a virtual machine (VM) provides a private, isolated environment within your current hardware. Using a VM is an excellent way to experiment when you are comparing operating systems like Windows vs. macOS vs. Linux.

Table of Contents

  1. What is a Virtual Machine?
  2. Step 1: Choosing Your Hypervisor
  3. Step 2: System Requirements and Pre-requisites
  4. Step 3: Installation and Initial Configuration
  5. Step 4: Installing the Guest OS
  6. Step 5: Post-Installation Essentials
  7. Troubleshooting Common Issues
  8. Summary of Key Takeaways
  9. Sources

What is a Virtual Machine?

A virtual machine is a software-based computer that runs on a physical “host” machine. It mimics a physical computer’s hardware, including the CPU, memory, and storage, while remaining completely isolated from the host OS. This is made possible by a piece of software called a hypervisor.

While homeowners often explore technical setups for connectivity, as seen in our guide to setting up a home network, virtualization adds a layer of software flexibility that hardware alone cannot provide. To understand how these local VMs differ from remote server instances, you can explore the key differences between cloud computing and virtualization.

Virtual Machine ArchitectureDiagram showing the layer of Guest OS on top of a Hypervisor, which sits on physical Hardware.Physical HardwareHypervisorGuest OS (VM)

Step 1: Choosing Your Hypervisor

The first step is selecting the hypervisor. There are two primary types: Type 1 (bare-metal) and Type 2 (hosted). For personal use and desktop computers, you will use Type 2, which installs like any other application on your existing OS.

  • Oracle VM VirtualBox (Free/Open Source): The best choice for most users. It is cross-platform, supports a massive array of guest operating systems, and includes advanced features like snapshots [1].
  • VMware Workstation Player (Free for personal use): Known for having slightly better graphics performance than VirtualBox and a polished user interface.
  • Microsoft Hyper-V (Built-in to Windows Pro/Enterprise): A rigorous, high-performance option already available to Windows Pro users.
Table: Comparison of Popular Type 2 Hypervisors
HypervisorBest Use CaseKey Feature
Oracle VM VirtualBoxGeneral Purpose / Open SourceCross-platform & Snapshots
VMware WorkstationProfessional / GraphicsHigh UI polish & Performance
Microsoft Hyper-VWindows Power UsersNative Windows Integration

Step 2: System Requirements and Pre-requisites

Before installing, you must ensure your physical hardware can handle the overhead of two operating systems running simultaneously.

  1. Enable Hardware Virtualization: Most modern CPUs support this, but it is often disabled in the BIOS/UEFI. Restart your computer, enter the BIOS (usually F2, F12, or Del), and enable Intel VT-x or AMD-V [2].
  2. RAM: You need enough for the host + the guest. If you have 8GB of RAM, you can comfortably assign 2GB or 4GB to a VM.
  3. Storage: Allocate at least 25GB to 50GB of free space for the virtual hard disk.
  4. OS Image (ISO): You must download the installer for the OS you want to run. For example, download a Windows 11 ISO from Microsoft or a Ubuntu Desktop ISO from Ubuntu’s official site.

Step 3: Installation and Initial Configuration

While specific buttons vary by software, the workflow for Oracle VM VirtualBox is the industry standard.

1. Create the Virtual Machine

Open VirtualBox and click “New.” Give your VM a descriptive name. VirtualBox will often suggest the correct “Type” and “Version” based on the name you type (e.g., typing “Ubuntu” will auto-select Linux) [3].

2. Allocate RAM and CPU

Choose your Base Memory. A Windows 10/11 VM requires at least 4096MB (4GB) for smooth operation, while lightweight Linux builds can run on 2048MB (2GB). For processors, assign at least 2 virtual cores if your host has a quad-core CPU or higher.

3. Create a Virtual Hard Disk

Choose “Create a Virtual Hard Disk Now.”

  • File Type: Use VDI (VirtualBox Disk Image) unless you need compatibility with VMware, in which case choose VMDK.

  • Storage Logic: Select “Dynamically Allocated.” This means the file on your physical drive will only grow as you actually use space inside the VM, rather than taking up 50GB immediately [4].

Step 4: Installing the Guest OS

Configuring the “hardware” is only half the battle. Now you must install the software.

  1. Mount the ISO: In the VM settings, go to the Storage tab. Under the “Controller: IDE” or “Optical Drive” section, click the disc icon and select your downloaded ISO file.
  2. Boot the VM: Click “Start.” The VM will boot from the ISO just like a physical computer booting from a USB thumb drive.
  3. Follow Installer Prompts: Proceed through the standard OS installation (setting language, keyboard layout, and creating a user account).

Step 5: Post-Installation Essentials

To make the VM usable, you must install Guest Additions (VirtualBox) or Tools (VMware). Without these, the VM will be sluggish, the mouse might feel “trapped” in the window, and you won’t be able to use full-screen resolutions.

  • How to Install: While the VM is running, go to the Devices menu in the VirtualBox window and click “Insert Guest Additions CD Image.” Open the virtual drive inside the guest OS and run the installer.
  • Enable Features: Once Additions are installed, you can enable “Shared Clipboard” and “Drag and Drop” (Bidirectional) in the VM settings to move data seamlessly between your host and guest.

Troubleshooting Common Issues

  • VM is extremely slow: Check if you enabled “Nested Paging” in the Acceleration settings. Also, ensure you haven’t allocated more than 50% of your total RAM to the VM, which causes the host OS to swap memory to the disk.
  • No Internet access: By default, VMs use NAT mode, which shares your host’s connection. If this fails, try switching the Network Adapter to “Bridged Adapter” to give the VM its own IP address on your local network [5].
  • Mouse is stuck: To release your mouse from the VM window, press the “Host Key” (usually the Right Ctrl key or the Left Command key).

Summary of Key Takeaways

  • System Capabilities: Virtualization requires hardware support; ensure “Virtualization Technology” is enabled in your BIOS.
  • Resource Management: Be prescriptive with allocations. Assign 4GB RAM for Windows guests and 2GB for Linux. Always use “Dynamically Allocated” storage to save space.
  • Isolation: VMs are isolated by default, making them perfect for testing software without risking your primary system.
  • Guest Additions: Never skip installing Guest Additions/Tools; they are required for hardware acceleration and shared clipboards.

Action Plan

  1. Check BIOS settings for Virtualization support.
  2. Download Oracle VM VirtualBox and a Linux ISO (like Mint or Ubuntu) for your first test.
  3. Follow the “New VM” wizard, keeping defaults for disk type.
  4. Install the OS and immediately run the Guest Additions installer.
  5. Take a “Snapshot” of the clean installation so you can revert to it if you break something later.

Virtual machines are the ultimate playground for tech enthusiasts. By following these steps, you can safely explore new operating systems and software ecosystems with zero risk to your primary workstation.

Table: Virtual Machine Setup Quick Reference
Setup PhaseKey Requirement / Action
HardwareEnable VT-x/AMD-V in BIOS
ResourcesAssign 2-4GB RAM & Dynamic Storage
ConfigurationMount ISO file as Optical Drive
OptimizationInstall Guest Additions/Tools

Sources