Create And Manage Virtual Machines On elementary OS
Virtual machines let you run another operating system inside elementary OS without replacing your main installation. A guest system such as Ubuntu, Fedora, Windows, or a testing image runs in a controlled window, while your elementary desktop remains available for everyday work. VirtualBox is a popular choice because it provides a graphical interface, snapshots, virtual networking, shared folders, and broad guest support.
This approach is useful for testing software before installing it on your host system, learning another Linux distribution, opening applications that have no native elementary OS equivalent, or maintaining a separate environment for development. It can also reduce the risk of experimenting with unfamiliar commands on your primary installation.
The quality of the experience depends on your computer’s processor, memory, storage, and firmware settings. A modern laptop purchased in Sydney, Melbourne, or Brisbane will often handle one lightweight guest comfortably, while an older refurbished machine may need conservative settings. Keep enough free storage for both the virtual disk and snapshots, and remember that a virtual machine still needs legitimate installation media and software licences.
Preparing elementary OS For VirtualBox
Begin by updating elementary OS and restarting if the update includes a new kernel. Open Terminal and run:
sudo apt update
sudo apt upgrade
VirtualBox can usually be installed from the Ubuntu-based repositories used by elementary OS:
sudo apt install virtualbox
The package name and available version can vary between elementary OS releases. The repository version is generally the simplest option because it integrates with the distribution’s package management. Oracle also publishes a separate VirtualBox repository, but mixing packages from different sources can make kernel-module updates harder to troubleshoot. Choose one source and keep VirtualBox components on a matching version.
During installation, VirtualBox builds kernel modules that allow its virtual machines to run. If the build fails, check that the current kernel headers and compiler tools are installed:
sudo apt install build-essential linux-headers-$(uname -r)
Then run:
sudo /sbin/vboxconfig
A firmware setting called hardware virtualisation must also be enabled. It may appear as Intel VT-x, Intel Virtualisation Technology, AMD-V, or SVM Mode in the UEFI settings. The exact menu differs by manufacturer. If VirtualBox reports that hardware acceleration is unavailable, shut down the computer, enter UEFI setup, enable the relevant option, and boot elementary OS again. Secure Boot can also interfere with unsigned or locally built kernel modules, so check its status if the modules refuse to load.
Creating A Guest Operating System
Download an ISO image from the operating system’s official website and verify that it matches your computer’s architecture. For a Linux guest, select a current 64-bit desktop image unless you have a specific reason to use a smaller release. For Windows, use installation media obtained through Microsoft and plan for the required product activation. Avoid downloading random ISO files from file-sharing sites, since a modified image can compromise both the guest and host.
Open VirtualBox and select New. Give the machine a descriptive name such as “Fedora Test” or “Windows 11 Lab”. VirtualBox may identify the operating system automatically. Choose the downloaded ISO when prompted, but review the unattended installation settings if the wizard offers to create a user account automatically. Manual installation gives you more control over disk layout, language, updates, and encryption.
Memory allocation should leave enough RAM for elementary OS. A lightweight Linux guest can often start with 2 GB, while a full desktop environment may feel better with 4 GB. Windows generally needs more, particularly for current releases. Do not assign nearly all available memory to the guest: the host needs space for the desktop, browser, file manager, and background services. On a computer with 8 GB of RAM, a modest Linux VM is more practical than two large desktop guests.
Create a dynamically allocated virtual hard disk in VDI format unless you need compatibility with another hypervisor. Dynamic allocation initially uses little physical space and grows as the guest writes data. Give the guest enough capacity for updates and applications, not merely the minimum listed by its installer. Store the virtual disk on a fast SSD when possible. A VM kept on a slow external drive may boot and update noticeably more slowly, especially over a busy NBN connection while other tasks are running.
Choosing Hardware And Network Settings
Open the machine’s Settings before starting it for the first time. Under System, set the boot order so the optical drive or selected ISO is available during installation. Under Processor, begin with one or two virtual CPUs. A guest rarely becomes faster simply because every host core is assigned to it, and leaving cores available keeps elementary OS responsive. Enable nested paging and hardware virtualisation when those options are available.
The Display settings control video memory and acceleration. Allocate a reasonable amount of video memory, enable 3D acceleration only when the guest benefits from it, and test stability after changing the setting. Guest desktop effects can consume more resources than expected. If a Linux desktop appears blank or flickers, turn off 3D acceleration and test again rather than repeatedly changing several settings at once.
VirtualBox offers several network modes. NAT is the safest starting point for ordinary internet access: the guest can reach websites and updates through the host, but devices on your home network cannot normally initiate connections to it. Bridged Adapter places the VM directly on your local network, which is useful when testing a server or connecting from another machine, but it exposes the guest more broadly. Host-only Adapter creates a private connection between elementary OS and the guest, while Internal Network restricts communication to selected virtual machines.
NAT is usually suitable for a home office or a student lab in Australia, including connections delivered through the NBN. If you need to access a guest web server from another device, use bridged networking carefully and secure the service. Many household routers and internet providers use changing public addresses, so testing a service locally is simpler than attempting to expose it to the wider internet. When diagnosing connectivity, compare the guest’s IP address, DNS settings, and gateway with the selected VirtualBox network mode.
Installing Guest Additions And Sharing Files
After the operating system is installed, install Guest Additions inside the guest. In the running VM, open the Devices menu and choose Insert Guest Additions CD Image. The guest should mount a virtual disc containing the integration tools. Linux guests may need compiler packages and matching kernel headers before the installer can build its modules. Windows guests can normally run the installer from the mounted disc.
Guest Additions can provide a better display resolution, a movable mouse pointer, clipboard integration, time synchronisation, and shared folders. These conveniences depend on support in the guest operating system. If a new guest kernel breaks the display or shared-folder module, reinstall the matching Guest Additions version rather than assuming the VM’s disk is damaged.
Shared folders are convenient, but they reduce the separation between host and guest. Create a specific directory for exchange instead of sharing your entire home folder. In VirtualBox, add a folder under Settings, choose whether it is read-only, and decide whether it should mount automatically. On Linux, the guest user may need membership of the vboxsf group:
sudo usermod -aG vboxsf "$USER"
Log out and back in before testing the mount. Treat files arriving from an untrusted guest as potentially unsafe, and avoid sharing folders containing SSH keys, password stores, browser profiles, tax records, or other private material. This is especially important when handling Australian government, banking, or customer documents subject to workplace privacy rules.
The clipboard and drag-and-drop features can be disabled when they are unnecessary. A separate transfer folder with carefully selected permissions is safer than enabling every integration feature permanently. Use the virtual machine’s normal update process, too; Guest Additions do not replace security updates for the guest operating system.
Managing Snapshots, Storage, And Backups
A snapshot records the state of a virtual machine at a particular point. Take one before installing experimental packages, changing a server configuration, or testing an unfamiliar script. If the experiment goes wrong, power off the guest and restore the snapshot. Snapshots are excellent for short-term rollback, but they are not a complete backup and should not be retained indefinitely.
Long snapshot chains can increase storage use and complicate disk performance. Delete obsolete snapshots through VirtualBox’s Snapshots view and allow the merge process to finish without interrupting power. Do not manually delete VDI or VMDK files while VirtualBox still references them. If you need to move a machine, use File > Export Appliance or the clone function rather than copying files at random.
Back up important guests while they are shut down, or use an application-aware backup method inside the guest. An exported appliance can be stored on an external drive, but it may be large. Check the destination’s capacity before starting. Australian shoppers often compare portable SSD prices in AUD through local retailers, and a faster USB-C drive can make restoration much less frustrating than a cheap, slow USB stick.
Keep the host and guest clocks, disk usage, and update schedules under control. A VM that consumes all available storage can destabilise elementary OS. Reserve free space on the host, remove unused ISO files, and review virtual disks periodically. If a test machine is no longer needed, use VirtualBox’s removal option and choose whether its associated files should also be deleted.
Troubleshooting And Safe Everyday Use
A VM that will not start commonly has one of four causes: disabled hardware virtualisation, unavailable kernel modules, insufficient memory, or a damaged configuration. Read the exact error shown by VirtualBox instead of immediately reinstalling it. Check the running kernel, confirm that vboxdrv loaded, and review recent package changes. After a kernel upgrade, rebuilding the VirtualBox modules often resolves the problem.
If the guest is slow, reduce background applications in both systems before increasing virtual hardware. Two antivirus scans, a browser with many tabs, and a software update running at the same time can make even a capable computer feel unresponsive. Use a lighter desktop in the guest, allocate a fixed amount of RAM, and store the disk on the fastest available drive. VirtualBox performance is also affected by thermal throttling on thin laptops, particularly during long compilation or testing sessions.
A black screen or unusable resolution may result from a graphics-controller choice, 3D acceleration, or an incorrectly installed Guest Additions package. Power off the VM, disable 3D acceleration, increase video memory moderately, and boot again. For a Linux guest, reinstall the additions after installing the current kernel headers. Keep a known-good snapshot before trying display changes.
Use separate virtual machines for separate purposes. A disposable test guest should not contain personal documents, while a development guest can have its own source code, packages, and credentials. Shut down guests cleanly when possible, lock the host when leaving the desk, and use full-disk encryption on the elementary OS installation if the computer is portable. Scheduling long updates outside your busiest work hours, such as overnight in AEST, can help avoid competing with video calls or household internet use.
VirtualBox makes experimentation practical, but it does not create an invisible security boundary. A vulnerable guest can still access shared folders, clipboard data, network services, or mounted devices that you expose. Start with NAT, minimal integration, current updates, and snapshots used for temporary recovery. Once a basic Linux guest is working, test its network mode and shared-folder permissions before adding more capable features.
A reliable first setup is therefore simple: install the repository version of VirtualBox, enable hardware virtualisation, create one small Linux guest, install Guest Additions, and use NAT networking. After confirming that the guest boots and updates correctly, take a clean snapshot and record its settings in a note. Open Terminal now, run the update and installation commands, and create that first test machine from an official ISO.