How to Install Ubuntu in a Virtual Machine with VirtualBox on Windows and Linux

Table of Contents

Introduction

Setting up an Ubuntu virtual machine with VirtualBox is one of the easiest and safest ways to experiment with new Linux environments without touching the main operating system.
Whether you use Windows or Linux, a VM (Virtual Machine) allows you to test software, servers, containers, or scripts without risk: everything happens in an isolated and easily recoverable space.

In this tutorial, we’ll show you how to install Ubuntu in a virtual machine with VirtualBox, step by step, on both platforms.
We’ll start with downloading and installing VirtualBox, then downloading the official Ubuntu/Kubuntu ISO, and then fully configuring the virtual machine with Guest Additions to improve graphics, integration, and performance.

What is a virtual machine and what is it used for?

A virtual machine (VM) is a software environment that completely simulates a physical computer: a sort of “PC within a PC.”
Thanks to a program called a hypervisor—in our case, VirtualBox—it’s possible to create and manage multiple isolated operating systems within the same computer.

In practice, the main operating system (called the host) makes some of its resources (CPU, RAM, disk space, and network card) available to a virtual operating system (called the guest).
The guest operates as if it were installed on a real machine: it can boot, run programs, connect to the Internet, and interact with virtual devices.

This approach has enormous practical advantages:

  • it allows you to test software or configurations without compromising the host;
  • it allows you to try different operating systems (such as Ubuntu, Debian, or Windows Server) in parallel;
  • it is ideal for developers, makers, and system administrators who want to simulate lab environments;
  • it simplifies the creation of snapshots and backups: just one click is enough to revert to a stable version;
  • it reduces risks, because each VM is completely isolated from the main system.

In practical terms, virtual machines are perfect for:

  • experiment with technologies like Docker, Ansible, Kubernetes, or web servers;
  • test embedded software or firmware;
  • conduct demos or training courses in a controlled environment;
  • maintain clean and replicable environments, also useful in business and research settings.

In short, a virtual machine is the ideal tool for those who want to do serious experiments without causing any damage. And with VirtualBox (free, open source, and cross-platform), you can do it in minutes, on any computer.

Why it’s a good idea to use it to experiment with clean projects or environments

Using a virtual machine for your experiments is the smartest choice when you want to test software or complex configurations without risking compromising the main system.
Each VM functions as an isolated sandbox, where you can install, configure, and even break anything, without consequences.

In the real world, this means freedom: you can try a new framework, server, firmware, or potentially unstable script, and if something goes wrong, simply delete the machine or restore a snapshot.
It’s the digital equivalent of a “clean lab” where you can disassemble and reassemble everything infinitely.

A virtual machine also offers:

  • a consistent and reproducible test environment: no more “but it works on my PC”;
  • immediate backups and rollbacks thanks to VirtualBox snapshots;
  • complete separation between experiments and personal data;
  • cross-platform compatibility, because you can work on Windows, Linux, or macOS;
  • increased security, also useful for analyzing malware, suspicious firmware, or unverified scripts.

In technical and professional settings, this flexibility is crucial: you can have multiple different environments on the same computer, one for each project, each clean and controlled.
Those working in research, embedded development, automation, or DevOps can simulate networks, devices, and servers without additional hardware.

In short, a virtual machine allows you to do everything you would on a real computer, but without the risk, waste, or chaos.

Why VirtualBox is the most practical choice for developers and makers

Of all the virtualization software available, VirtualBox remains the most robust and accessible solution for those who want to create virtual machines quickly and for free.
Developed by Oracle, it is completely open source and runs on any operating system: Windows, Linux, and macOS.

For those working in development, electronics, or DevOps, VirtualBox offers two strong points: simplicity and total control.
You can configure every detail of the VM (RAM, CPU, network, GPU, USB ports) and adapt it perfectly to the needs of your testing: from a web server to a Docker container, from Raspberry Pi firmware to a complete Linux system for simulations.

Its key features make it ideal for any maker’s lab:

  • clear and intuitive interface: you can create a VM in two minutes, even without experience;
  • Guest Additions support: additional drivers that improve graphics, clipboard, folder sharing, and performance;
  • integrated snapshots: save the machine’s state and revert at any time;
  • flexible virtual network: NAT, Bridged, or Host-Only, perfect for testing communications between multiple VMs or between hosts and guests;
  • USB and serial support, extremely useful for those working with embedded devices or microcontrollers.

Additionally, VirtualBox is lightweight and stable, perfect even for older notebooks or workstations.
It requires no licensing or complex configuration, and thanks to its official Extension Packs, it can also handle advanced features like USB 3.0, RDP, and NVMe.

For those publishing technical projects or working in experimental settings, it’s the perfect tool for creating clean, replicable environments.

Introduction to VirtualBox (free, open source, cross-platform)

VirtualBox is a free, comprehensive virtualization software developed by Oracle, capable of creating and managing virtual machines (VMs) on virtually any modern operating system: Windows, Linux, macOS, and Solaris.
In other words, it’s a type 2 hypervisor, meaning a program that runs on top of the main operating system (the host) and allows you to run multiple “guest” operating systems in parallel, each with its own virtual resources.

VirtualBox has become the de facto standard for those working in technical or academic fields because it combines reliability, simplicity, and flexibility.
Unlike other proprietary software like VMware or Parallels, it imposes no artificial limits or expensive licenses: you can create as many VMs as you want, save snapshots, configure virtual networks, share folders, and even connect physical peripherals (USB, serial, external drives) within the virtual machine.

Its most important features include:

  • free and open source: the code is public, constantly updated, and supported by an active community;
  • cross-platform compatibility: you can create a VM on Linux and copy it to Windows without any problems;
  • official Extension Pack: adds support for USB 2.0/3.0, RDP, NVMe, PXE boot, and encryption;
  • Guest Additions: a set of drivers and tools that enhance the guest operating system experience (dynamic graphics, shared clipboard, mouse synchronization, shared folders);
  • snapshots and cloning: allow you to save the complete state of the VM and duplicate it in seconds.

From a technical standpoint, VirtualBox uses hardware virtualization technologies (Intel VT-x or AMD-V) to ensure near-native performance, making it perfect for testing Docker, Ansible, web servers, or embedded applications.
The interface is clean and intuitive, but behind the scenes, it offers granular control over every parameter: memory, CPU, storage, network, 3D acceleration, BIOS/UEFI, boot order, serial ports, and much more.

In short, VirtualBox is the most versatile tool for creating professional testing environments without investing in hardware or licenses.

Tutorial Objective: Installing an Ubuntu VM on Windows and Linux Step-by-Step

In this article, we’ll get straight to the point: creating and configuring a complete Ubuntu virtual machine using VirtualBox, on both Windows and Linux.
The goal isn’t just to start Ubuntu in a window, but to build a stable, high-performance, and reusable environment for all your future projects.

The procedure will be explained step by step, without taking anything for granted, but without getting bogged down in trivialities either.
We’ll see how:

  1. install VirtualBox on your system (Windows or Linux);
  2. download the official Ubuntu or Kubuntu ISO and prepare it for installation;
  3. create the virtual machine by selecting the correct CPU, RAM, disk, and network;
  4. install the guest operating system (Ubuntu) within VirtualBox;
  5. add Guest Additions, essential for optimal performance and integration;
  6. optimize the VM to make it run smoothly and ready to host development tools like Docker, Ansible, or web servers.

At the end of the tutorial you will have a fully functional Ubuntu virtual machine, capable of:

  • run scripts, containers, and network tests as if it were a real server;
  • share files and folders with the host system;
  • automatically resize to your screen resolution;
  • save snapshots and restore them in seconds.

The result will be a professional, ready-to-use Linux sandbox that can be cloned or exported to any machine.

Minimum hardware requirements

To properly run an Ubuntu virtual machine with VirtualBox, you need adequate resources, because you’re essentially running two operating systems simultaneously: the main system (host) and the virtual system (guest).
Here are the minimum and recommended requirements for a smooth and stable experience.

Minimum requirements

  • CPU: 64-bit processor with hardware virtualization support
    (Intel VT-x or AMD-V must be enabled in BIOS/UEFI).
  • RAM: at least 4 GB total (2 GB to dedicate to the virtual machine).
  • Disk: at least 25 GB free on the host disk.
  • GPU: any graphics card compatible with VirtualBox 2D/3D acceleration.
  • Host Operating System:
    • Windows 10 / 11 (64 bit)
    • Ubuntu 20.04 LTS or higher (22.04 LTS or 24.04 LTS recommended)
    • Fedora 38+, Debian 12+, openSUSE Leap 15+, Zorin OS, elementary OS

With these values ​​the VM will work, but it will be more suitable for light testing or basic test environments.

Recommended requirements (for demanding use)

  • CPU: quad-core processor or better (Intel i5/i7, Ryzen 5/7).
  • RAM: at least 8GB total, with 4GB allocated to the VM.
  • SSD: At least 50 GB free SSD, preferably in dynamic VDI ​​format.
  • GPU: active 3D acceleration support (settable in VirtualBox options).
  • Network: stable connection, useful for downloading Ubuntu updates and packages.

Important technical notes

  • Hardware virtualization: if VirtualBox displays boot errors, go to the BIOS/UEFI and make sure Intel VT-x or AMD-V is enabled.
  • Aggressive antivirus or security software can interfere with VirtualBox on Windows (especially with network drivers and the hypervisor).
  • SSDs are highly recommended: they dramatically reduce boot and installation times.
  • If your system has 16 GB of RAM or more, you can allocate up to 6 GB of RAM to the VM, achieving near-native performance.

In short, to work comfortably with Ubuntu in VirtualBox, you need a modern host machine, but not necessarily a high-end one.
VirtualBox is lightweight and optimized: with a decent laptop, you can manage multiple VMs simultaneously, take snapshots, test Docker containers, or simulate an entire virtual network without any additional hardware.

Download and install VirtualBox on Windows

Download from the official Oracle website

The safest way to install VirtualBox on Windows is to download it directly from the official Oracle website, avoiding third-party sites or unverified repositories.

Open your browser and go to https://www.virtualbox.org/wiki/Downloads

In the “platform packages” section you will find the package for Windows hosts.
Download the .exe file and, if you want to take advantage of additional features like USB 3.0, NVMe, and encryption, also download the Extension Pack (it’s a .vbox-extpack file). Always install the Extension Pack corresponding to your version of VirtualBox.

Tip: always download the latest version, but if you need compatibility with older VMs, you can check out the archive of previous versions at this link. https://www.virtualbox.org/wiki/Download_Old_Builds.

Guided installation and recommended options

Run the downloaded file (VirtualBox-x.x.x-win.exe).
The installation wizard will open, divided into a few clear steps:

  1. components to install: leave all default options selected (main program, network drivers, USB support, etc.);
  2. installation path: you can leave the proposed one (C:\Program Files\Oracle\VirtualBox), unless you have specific needs;
  3. networking: during installation, the VirtualBox NDIS6 Bridged Networking Driver will be installed. This allows VMs to connect to the network as if they were real PCs;
    • you may see a message warning about a temporary network disconnection: this is normal, don’t worry;
  4. driver Installation: Windows may ask you to install Oracle-signed drivers; always accept;
  5. once finished, leave the “Start Oracle VM VirtualBox after installation” box checked to start it immediately.

Recommended option: install the Extension Pack immediately by double-clicking the .vbox-extpack file you downloaded previously.
VirtualBox will open and ask you to accept the license. Confirm with “Install.”

Any compatibility or antivirus issues

On some Windows configurations, VirtualBox may conflict with other software that uses virtualization features or low-level network drivers.
Here are the most common cases:

  • Hyper-V is enabled: Windows 10/11 often enables it automatically. Disable it if VirtualBox reports boot errors. You can do this from the command prompt (run as administrator): dism.exe /Online /Disable-Feature:Microsoft-Hyper-V;
  • antivirus software is too restrictive: some security software (e.g., Avast, BitDefender, McAfee) can block virtual network drivers. If this happens, temporarily disable protection or add VirtualBox to your exclusions;
  • unsigned drivers or S mode: Windows 11 in “S mode” does not allow the installation of non-Microsoft drivers. If you are in this mode, you must switch to standard mode.

Restart your PC after making the change.

After installation, open VirtualBox and create an empty test VM just to verify that the software starts correctly and that the network is working. This is the quickest way to immediately identify any incompatibilities.

Download and install VirtualBox on Linux

Installation on Ubuntu (and derived)

On Ubuntu, Kubuntu, Linux Mint and Debian derived, installing VirtualBox is simple and happens directly from the official repositories.

Testing for this article was conducted on Ubuntu 24.04.3.

Open the terminal and update the package list:

sudo apt update

Then install VirtualBox with:

sudo apt install virtualbox

This command will install the version provided in your distribution’s repositories, which is usually stable and tested.

After installation, add your user to the vboxusers group to access USB devices and share folders:

sudo usermod -aG vboxusers $USER

Reboot or log out for the changes to take effect.

Tip: also download the Extension Pack from the Oracle website and install it with:

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.x.vbox-extpack

You will be asked to accept the license; confirm with y.

IMPORTANT NOTE
When installing the VirtualBox Extension Pack, always make sure the package version exactly matches the VirtualBox version installed on your system.
The VirtualBox versions distributed in Linux repositories (Ubuntu, Fedora, etc.) may not match those available on the Oracle website, and even a minor release difference (e.g., 7.0.x vs. 7.2.x) can cause errors such as:

undefined symbol: _ZNK9RTCString8endsWithEPKc

In practice:

  • if you use VirtualBox installed from your distribution’s repositories, download the Extension Pack of the same version (e.g. VirtualBox 7.0.14 → Extension Pack 7.0.14);
  • If you download VirtualBox from the Oracle website, always use the Extension Pack corresponding to the Oracle version (e.g. 7.2.x).

General rule valid over time:
VirtualBox and its Extension Pack must always have the same version number.
If they don’t match, remove the installed version and reinstall both (program + Extension Pack) from the same channel.

To check the installed VirtualBox version, run the shell command:

VBoxManage -v

Installation on Fedora (and derived)

On Fedora, openSUSE Tumbleweed, or RPM-based distributions, VirtualBox is not included by default for licensing reasons, but installation is just as simple.

Testing for this article was conducted on a Fedora 43.

Install the basic packages:

sudo dnf -y install @development-tools dkms elfutils-libelf-devel
sudo dnf -y install kernel-devel-$(uname -r) || sudo dnf -y install kernel-devel
sudo dnf -y install kernel-headers

These packages are used to compile the kernel modules needed for VirtualBox. Now go to the Oracle Download page https://www.virtualbox.org/wiki/Linux_Downloads and download the version for Fedora 40/41/42/43 (at the time of writing, it’s at https://download.virtualbox.org/virtualbox/7.2.4/VirtualBox-7.2-7.2.4_170995_fedora40-1.x86_64.rpm)

In the folder where you downloaded the rpm package, run the following command to install it:

sudo dnf install -y VirtualBox-7.2-7.2.4_170995_fedora40-1.x86_64.rpm

Load kernel modules:

sudo /sbin/vboxconfig

Practical tip: even on Fedora, it’s a good idea to add your user to the vboxusers group:

sudo usermod -aG vboxusers $USER

Check the version:

VBoxManage -v

Also on the Oracle Downloads page (https://www.virtualbox.org/wiki/Downloads) download the VirtualBox Extension Pack (for the version of VirtualBox we are using, it is the VirtualBox 7.2.4 Extension Pack). At the time of writing, it can be found at the link https://download.virtualbox.org/virtualbox/7.2.4/Oracle_VirtualBox_Extension_Pack-7.2.4.vbox-extpack

In the folder where you downloaded the VirtualBox Extension Pack, run the following command to install it:

sudo VBoxManage extpack install Oracle_VirtualBox_Extension_Pack-7.2.4.vbox-extpack 

and check the correct installation with the command:

VBoxManage list extpacks

which should give you an output like this:

Extension Packs: 1 
Pack no. 0: Oracle VirtualBox Extension Pack 
Version: 7.2.4 
Revision: 170995 
Edition: 
Description: Oracle Cloud Infrastructure integration, VirtualBox RDP, PXE ROM, Disk Encryption, full VM encryption. 
VRDE Module: VBoxVRDP 
Crypto Module: VBoxPuelCrypto 
Usable: true 
Why unusable:

If everything went well, launching VirtualBox will give you a screen like the following:

VirtualBox 7.2.4 installed on Fedora 43
VirtualBox 7.2.4 installed on Fedora 43

To check if the Extension Packs have been installed correctly, press the Extensions button (circled in red in the image below):

Extension Packs successfully installed on VirtualBox 7.2.4
Extension Packs successfully installed on VirtualBox 7.2.4

In both cases, Ubuntu or Fedora, once the installation is complete you can verify that VirtualBox is operational by running:

virtualbox --help

If the command responds without errors, your installation is complete.
You now have a complete hypervisor, ready to host your Ubuntu virtual machine or any other operating system you want to test.

Download Ubuntu (ISO)

Before creating the virtual machine, you need to obtain the image of the operating system you want to install, i.e., the ISO file.
This is a disk image that contains everything you need to boot and install Ubuntu (or a variant like Kubuntu) in VirtualBox.

Official link to the Ubuntu / Kubuntu ISO

ISO images should always be downloaded only from official sites, never from unverified portals or forums.
Ubuntu and its derivatives offer stable official repositories, with SHA256 checksums to verify their integrity.

Clicking the link will redirect you to the latest LTS download page (e.g., Ubuntu 24.04 LTS “Noble Numbat”).
The file will have a name similar to:

ubuntu-24.04-desktop-amd64.iso
kubuntu-24.04-desktop-amd64.iso

Verifying the integrity of the ISO file on Linux

After downloading, always verify the integrity of the ISO file to avoid installation problems.
Open the terminal in the folder where you saved the image and compare the SHA256 hash published on the official website:

sha256sum ubuntu-24.04-desktop-amd64.iso

Verify the integrity of the ISO file on Windows

Checking the integrity of the ISO is equally important on Windows: it helps ensure that the downloaded file is not corrupted or altered.
There’s no need to install third-party software: Windows already includes a dedicated command, certutil.

Open the Command Prompt (cmd) in the folder where you saved the ISO image and type:

certutil -hashfile ubuntu-24.04-desktop-amd64.iso SHA256

You’ll get a long hash, similar to this:

SHA256 hash of ubuntu-24.04-desktop-amd64.iso:
3c5fa8a2b1f6a8cfbf9f1f65d2a6b3e2c62f20e8a91cbb4b876dbf34c38a7f58
CertUtil: -hashfile command completed successfully.

Compare the value with the one published on the official Ubuntu website, in the Checksums section.
If the two codes match, the file is intact and ready for use.

Verifying the hash isn’t a formality: it prevents faulty installations or ISOs compromised by partial downloads. It’s always worthwhile, especially with large files like Ubuntu images.

Differences between Ubuntu and Kubuntu

Both distributions share the same Linux base and software packages, but differ in their desktop environment and therefore in their user experience:

DistributionGraphic environmentStyle and philosophyResource consumptionSuitable for
UbuntuGNOMEMinimalist, modern, productivity-orientedMedium-highServers, workstations, developers
KubuntuKDE PlasmaRefined aesthetics, highly customizableMediumDesktop users, makers, power users

Ubuntu offers a more streamlined interface, perfect for those looking for a development system or local server.
Kubuntu, on the other hand, relies on KDE Plasma, an elegant and lightweight environment with a more Windows-like approach in terms of ergonomics and layout.

For users coming from Windows, Kubuntu may be more familiar and intuitive, while Ubuntu is better suited for those who frequently work from a terminal or are looking for the more “official” version supported by Canonical.

Advice on LTS vs. Intermediate Releases

Ubuntu releases two types of versions:

  • LTS (Long Term Support): Long-term support (5 years).
  • Intermediate: Semi-annual releases with only 9 months of support.

For virtual machine use, the LTS versions are definitely preferable, because they offer stability, constant security updates and guaranteed compatibility with VirtualBox and Guest Additions.

Version typeExampleSupportSuitable for
LTS22.04 “Jammy Jellyfish”, 24.04 “Noble Numbat”5 yearsAll uses: testing, development, virtual servers
Intermediate23.10 “Mantic Minotaur”9 monthsOnly temporary tests or new features

LTS releases receive longer updates and maintain compatibility between later releases, making them perfect for virtual labs or development environments that you want to reuse for years to come without having to reinstall everything.

If you need to create a stable environment to test Docker, Ansible, or embedded software, always use an LTS.
Interim releases only make sense if you need to test very recent features or packages not yet integrated into the LTS repositories.

Create a new virtual machine

Once VirtualBox is installed and the Ubuntu or Kubuntu ISO is downloaded, it’s time to create the actual virtual machine.
In this phase, we’ll define the resources to be allocated (CPU, RAM, disk, storage type) and prepare the environment for installing the operating system.
All the steps described refer to VirtualBox 7.0.x (October 2025), but the logic remains the same for previous versions.

Opening VirtualBox → “New”

Launch Oracle VM VirtualBox – the main dashboard will open.

VirtualBox Home Screen
VirtualBox Home Screen


To create a new virtual machine, click on:

“New”

The wizard starts here.
VirtualBox 7 introduces a “simplified” mode that allows you to automatically create a complete VM from an ISO file, without any manual steps.
However, for full control over resources and settings, I recommend using the classic mode (“Expert Mode”), which can be selected at the bottom of the creation window.

Choose name, type and version

In the first screen define:

  • Name: choose a clear name, such as Ubuntu_24_04_LTS or Kubuntu_Test_VM. The name will also be used to create the working directory (~/VirtualBox VMs/Ubuntu_24_04_LTS/);
  • Folder: you can leave the default or select a directory dedicated to your TechRM projects (e.g., D:\VMs_TechRM\ on Windows or /home/<user>/VMs/ on Linux);
  • Type: select Linux;
  • Version: choose Ubuntu (64-bit) or, if you’re installing Kubuntu, Ubuntu (64-bit). The graphical environment does not change the system base.
Choice of name, type, version
Choice of name, type, version

VirtualBox automatically detects the optimal configuration, but you can later modify it based on your host’s hardware.

If the “Ubuntu (64-bit)” option is not available, it means that hardware virtualization (VT-x/AMD-V) is not enabled in the BIOS/UEFI.
Enter the BIOS and enable it (usually found under “Advanced → CPU Configuration → Virtualization Technology”).

RAM, CPU, and Virtual Disk Configuration

RAM memory

Allocate enough RAM to ensure smooth performance:

  • minimum: 2048 MB (2 GB)
  • recommended: 4096 MB (4 GB)
  • ideal for development: 6144 MB or more (if the host has at least 16 GB)

VirtualBox displays a bar with three colors:

  • green = safe
  • orange = heavy but acceptable use
  • red = risk of host instability

Always stay in the green or first section of orange.

CPU

Click Settings → System → Processor.
Assign 2 cores as a base, 4 cores if your processor has at least 8 physical cores.
Enable “Enable PAE/NX” and, if available, “Enable VT-x/AMD-V hardware acceleration” (should be on by default).

Avoid assigning all cores within the VM: leave at least a couple of cores free on the host, otherwise you will notice global slowdowns.

Setting up RAM and CPUs
Setting up RAM and CPUs

Virtual disk

The virtual disk will contain the VM’s operating system and data.
During creation, VirtualBox will ask you if:

  • create a new virtual disk,
  • use an existing one, or
  • don’t add one at all (useful only for advanced installations).

Select “Create a new virtual disk now” and set the initial size:

  • minimum: 25 GB
  • recommended: 40–50 GB (for updates, packages, and testing).

Choose storage type (VDI, VHD, dynamic or fixed)

VirtualBox offers three main disk file formats:

FormatExtensionCompatibilityRecommended use
VDI.vdiNative VirtualBoxBest choice for general use
VHD.vhdCompatible with Hyper-V, QEMUIf you need to migrate VMs between different environments
VMDK.vmdkCompatible with VMwareOnly if you plan to export to VMware

For most users (and for this tutorial), choose VDI: it’s the native format, lightweight, and well integrated with snapshots.

Dynamic allocation vs. fixed size

  • dynamic: the file grows as data is written. More flexible, takes up less space initially.
  • fixed: the file immediately occupies the entire specified size (e.g., 40 GB). Slightly better performance, but less space efficient.

Choose dynamic VDI ​​99% of the time. It’s the best solution for testing, development, and virtual labs. Hard drives only make sense in production environments or if you want consistent performance on slow SSDs.

Importing the virtual disk
Importing the virtual disk
Virtual Machine features summary
Virtual Machine features summary

Once the process is complete, your virtual machine will appear in the main VirtualBox list.

Virtual machine in list
Virtual machine in list

It hasn’t booted yet, but the basic structure is ready: CPU, RAM, and virtual disk configured.
In the next step, we’ll mount the Ubuntu ISO and proceed with the actual installation of the operating system.

Mount the ISO image and start the installation

Now that the virtual machine is configured, we can mount the Ubuntu or Kubuntu ISO image and proceed with the actual operating system installation.
This is where the VM will finally behave like a physical computer, booting from the “virtual CD” containing the Ubuntu installer.

Selecting the downloaded Ubuntu ISO

From the VirtualBox main window, select your VM (e.g., Ubuntu_24_04_LTS) and click “Settings → Storage.”
You’ll see two main options:

  • the SATA controller (where the VM’s virtual disk resides);
  • the IDE or Optical controller, currently empty.
  1. Click the blank optical disk icon.
  2. In the “Attributes → Optical Disc” section, click the disc icon on the right and choose “Choose a disc file…”.
  3. Select the ISO file you downloaded.

📍 Typical paths:

  • on Windows:
    C:\Users\<user>\Downloads\ubuntu-24.04-desktop-amd64.iso
  • on Linux:
    /home/<user>/Downloaded/ubuntu-24.04-desktop-amd64.iso

Image selection (Choose a disk file item)
Image selection (Choose a disk file item)

Once selected, you’ll see the ISO attached as a virtual optical drive. Click OK to save.

Selected image
Selected image

You can also boot the VM and, when VirtualBox asks “Select a boot file,” choose the ISO directly from there. This is useful if you want to skip the manual step in the settings.

Ubuntu Boot and Installation Wizard

Now start the VM by clicking “Start” (green icon).
VirtualBox will boot the system from the ISO, just as if you were inserting a DVD into a real PC’s DVD drive.
After a few seconds, the Ubuntu start menu will appear:

  • Try Ubuntu (Try Ubuntu without install it)
  • Install Ubuntu

Choose “Install Ubuntu” and press Enter.

The Ubiquity installer (or Calamares, in the case of Kubuntu 24.04 LTS) will guide you through the entire process with a modern, simplified interface.
During the boot process, you may see brief black screens or loading logs: this is normal.

Language selection, keyboard layout, automatic partitioning

  1. Language:
    Select English for the interface and layout. You can change the language later, but it’s best to set it now.
  2. Keyboard layout:
    Choose English → English.
    Press “Detect Layout” if you want an automatic check.
  3. Installation type:
    Select “Normal Installation” (including browsers, editors, and basic tools).
    Avoid “Minimal Install” if you plan to use the VM for Docker/Ansible development or testing.
  4. Updates and third-party software. Select the items:
    • Download updates during installation
    • Install graphics and Wi-Fi software (proprietary drivers)
      Both options speed up post-installation setup.
  5. Partitioning:
    Choose “Erase disk and install Ubuntu”.
    Don’t worry: this only affects the VM’s virtual disk, not your actual system.
    VirtualBox completely isolates the VM disk, so there is no risk to the host.

Select language
Select language

Keyboard selection
Keyboard selection

Click Install Ubuntu to make the installation permanent.
Click Install Ubuntu to make the installation permanent.
Choose your network connection (LAN or WiFi)
Choose your network connection (LAN or WiFi)
Choose the interactive installation
Choose the interactive installation
Choose extended installation to install useful packages without having to install them later
Choose extended installation to install useful packages without having to install them later
Install third-party packages to have a complete system
Install third-party packages to have a complete system
Allow the installer to manage the disk to erase it and install Ubuntu (it will erase the virtual disk, not your PC's disk!)
Allow the installer to manage the disk to erase it and install Ubuntu (it will erase the virtual disk, not your PC’s disk!)

Username and password creation

The installer will ask you to set:

  • Username
  • Computer name (hostname)
  • Password

Example:

Name: John
Computer name: ubuntu-vm
User name: john
Password: ************

Tip: if you plan to use this VM as a base for other projects (e.g. Docker, FastAPI backend, etc.), use a neutral username like dev or labuser, so the machine stays “clean” and replicable.

Leave the “Log in automatically” option enabled only if you’re using the VM in a secure local environment. Otherwise, use password-protected access.

Entering personal information
Entering personal information

First boot of the VM

After the installation is complete (10–15 minutes on SSD), the installer will ask you to reboot the virtual machine.
Click “Restart Now”.

During the reboot, VirtualBox will show you a message like this:

“Please remove the installation medium and press Enter”

You don’t need to do anything complicated:

  1. close the message window or press Enter;
  2. VirtualBox automatically removes the ISO from the virtual drive (if it doesn’t, go to Devices → Optical Drives → Remove disc from virtual drive).

Upon reboot, the VM will start from the virtual disk containing the installation you just completed:
you will see the Ubuntu or Kubuntu login screen, ready for use.

Once logged in, the operating system will appear:

The Ubuntu Desktop
The Ubuntu Desktop

Final check:
if the system boots correctly and you can move the mouse within the window, the installation is complete. At this point, it’s a good idea to immediately install the Guest Additions to improve graphics, clipboard performance, and performance.

Installing Guest Additions

After installing Ubuntu, the VM is fully operational, but without some essential features:
you can’t freely resize the window, copy and paste text between host and guest, or share folders. To enable all this, you need the Guest Additions.

What they are and why they are useful

Guest Additions are a set of drivers and utilities developed by Oracle to improve integration between the virtual machine (guest) and the real computer (host).

In practice:

  • improve graphics and mouse performance (automatic pointer synchronization);
  • allow dynamic screen resizing;
  • enable shared clipboard (copy/paste between host and guest);
  • allow mounting shared folders for easy file exchange;
  • optimize audio and video drivers;
  • enable bidirectional drag-and-drop.

Without Guest Additions, Ubuntu in the VM behaves like a PC “disconnected” from the host. With them, it becomes a fluid and productive environment, almost indistinguishable from a native installation.

Installation procedure

(menu “Devices → Insert Guest Additions CD Image”)

  1. Start the Ubuntu or Kubuntu virtual machine.
    Wait for the desktop to fully load.
  2. From the VirtualBox top menu, click on:
    Devices → Insert Guest Additions CD Image
  3. VirtualBox will automatically mount a virtual CD inside the VM.
    You will see a disk-like icon on your desktop with the name VBox_GAs_7.0.x.
  4. Open the terminal and navigate to the mounted directory: cd /media/$USER/VBox_GAs_7.0*
  5. Run the installation script with administrative privileges: sudo ./VBoxLinuxAdditions.run
  6. Wait for the kernel modules to compile and install (a log will be displayed). If you see no errors, the installation was successful.
  7. Once finished, restart the VM: sudo reboot

Possible “kernel headers not found” error. If this occurs, install the kernel development packages:

sudo apt install build-essential dkms linux-headers-$(uname -r)
sudo ./VBoxLinuxAdditions.run

Then repeat the procedure.

Kubuntu difference:
the KDE graphical installer may ask if you want to “Run software from disk.” If so, simply click “Run” and enter your administrator password.

The icon of the CD-ROM containing the Guest Additions appears on the left bar.
The icon of the CD-ROM containing the Guest Additions appears on the left bar.

Enable folder sharing, clipboard, and dynamic resizing

After rebooting, the VM supports new features that must be enabled manually:

Shared clipboard

  • go to VM Settings → General → Advanced
  • set Shared Clipboard = Bidirectional
    (to copy/paste text in both directions)

Drag & Drop

  • in the same section, set Drag and Drop = Bidirectional
    (works with small/medium sized files)

Shared Folders

  1. VM Settings → Shared Folders → + (Add Folder)
  2. select a host folder, e.g.:
    • Windows: C:\Users\<user>\Documents\VM_Shared
    • Linux: /home/<user>/Shared
  3. check the options:
    • Automount
    • Make permanent
  4. start the VM and verify that it is mounted under: /media/sf_<folder_name>

If you don’t have access to the folder, add the user to the vboxsf group:

sudo usermod -aG vboxsf $USER

Then log out or restart the VM.

Dynamic screen scaling

  • Go to the View menu → Automatic screen scaling (enabled by default).
  • You can now freely drag the window edges: the guest desktop resolution will adapt in real time.

Final Test: Resizable Screen and Host–Guest Copy/Paste

Verify that everything is working correctly with a quick practical test:

  1. resize the VM window → the Ubuntu desktop should automatically adjust;
  2. copy some text from the host (Ctrl+C) and paste it into the VM’s terminal or browser (Ctrl+V);
  3. drag a small file (e.g., .txt) from the host into the VM window → it should appear in the guest’s home folder;
  4. open the shared folder (/media/sf_<folder_name>) and verify that it contains the host’s files;

If everything works, your Guest Additions installation is complete.
Now you have an Ubuntu virtual machine perfectly integrated with the real system, ready to work productively: dynamic display, shared files, synchronized clipboard and significantly improved graphics performance.

Final tip:
create a snapshot immediately after this step. This will allow you to restore the “clean but optimized” VM at any time, before installing software or experimenting with configurations.

Optimize the VM

Once Ubuntu and the Guest Additions are installed, the virtual machine is ready for use.
However, with some targeted settings you can achieve significantly higher performance, reduce graphics latency, and speed up I/O and networking.
VirtualBox 7 lets you customize every aspect of your VM: CPU, GPU, network, snapshots, and backups.
Let’s see how to take your VM to the “professional” level.

Recommended settings: Multi-CPU, 3D acceleration, “Bridged” or “NAT” network

CPU and memory

Open Settings → System → Processor:

  • assign 2 cores if the host has a quad-core CPU;
  • assign 4 cores if the host has at least 8 physical cores (e.g., Ryzen 7 or i7);
  • leave at least 2 cores free for the host, otherwise the entire system will be affected;
  • enable PAE/NX and ensure hardware virtualization (VT-x/AMD-V) is enabled;

Tip: if you plan to compile code or use Docker, 4 cores are ideal. If you’re using the VM for light testing (browser, scripts, configurations), 2 cores is sufficient.

3D graphics acceleration

Go to Settings → Display → Display and enable:

  • Enable 3D acceleration
  • Set Video Memory to at least 128 MB (256 MB is better on modern systems)

This allows the Ubuntu or Kubuntu interface (GNOME or KDE) to run smoothly, avoiding lag or tearing. Hardware acceleration is fully compatible with recent GPUs (Intel Xe, AMD RDNA, Nvidia RTX).

Note: if you experience graphical glitches, temporarily disable 3D acceleration, restart the VM, and test. Some host drivers (especially Nvidia on Windows) can interfere with OpenGL acceleration.

“NAT” vs “Bridged” Network

Open Settings → Network → Adapter 1.

ModeDescriptionRecommended use
NAT (Network Address Translation)The VM accesses the Internet via the host’s IP. Easy, secure, predefined.Perfect for personal use or local testing.
Bridged Adapter (Adapter with bridge)The VM gets a direct IP address on the local network, visible as a real device.Ideal for server development, SSH testing, or web services.

In practice:

  • if you just want to browse or download packages, leave NAT.
  • if you need to access the VM from another PC or test network services, use Bridged.

You can also enable a second adapter in NAT and the first in Bridged, to combine flexibility and direct access.

Snapshot to save intermediate states

Snapshots are one of VirtualBox’s superpowers. They allow you to save the entire state of the machine—disk, RAM, and settings—at a precise moment and restore it in seconds.

Create a snapshot

With the VM off (or on, but be careful):

  1. select the VM → Machine → Create Snapshot;
  2. give it a clear name, e.g.;
  3. post-GuestAdditions or VM-Ubuntu24.04-Clean-Base;
  4. (optional) add a description with recent changes.

Restore a snapshot

  • go to Machine → Manage → Snapshots;
  • select the desired snapshot and click Restore;
  • VirtualBox will restore the machine to its original state, including files and configurations.

Tip:
create snapshots after every important milestone (e.g., “basic installation,” “Docker configuration,” “final setup”). If you make a mistake, you can revert within seconds and continue from there.

Performance alert

The more snapshots you accumulate, the more disk space VirtualBox will use, because each snapshot only saves incremental changes. Consolidate them every now and then or delete obsolete ones from File → Virtual Media Manager → Snapshots.

VM Backup and Cloning

It’s very important to have a well-configured VM, especially if you’re using it as a base for future projects. VirtualBox offers several methods for backing up or cloning a machine.

Direct cloning

  1. select VM → Machine → Clone;
  2. choose between:
    • Full clone: ​​independent copy, disk included;
    • Linked cloning: Shares the base disk, takes up less space but is dependent on the original VM;
  3. give it a new name, e.g. Ubuntu24_DevClone.

This is the fastest way to duplicate an already configured VM and reuse it in other projects (e.g. create a “Docker-ready” or “Test-Ansible” version).

Manual backup

You can also save the VM as a complete archive:

  • on Windows:
    compress the folder C:\Users\<user>\VirtualBox VMs\<VM_name>
  • on Linux:
    archive /home/<user>/VirtualBox VMs/<VM_name> using tar or rsync.

Example:

tar czf Ubuntu24_Backup_2025-10.tar.gz ~/VirtualBox\ VMs/Ubuntu_24_04_LTS

Cloud or network backup

You can also save backups to:

  • an external hard drive (USB-C SSD);
  • a local NAS;
  • or a cloud service (e.g., Google Drive, Dropbox, Syncthing).

Tip:
the cleanest method is to power off the VM before each backup or clone. Avoid open snapshots or suspended VMs: you may end up with inconsistent files.

In short, optimizing a virtual machine means transforming it from a sandbox into a professional work tool:
more CPUs, well-configured networking, smooth graphics, and intelligent snapshots make your environment stable, performant, and replicable.

Conclusions

Process summary

In this article, we’ve seen how to create, step by step, a fully functional Ubuntu virtual machine on VirtualBox, both in Windows and Linux.
The journey was thorough but linear, and now you have an isolated Linux operating system, ready for any kind of technical experiment.

We started by downloading VirtualBox from the official Oracle website, then installed the software and configured a new VM, defining the CPU, RAM, and virtual disk.
Next, we:

  • mounted the official Ubuntu or Kubuntu ISO image;
  • completed the guided installation of the operating system;
  • installed Guest Additions for optimal performance and integration;
  • optimized the VM by enabling 3D acceleration, properly configured networking, and security snapshots;
  • finally, we learned how to clone and backup your machine, so you never lose a stable environment.

The end result is a professional, isolated, and restorable Linux sandbox—perfect for development, testing, and experimentation.

Benefits of working in VMs for testing and development

Working in a virtual machine is not just a matter of convenience: it is a precise technical strategy to ensure stability, control, and reproducibility.
In the world of hardware/software development, research, or prototyping, the benefits are concrete and measurable:

Isolation and safety

Each VM is a completely separate environment: you can test unstable software, experimental drivers, or network servers without risking damaging the host.
If something goes wrong, simply restore a snapshot or recreate the VM in minutes.

Consistency between environments

With a virtual machine, you can ensure that every experiment starts from the same conditions: same operating system, same libraries, same initial state.
This eliminates the classic “it works on my PC” scenario and makes it easier to document and share technical results or tutorials.

Extreme flexibility

In a VM you can:

  • install multiple operating systems in parallel;
  • test different network configurations;
  • simulate server environments, Docker containers, or cloud services;
  • even emulate embedded devices by connecting serial or USB ports.

All this without modifying the host and without the need for dedicated hardware.

Instant recovery and versioning

With snapshots and clones, every state of the machine becomes a “version” of your lab. You can go back, fork experiments, and create alternative environments.
It’s a precise, reproducible engineering approach, the opposite of the chaos typical of direct testing on real hardware.

Performance and portability

VirtualBox 7 takes full advantage of hardware acceleration (VT-x/AMD-V), modern GPUs, and SSDs. On a recent laptop, an Ubuntu VM booted from an SSD is almost indistinguishable from a natively installed system.
And with just a few files, you can move it to another PC or remote server, continuing where you left off.

In short:
a virtual machine isn’t a “geek toy,” but a professional, controlled, and replicable lab environment.
It’s the safest way to experiment, test, and develop, while keeping your main system clean and stable.

Attachments and resources

After completing the installation and optimization of the virtual machine, it is useful to have a summary of the official links and the main commands.

Links to VirtualBox, Ubuntu and Kubuntu

All the following links point to official sites, thus ensuring integrity, security, and consistent updates over time.

ResourceDescriptionOfficial link
VirtualBoxDownload the software for Windows, Linux, and macOS. Includes the core package and the Extension Pack.https://www.virtualbox.org/wiki/Downloads
VirtualBox documentationOfficial manual (in English) with details on networking, storage and CLI automation (VBoxManage).https://www.virtualbox.org/manual/UserManual.html
Ubuntu DesktopDownload LTS and intermediate releases. SHA256 hash verification available in the Checksums section.https://ubuntu.com/download/desktop
KubuntuVersion with KDE Plasma environment, closer to the Windows experience.https://kubuntu.org/download/
Verify ISO checksumOfficial Ubuntu guide to verifying image integrity.https://help.ubuntu.com/community/HowToSHA256SUM

Tip: always download LTS releases (e.g. Ubuntu 24.04 LTS “Noble Numbat”) and keep the ISOs in a dedicated folder, so you can reuse them for multiple VMs or future tests without having to redownload them.

Newsletter

If you want to be informed about the release of new articles, subscribe to the newsletter. Before subscribing to the newsletter read the page Privacy Policy (UE)

If you want to unsubscribe from the newsletter, click on the link that you will find in the newsletter email.

Enter your name
Enter your email

🔗 Follow us on our social channels so you don’t miss any updates!

📢 Join our Telegram channel to receive real-time updates.

🐦 Follow us on Twitter to always stay informed about our news.

Thank you for being part of our TechRM community! 🚀

0 0 votes
Article Rating
guest
0 Comments
Oldest
Newest Most Voted
Scroll to Top
0
Would love your thoughts, please comment.x