Prepare yourself for a journey full of surprises and meaning, as novel and unique discoveries await you ahead.

How To Make A Virtual Machine In VirtualBox On Linux

Creating a virtual machine in VirtualBox on Linux sounds like the sort of project that requires three monitors, six terminal windows, and a suspicious quantity of coffee. Fortunately, it is much simpler than that. With a compatible computer, an operating system ISO file, and a few sensible settings, you can build a fully functioning virtual computer without repartitioning your drive or disturbing your main Linux installation.

Oracle VirtualBox is a hosted, or Type 2, hypervisor. It runs as an application on your existing Linux host and creates virtual hardware for a guest operating system. That guest can be another Linux distribution, Windows, BSD, or another supported operating system compatible with your processor architecture. The VM behaves like a separate computer, but its CPU time, memory, storage, graphics, and networking ultimately come from the host.

This guide explains how to make a virtual machine in VirtualBox on Linux using the graphical interface. It also covers resource allocation, virtual disks, network settings, Guest Additions, snapshots, common errors, and practical lessons that can save you from turning a five-minute experiment into an afternoon of troubleshooting.

What You Need Before Creating a Virtual Machine

Before clicking the shiny New button, gather the following items:

  • A 64-bit Linux host with VirtualBox installed
  • A processor with Intel VT-x or AMD-V virtualization support
  • Enough free RAM for both the host and guest systems
  • Enough free disk space for the virtual disk and snapshots
  • A bootable ISO image for the guest operating system
  • A valid license when installing a commercial operating system

VirtualBox does not include the guest operating system or its license. You must obtain the ISO image separately from the operating system’s official publisher. The VM creation workflow can attach that ISO and, when supported, use it for an automated installation.

Check Whether Hardware Virtualization Is Available

Open a terminal and run:

On an Intel system, the result may show VT-x. On an AMD system, it may show AMD-V. You can also look for the relevant CPU flags:

If neither command produces a useful result, hardware virtualization may be disabled in the computer’s BIOS or UEFI firmware. Restart the machine, enter the firmware settings, and look for an option such as Intel Virtualization Technology, VT-x, SVM Mode, or AMD-V.

Avoid running VMs from competing hypervisors at the same time. Oracle warns that simultaneous access to hardware virtualization features by different hypervisors can cause instability and, in extreme cases, crash the host.

Install VirtualBox on Linux

VirtualBox can be installed through a Linux distribution’s repositories or with a package downloaded for the appropriate distribution from Oracle. The precise package name and installation procedure vary between Debian-based, RPM-based, Arch-based, and other Linux systems.

Using your distribution’s repository is usually convenient because updates arrive through the normal package manager. Oracle’s package may provide a newer release or support features that have not yet reached a distribution repository. Use only a package intended for your Linux distribution, host architecture, and release.

After installation, verify that the command-line tools are available:

You can launch the graphical manager from the application menu or run:

Watch for Kernel Module and Secure Boot Problems

VirtualBox relies on Linux kernel modules such as vboxdrv. Depending on the distribution, the installer may need compiler tools, matching kernel headers, or a DKMS package to build modules for the active kernel.

UEFI Secure Boot can prevent unsigned VirtualBox modules from loading. Oracle’s current documentation identifies modules such as vboxdrv, vboxnetadp, vboxnetflt, and vboxpci that may need to be signed on Secure Boot systems. Follow your Linux distribution’s module-signing procedure rather than randomly disabling security settings and hoping the computer forgives you.

To see whether the main driver is loaded, use:

Download and Prepare the Operating System ISO

Download the guest operating system from its official website. For example, you might use an Ubuntu, Fedora, Debian, Oracle Linux, or Windows ISO. Confirm that the architecture matches the VM you intend to create. An x86-64 host normally runs x86 or x86-64 guests, while an Arm host is generally limited to Arm-based guests in VirtualBox.

Verify the ISO checksum when the publisher provides one. On Linux, a SHA-256 checksum can usually be calculated with:

Compare the output with the value published by the operating system vendor. A checksum mismatch may indicate a damaged, incomplete, or incorrect download. Installing from a bad ISO is a fine way to spend an hour troubleshooting a problem that was baked into the file from the beginning.

How To Create a Virtual Machine in VirtualBox on Linux

Step 1: Open the New Virtual Machine Wizard

Launch Oracle VirtualBox Manager and click New. In current VirtualBox releases, the basic interface presents the settings in a guided workflow, while Expert mode displays more controls on one page. If the expected workflow is missing, switch the VirtualBox Manager experience level to Basic.

Step 2: Name the VM and Select the ISO

Enter a descriptive name such as Ubuntu-Test, Windows-Lab, or Fedora-Development. VirtualBox often detects the operating system family and version from the VM name or selected ISO.

Choose the downloaded ISO in the ISO Image field. Confirm that the detected operating system type and version are correct. If VirtualBox cannot identify the image, select the appropriate values manually.

VirtualBox may offer an unattended installation. This option can automatically create the user account, set the hostname, install the OS, and sometimes install Guest Additions. Select Skip Unattended Installation when you want to walk through the operating system’s normal installer or need custom partitioning and package choices.

Step 3: Allocate Memory

Choose how much RAM the virtual machine can use while it is running. Memory assigned to the guest is unavailable to normal host applications until the VM stops, so generosity has limits.

Reasonable starting points include:

  • 2 GB: Lightweight Linux desktops, minimal servers, and testing utilities
  • 4 GB: Most mainstream Linux desktop installations
  • 8 GB: Heavier development environments or modern Windows guests

These are examples rather than universal requirements. Check the guest OS documentation and consider what applications will run inside it. Leave enough memory for the Linux host, browser, desktop environment, and other active programs. Oracle notes that insufficient remaining host memory can trigger heavy swapping and effectively bring the system to a standstill.

Step 4: Choose the Number of Virtual CPUs

For a typical desktop guest, start with two virtual CPUs. Four may help with software compilation, development tools, or heavier multitasking when the host has sufficient cores.

Do not assign every available logical CPU to one VM. The host needs processing capacity to run Linux, VirtualBox, storage operations, networking, and everything else you forgot was open. More virtual CPUs also do not guarantee proportionally better performance; workload, host scheduling, storage speed, and memory pressure all matter.

Step 5: Create the Virtual Hard Disk

Select Create a Virtual Hard Disk Now and choose a capacity appropriate for the guest. Practical starting points might be 30–50 GB for a Linux desktop and 64 GB or more for a Windows development VM, depending on applications and updates.

VirtualBox’s native VDI format is a sensible default when the disk will primarily be used in VirtualBox. Other formats, including VMDK and VHD, can be useful when interoperability with other virtualization platforms is important.

A dynamically allocated disk begins as a relatively small host file and grows as the guest writes data, up to its configured maximum. A fixed-size disk reserves the full amount immediately and can reduce expansion overhead, although it consumes the entire capacity on the host from day one. Dynamic allocation is generally the convenient choice for personal labs and occasional testing.

Step 6: Review and Create the VM

Review the name, ISO, memory, CPU, and storage settings. Click Finish to create the VM. It will appear in the Machines list in VirtualBox Manager, where its configuration can be adjusted before the first boot.

Recommended Settings Before the First Boot

Display

Open Settings > Display. Increase video memory when the guest will run a graphical desktop, and use the graphics controller recommended for the selected guest type. VirtualBox commonly defaults to VMSVGA for Linux guests. Three-dimensional acceleration may improve some graphical workloads, but it should be enabled only when needed and when the guest supports it.

Network

The default NAT mode is suitable for most users. It lets the guest access the internet through VirtualBox’s networking engine without exposing the VM directly to the local network. Incoming connections normally require a port-forwarding rule.

Choose Bridged Adapter when the VM should appear as a separate device on the physical network. This is useful for network testing or running a server that other local devices must reach. Bridged mode may be less predictable on some wireless networks.

Use Host-Only Adapter for communication between the host and VM without ordinary external network access. An internal network can isolate communication among selected VMs. Choose the least exposed mode that still satisfies the project.

EFI, TPM, and Boot Order

Some modern operating systems expect UEFI firmware or a virtual Trusted Platform Module. VirtualBox exposes these options under the VM’s system settings when supported by the host and guest architecture. Do not enable every advanced option merely because it exists; virtual machines also appreciate a quiet life.

Check that the optical drive containing the ISO appears before the virtual disk in the boot order for the first startup. After installation, the VM should normally boot from its virtual disk.

Install the Guest Operating System

Select the VM and click Start. VirtualBox should boot from the attached ISO and display the guest operating system installer. Proceed as you would on a physical computer:

  1. Select the language and keyboard layout.
  2. Choose the installation type.
  3. Install to the virtual disk.
  4. Create the guest user account.
  5. Configure the time zone and network options.
  6. Restart after the installer finishes.

The installer modifies only the virtual disk unless you deliberately configure advanced raw-disk access. A normal VM does not repartition the host’s physical drive.

If the VM returns to the installer after rebooting, eject the ISO through Devices > Optical Drives or remove it from the VM’s storage settings. Then restart the guest.

Install VirtualBox Guest Additions

Guest Additions are drivers and utilities installed inside the guest. They improve integration and can provide automatic display resizing, better pointer behavior, shared folders, clipboard sharing, drag and drop, seamless windows, and accelerated graphics.

With the VM running, select:

For a Linux guest, you may need compiler tools, kernel headers, and build utilities before running the installer. Mount the inserted disc, open it, and run the appropriate installation script with administrative privileges. Reboot the guest afterward.

Some Linux distributions provide Guest Additions packages in their own repositories. Distribution packages may integrate more cleanly with automatic kernel updates, while Oracle’s bundled image may more closely match the installed VirtualBox host version.

Enable Shared Clipboard and Shared Folders

After Guest Additions are installed, open the VM settings and locate General > Advanced or the corresponding Features panel. Set Shared Clipboard to Bidirectional only when two-way copying is genuinely needed. Clipboard sharing creates a convenient data path between host and guest, so leave it disabled for untrusted or security-sensitive VMs.

To configure a shared folder, open Settings > Shared Folders, add a host directory, and optionally enable automatic mounting. In a Linux guest, access may depend on membership in a group such as vboxsf. Log out or reboot after changing group membership.

Take a Snapshot Before Making Risky Changes

A snapshot records a recoverable point in the VM’s state. Take one after completing a clean installation and another before testing unfamiliar software, major upgrades, registry changes, experimental drivers, or that mysterious script copied from a forum post written in 2011.

In VirtualBox Manager, select the VM, open Snapshots, and click Take. Give the snapshot a descriptive name such as Clean Install or Before Database Upgrade. Restoring it returns the VM to the captured state, potentially discarding later changes.

Snapshots are not complete backups. They depend on the VM’s underlying files and can consume substantial storage over time. Export important VMs or copy them while fully powered off to separate storage.

Common VirtualBox Problems on Linux

VirtualBox Reports That a Kernel Driver Is Not Installed

Install the matching kernel headers and required build tools, then rebuild or reinstall the VirtualBox host modules. Reboot after a kernel update when the running kernel no longer matches the installed module.

The VM Starts With a Black Screen

Power off the VM and confirm that the correct ISO is attached. Try the recommended graphics controller, disable 3D acceleration temporarily, increase video memory, and verify that EFI is enabled only when the guest expects it.

Only 32-Bit Guest Options Appear

Hardware virtualization may be disabled in firmware, unavailable on the processor, or occupied by another hypervisor. Confirm VT-x or AMD-V support and stop other virtualization software before restarting VirtualBox.

The Guest Has No Internet Access

Check that Network Adapter 1 is enabled and attached to NAT. Restart the guest’s networking service, confirm that it received an IP address, and test whether the host itself has internet access.

The VM Is Painfully Slow

Reduce memory pressure on the host, close other VMs, move the VM to an SSD, avoid assigning excessive CPUs, and install Guest Additions. A virtual machine stored on a nearly full mechanical disk will not become enthusiastic merely because you glare at the progress bar.

Practical Experience: Lessons From Real-World VirtualBox Setups

The most useful experience-based lesson is that a balanced VM usually performs better than an oversized one. Beginners often assume that assigning nearly all available RAM and CPU cores will produce a faster guest. In practice, starving the Linux host creates swapping, interface lag, slow disk operations, and an unhappy VM. Start modestly, observe actual usage, and increase resources only when the workload demonstrates a need.

Storage location matters more than many first-time users expect. A VM that feels sluggish on a busy hard drive can become dramatically more responsive when moved to an SSD. The difference is especially noticeable during operating system updates, package installations, compilation, and Windows background maintenance. Keep generous free space on the host because dynamic disks, snapshots, logs, and saved states can quietly expand. The virtual disk may advertise 80 GB to the guest without consuming 80 GB immediately, but it is still making plans.

Snapshots are most valuable when used deliberately. A clean-install snapshot provides a reliable baseline, while a snapshot taken immediately before an experiment creates a convenient escape hatch. However, maintaining a sprawling family tree of snapshots complicates storage and makes it harder to remember which state matters. Use descriptive names, add brief notes, and delete obsolete snapshots after confirming that the VM is stable.

Guest Additions should be treated as part of the installation rather than an optional decoration. Without them, the guest may be usable but awkward: fixed display sizes, clumsy pointer capture, unavailable shared folders, and poor clipboard integration. When Guest Additions stop working after a guest kernel update, reinstalling the matching headers and rebuilding the modules is often more productive than repeatedly toggling random display settings.

Networking deserves the same “start simple” approach. NAT is the best default for ordinary web access, package downloads, and isolated application testing. Bridged networking is useful when the VM must behave like a separate computer on the LAN, but it also exposes the guest more directly. For server development, NAT with carefully selected port-forwarding rules often gives a cleaner balance between convenience and isolation.

Another reliable habit is to separate disposable test machines from important working environments. A VM used for opening suspicious files, testing unknown software, or practicing system administration should not automatically receive shared folders, bidirectional clipboard access, USB devices, or credentials copied from the host. Virtualization provides isolation, but convenience features deliberately create bridges across that isolation.

Finally, document the configuration. Record the guest version, memory, CPU count, disk capacity, network mode, snapshots, and any unusual settings. This small effort becomes extremely valuable when recreating the VM, sharing it with a colleague, or troubleshooting six months later. “I clicked something and then it worked” is not a deployment strategy, although it remains surprisingly popular.

Conclusion

Learning how to make a virtual machine in VirtualBox on Linux gives you a flexible environment for testing operating systems, developing software, practicing administration, reproducing bugs, and running applications without altering the main host installation.

The essential process is straightforward: confirm hardware virtualization support, install VirtualBox correctly, download a trustworthy ISO, create the VM, allocate sensible resources, create a virtual disk, install the guest OS, and add Guest Additions. NAT networking and a dynamically allocated VDI disk are practical defaults for most desktop users.

Once the VM is stable, take a clean snapshot and maintain a real backup for anything important. Virtual machines make experimentation safer, but they do not repeal the laws of storage failure, accidental deletion, or questionable command-line decisions.

Note: VirtualBox menus, package names, supported hosts, and installation requirements can change between releases and Linux distributions. Check the current Oracle VirtualBox documentation and your distribution’s official guidance when an interface or command differs from this guide.