Curious Minds

Clear answers to science and history questions

How to Set Up a VM: Step-by-Step Guide

· 7 min read · Science

Setting up a virtual machine (VM) lets you run a complete operating system inside a window on your existing computer, without altering your main setup. This is useful for testing software, trying out Linux, developing in isolated environments, or running legacy applications. The process involves enabling hardware virtualization, installing a hypervisor, creating a VM, and installing a guest OS. Before you begin, ensure your computer supports virtualization (most modern CPUs do) and that it is enabled in the BIOS/UEFI. You will also need installation media for the guest OS, such as an ISO file, and enough free disk space and RAM to allocate to the VM.

What You'll Need

  • A computer with a 64-bit processor that supports hardware virtualization (Intel VT-x or AMD-V).
  • Virtualization enabled in the BIOS/UEFI firmware settings.
  • At least 8 GB of RAM on the host (16 GB or more recommended for comfortable use).
  • Sufficient free disk space: plan for at least 20–40 GB per VM, depending on the guest OS.
  • A hypervisor: VirtualBox (free, cross-platform), VMware Workstation Player (free for personal use), or Hyper-V (built into Windows Pro/Enterprise).
  • An ISO image of the operating system you want to install (e.g., Ubuntu, Windows, Fedora).
  • Administrator rights on the host machine to install software and change firmware settings.

Step-by-Step

  1. Check virtualization support. On Windows, open Task Manager, go to the Performance tab, and look for “Virtualization: Enabled.” On Linux, run egrep -c '(vmx|svm)' /proc/cpuinfo in a terminal; a result greater than zero means support is present. On macOS, virtualization is generally available on Intel and Apple silicon Macs, but hypervisor choice differs (e.g., Parallels, VMware Fusion, or UTM).
  2. Enable virtualization in firmware. If it is disabled, restart your computer and enter the BIOS/UEFI setup (usually by pressing Del, F2, F10, or Esc during boot). Look for settings labelled “Intel Virtualization Technology,” “VT-x,” “AMD-V,” or “SVM Mode” and set them to Enabled. Save and exit.
  3. Download and install a hypervisor. For most users, VirtualBox is the simplest free option. Download the installer from the official website, run it, and follow the on-screen prompts. On Windows, you may see a warning about network interfaces; allow the installation. On macOS, you may need to approve the system extension in Security & Privacy settings. VMware Workstation Player and Hyper-V are alternatives; Hyper-V must be enabled via “Turn Windows features on or off.”
  4. Download the guest OS ISO. Obtain the ISO from the official source (e.g., ubuntu.com, microsoft.com). Verify its integrity if checksums are provided. Save it to a folder you can easily find.
  5. Create a new VM. Open your hypervisor and choose “New” or “Create Virtual Machine.” Give the VM a name, select the guest OS type and version, and allocate memory (RAM). A safe starting point is 2–4 GB for a lightweight Linux distro and 4–8 GB for Windows. Do not allocate more than half of your host’s physical RAM.
  6. Create a virtual hard disk. Choose “Create a virtual hard disk now.” Select VDI (VirtualBox Disk Image) or VMDK (VMware) as the format. Choose “Dynamically allocated” so the file grows only as needed, or “Fixed size” for slightly better performance. Set the disk size (20–40 GB is typical).
  7. Attach the ISO. In the VM settings, go to Storage (VirtualBox) or CD/DVD (VMware) and mount the ISO file as a virtual optical drive. Ensure the “Live CD/DVD” option is checked if available.
  8. Adjust settings (optional but recommended). Enable EFI if the guest OS supports it (most modern OSes do). Set the network adapter to NAT for simple internet access, or Bridged if you need the VM to appear as a separate device on your LAN. Enable shared clipboard and drag-and-drop for convenience.
  9. Start the VM and install the guest OS. Click “Start.” The VM will boot from the ISO. Follow the installer prompts: choose language, keyboard, disk partitioning (use the entire virtual disk), and create a user account. The installation may take 15–45 minutes depending on the OS and host speed.
  10. Install guest additions or tools. After installation, install VirtualBox Guest Additions or VMware Tools from the hypervisor’s menu. This improves display resolution, mouse integration, and shared folders. On Linux guests, you may need to install build-essential and kernel headers first.
  11. Test and snapshot. Once the guest OS is running, test internet access, shared folders, and clipboard. Take a snapshot (VirtualBox: Machine > Take Snapshot; VMware: VM > Snapshot) so you can revert to a clean state if something breaks later.

Common Mistakes

  • Forgetting to enable virtualization in BIOS/UEFI. This is the most frequent cause of “VT-x is not available” errors. Check firmware settings first.
  • Allocating too much RAM or disk space. Overcommitting host resources can slow down both host and guest. Leave at least 2–4 GB for the host OS.
  • Not installing guest additions/tools. Without them, the VM may run at low resolution and lack seamless mouse and clipboard integration.
  • Using a 32-bit guest on a 64-bit host without enabling PAE/NX. Most hypervisors handle this, but older configurations may require manual tweaks.
  • Ignoring snapshots. Skipping snapshots means you cannot easily undo a broken update or configuration change.
  • Mounting the ISO incorrectly. If the VM boots to a “no bootable medium” error, the ISO is not attached or the boot order is wrong.

Tips

  • Use dynamically allocated disks to save space, but consider fixed-size disks for VMs you use daily, as they can be slightly faster.
  • Name your VMs clearly and store them in a dedicated folder to avoid clutter.
  • Enable shared folders for easy file transfer between host and guest, but be aware of security implications.
  • Keep your hypervisor updated; updates often include performance and security fixes.
  • For Windows guests, consider disabling Windows Update automatic restarts or using snapshots before major updates.
  • If you plan to run multiple VMs, monitor host RAM and CPU usage to avoid bottlenecks.

Troubleshooting

  • “VT-x/AMD-V is not available” error. Ensure virtualization is enabled in BIOS/UEFI. On Windows, check that Hyper-V is not conflicting (Hyper-V can block VirtualBox; disable it if you use VirtualBox).
  • VM boots to a black screen or “no bootable medium.” Verify the ISO is attached and the boot order prioritizes the optical drive. Re-attach the ISO if necessary.
  • Guest OS runs very slowly. Increase allocated RAM and CPU cores (within host limits), install guest additions, and ensure the host is not overloaded.
  • No internet in the guest. Check the network adapter settings: NAT usually works out of the box; Bridged may require selecting the correct host interface. In the guest, ensure DHCP is enabled.
  • Shared folders not visible. Install guest additions, then add the folder via the hypervisor’s settings and mount it manually in the guest (e.g., sudo mount -t vboxsf sharename /mnt/share on Linux).
  • USB devices not recognized. Install the VirtualBox Extension Pack (for VirtualBox) and enable USB controllers in VM settings. On Linux hosts, add your user to the vboxusers group.

Frequently Asked Questions

Do I need a separate Windows license for a Windows VM?

Yes, a Windows guest requires its own valid license. Activation rules vary; retail licenses can sometimes be transferred, but OEM licenses are typically tied to the original hardware.

Can I run a VM on a computer with 4 GB of RAM?

It is possible but not recommended. The host needs at least 2 GB, leaving little for the VM. A lightweight Linux guest might run with 1–2 GB, but performance will be limited.

What is the difference between NAT and Bridged networking?

NAT lets the VM share the host’s IP address for outbound connections, which is simple and secure. Bridged gives the VM its own IP on the physical network, making it accessible to other devices, but requires more configuration.

Can I move a VM to another computer?

Yes. Export the VM as an OVA/OVF file (or copy the VM folder) and import it on the new host, provided the hypervisor versions are compatible. Snapshots may not transfer cleanly, so export after shutting down.

Is it safe to use a VM for online banking?

A VM is not inherently more secure than a well-maintained host. If the guest OS is unpatched or the hypervisor has vulnerabilities, risks exist. Use VMs for isolation, but keep all systems updated and avoid sharing sensitive data unnecessarily.

Why does my VM show a different time zone?

VMs often default to UTC. Install guest additions and enable time synchronization, or set the time zone manually in the guest OS.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions