Creating and installing the VM
On this page
Halfway through the Ubuntu installer, a screen offers Erase disk and install Ubuntu. On the computer in front of you, that choice would delete Windows or macOS and every file you own. In this lesson, you choose it on purpose, and nothing of yours is lost.
By the end, you have a working Ubuntu VM, you can give the reason for each of its settings, and you can say exactly which disk “Erase disk” erased.
Before you start
Section titled “Before you start”- Downloading and verifying installation media (B02.2). You need the image you verified there,
ubuntu-24.04.5.1-desktop-amd64.isoorubuntu-24.04.5-desktop-arm64.iso. - Free disk space for a 25 GB virtual disk, with room to spare, and at least 8 GB of memory on your computer. The settings table below explains both.
- One to two hours, mostly waiting while files copy.
The steps were tested with Oracle VirtualBox 7.2.18 on a Windows host. A later 7.2 release may differ slightly in labels. The screenshots were made with the image ubuntu-24.04.4-desktop-amd64.iso; with the 24.04.5.1 image from lesson B02.2, the steps are the same.
Install VirtualBox
Section titled “Install VirtualBox”Download VirtualBox from virtualbox.org/wiki/Downloads. It offers one platform package for each kind of host:
Choose Windows hosts and run the installer. The manual supports Windows 10 and 11 on Intel and AMD processors; on Windows 11 with an ARM processor, it is an “Experimental Feature”, without Oracle support.
Choose by the processor you found in lesson B02.2: macOS / Intel hosts or macOS / Apple Silicon hosts. Open the .dmg file and double-click VirtualBox.pkg. The manual supports macOS 13 to 26.
On a Mac with Apple silicon, use the arm64 image. The manual says: “Running an x86-based guest operating system on an Arm host platform is not supported.”
Choose Linux distributions, then the package for your distribution and release. On a computer with UEFI Secure Boot, the manual says you “may need to sign” the VirtualBox kernel modules, such as vboxdrv, before they load.
You do not need the separately licensed Extension Pack; this course does not use it.
Create the VM
Section titled “Create the VM”Open VirtualBox. Its main window is the VirtualBox Manager. Click New in the toolbar.
The New Virtual Machine window opens. It is one window with four sections, and you open each one by clicking its title:
- Virtual machine name and operating system
- Set up unattended guest OS installation
- Specify virtual hardware
- Specify virtual hard disk
There is no summary page. Finish creates the VM from what the sections hold, so check every section before you click it.
Name and operating system
Section titled “Name and operating system”In the first section:
- VM Name:
rootvolt-lab. VirtualBox names the VM’s folder and files after it. - VM Folder:
D:\VMs, the folder this course uses. If your computer has no D: drive, useC:\VMs. The drive needs room for the 25 GB disk. - ISO Image: the Ubuntu image you verified.
- OS, OS Distribution, and OS Version: VirtualBox fills them from the image. Check them: Linux, Ubuntu, and Ubuntu 24.04 LTS (Noble Numbat) (64-bit).
- Proceed with Unattended Installation: untick it. The next section explains why.
Look at OS Version before you go on. VirtualBox may preselect another Ubuntu version; in testing, it chose Ubuntu 24.10 (Oracular Oriole). Open the list and select Ubuntu 24.04 LTS (Noble Numbat) (64-bit). On a Mac with Apple silicon, select the ARM 64-bit entry for Ubuntu 24.04 LTS.
Choose a VM folder whose path contains no personal name, such as your user name. The path appears in VirtualBox’s windows, so it shows up in your screenshots and in any question you post for help. On macOS and Linux, the default folder is inside your home folder, and its path contains your user name; keep that in mind before you share a screenshot.

- VM Folder is
D:\VMs: a path with no personal name in it. - OS Version is Ubuntu 24.04 LTS (Noble Numbat) (64-bit), checked by hand.
- Proceed with Unattended Installation is unticked.
rootvolt-lab is the VM’s name on the host. The guest gets its own computer name, rootvolt, in the installer: one name on each side of the boundary from lesson B02.1.
Turn off the unattended installation
Section titled “Turn off the unattended installation”The manual says: “By default, Oracle VirtualBox will install the chosen OS using the ISO image provided, if the image supports unattended installation.” Ubuntu’s image does, so Proceed with Unattended Installation is ticked as soon as you select the image. Untick it. The image then stays attached to the VM, and you install from it yourself. You can leave the Set up unattended guest OS installation section closed.
This course installs by hand for three reasons:
- An unattended installation answers every installer question for you, so you never see the disk choice, the account, or the computer name.
- On Linux guests, the manual says, “the root user will also be created with the same password” as your user. This course keeps the accounts that Ubuntu’s own installer creates; module B03 explains root.
- On a Mac with Apple silicon, unattended installation “isn’t available”. The manual path works on every host.
Choose memory, processors, and disk
Section titled “Choose memory, processors, and disk”Open Specify virtual hardware, then Specify virtual hard disk. VirtualBox suggests values for Ubuntu; set these:
| Setting | Value | Why |
|---|---|---|
| Base Memory | 4096 MB | The desktop and the installer run in it. The host loses it while the VM runs, so give at most half of the host’s memory |
| Number of CPUs | 2 | The manual says: “Do not assign more than half of the total processor threads from the host machine” |
| Use EFI | Unticked | VirtualBox uses BIOS firmware unless you turn EFI on, and nothing in this course needs EFI. On a Mac with Apple silicon, the option cannot be changed |
| Create a New Virtual Hard Disk | Selected | The installer needs an empty disk |
| Disk Size | 25 GB | Ubuntu’s install tutorial asks for at least 25 GB. The disk takes space on the host only as the guest uses it |
| VDI (VirtualBox Disk Image) | Selected | VirtualBox’s own disk image format |
| Pre-allocate Full Size | Unticked | The disk is then dynamically allocated: the file on the host grows only as the guest writes |
The manual warns: “The memory you give to the VM will not be available to your host OS while the VM is running.” If your computer has less than 8 GB, give the VM 2048 MB and expect a slower desktop; the manual notes that “a guest OS may require at least 1 or 2 GB of memory to install and boot up”.
A thread is a stream of work the processor runs at once. A processor with 4 cores and 8 threads could give the VM 4 virtual CPUs; 2 is enough here.

- Base Memory is 4096 MB.
- Number of CPUs is 2.
- Use EFI is unticked.

- Create a New Virtual Hard Disk is selected.
- The disposable virtual disk:
D:\VMs\rootvolt-lab\rootvolt-lab.vdi. This file becomes the guest’s whole disk. - Disk Size is 25.00 GB.
- Pre-allocate Full Size is unticked, so the file starts small.
Click Finish. The VM appears in the Manager’s list, powered off.
Where the virtual disk lives
Section titled “Where the virtual disk lives”The virtual disk is a file in the VM folder. With the course’s folder, it is D:\VMs\rootvolt-lab\rootvolt-lab.vdi.
If you do not change VM Folder, VirtualBox puts the VM inside VirtualBox VMs in your home folder (replace <you> with your user name on the host):
| Host | Virtual disk file |
|---|---|
| Windows | C:\Users\<you>\VirtualBox VMs\rootvolt-lab\rootvolt-lab.vdi |
| macOS | /Users/<you>/VirtualBox VMs/rootvolt-lab/rootvolt-lab.vdi |
| Linux | /home/<you>/VirtualBox VMs/rootvolt-lab/rootvolt-lab.vdi |
Next to the disk file is rootvolt-lab.vbox, the VM’s settings file.
Guess first: the guest has a 25 GB disk. How much space does rootvolt-lab.vdi take on your host now, before anything is installed?
Check your guess
Very little, far from 25 GB: in the tested VM, 2.00 MB. The manual says a dynamically allocated image “will initially be very small and not occupy any space for unused virtual disk sectors, but will grow every time a disk sector is written to for the first time”. The 25 GB is a maximum. The Storage settings below show both sizes; you check them again at the end of this lesson.
In words: the host disk holds your own files and the VM folder, where rootvolt-lab.vdi grows as the guest writes. The guest cannot see the host disk. It sees one empty 25 GB disk. The diagram is a simplified model: it leaves out the settings file and the snapshot files that lesson B02.4 adds.
That is why “Erase disk” is safe here: the installer erases the only disk it can see, the file rootvolt-lab.vdi.
Before the first start, select the VM and open its Settings, Storage. It lists two devices. Under Controller: IDE is the optical drive, a simulated CD/DVD drive holding the Ubuntu image. The manual says VirtualBox presents an ISO image “to a guest system as if it were a physical CD-ROM”. Under Controller: SATA is the virtual hard disk, rootvolt-lab.vdi. Select the disk: Virtual size is what the guest sees, and Actual size is the space the file takes now. Close the window without changes.

- The Ubuntu image in the optical drive.
- The disposable virtual disk,
rootvolt-lab.vdi. - Virtual size 25.00 GB, the most the guest can use, and Actual size 2.00 MB, the file before the installation.
Install Ubuntu
Section titled “Install Ubuntu”Select rootvolt-lab and click Start. A window shows the VM’s screen. The virtual disk is empty, so the VM starts from the optical drive and shows the image’s boot menu, titled GNU GRUB. Try or Install Ubuntu is highlighted. Press Enter, or wait: the menu starts it after a countdown.

- Try or Install Ubuntu, highlighted: press Enter.
When you click inside the VM’s window, the VM may take the keyboard and mouse. Press the Host key to give them back: the right Ctrl key, or the left Command key on a Mac. The VM window shows the current Host key at the bottom right.
The installer’s screens, as Ubuntu’s install tutorial describes them:
- Language: English, to match this course.
- Accessibility: any settings you need.
- Keyboard layout: the layout of your real keyboard.
- Internet connection: choose Use wired connection. The VM is already connected through the host; lesson B02.4 explains how.
- Install Ubuntu, not Try Ubuntu.
- Interactive installation.
- Default selection of applications.
- Third-party software: the tutorial describes it as drivers for real hardware, such as NVIDIA graphics, and more media formats. The VM has virtual hardware, so leave both options off.
- Disk setup: the screen asks “How do you want to install Ubuntu?”. Choose Erase disk and install Ubuntu. Leave Advanced features at None selected: encryption asks for a passphrase at every start.
- Create your account: see the next list.
- Time zone: your location.
- Ready to install: the window has this title, and its heading reads Review your choices. Check the disk, then click Install.

- Erase disk and install Ubuntu. It erases the guest’s only disk, the disposable virtual disk
rootvolt-lab.vdi. - Advanced features at None selected: no encryption.
On Create your account, fill in the fields in lowercase:
- Your name:
learner - Your computer’s name:
rootvolt. If the installer suggests another name, replace it. - Your username:
learner - Password: one you will remember. The installer rates the password as you type; choose one it does not mark weak.
Keep Require my password to log in ticked. Leave Use Active Directory unticked: it joins the computer to a company’s Windows domain, and the lab has none.

- Your name:
learner. - Your computer’s name:
rootvolt. - Your username:
learner. - The password rating. The test VM’s password was rated Weak password; choose one the installer does not mark weak.
- Use Active Directory is unticked.
The names give you the prompt learner@rootvolt that every terminal example in this course shows.

- Disk setup: Erase disk and Install Ubuntu.
- Installation disk:
VBOX HARDDISK sda, the disposable virtual disk. - Partitions:
sda1andsda2, both on that disk.
Guess first: the review lists the installation disk as VBOX HARDDISK sda. What is sda, and how does this line show that the installer will erase the virtual disk, not your computer’s disk?
Check your guess
sda is the name Linux gives the first disk it finds; a second disk would be sdb. VBOX HARDDISK is the model name the disk reports, and VirtualBox gives it to its virtual disks. Your computer’s own disk reports its manufacturer’s model, and it does not appear: the guest cannot see it. So “Erase disk” acts on rootvolt-lab.vdi. If you see a disk with another model name here, stop and check the VM’s Storage settings.
A partition is a part of a disk set aside for one use. The installer formats sda2 as ext4, a file system, which is the way files are organized on a partition, and uses it for /, the top of the file tree that lesson B05.1 explains. Your installed system lives there. The installer also creates sda1; it does not hold your files.
The installation takes 10 to 30 minutes. Then click Restart now. Ubuntu asks you to remove the installation medium and press Enter.
Remove the image
Section titled “Remove the image”In the VM, the installation medium is the image in the optical drive. Usually the drive is already empty: in testing, Ubuntu ejected the image itself, and VirtualBox showed the optical drive as [Optical Drive] Empty.
To check, open the Devices menu in the VM’s window, not in the VirtualBox Manager, then Optical Drives. Remove the Ubuntu image there only if it is still ticked. Then click inside the VM and press Enter.
The VM tries the optical drive before the hard disk. With the image still inserted, it would start the installer again instead of your installed system. Without it, the VM starts from its virtual disk and shows the login screen.
Check it worked
Section titled “Check it worked”The login. The login screen shows learner. Log in with your password. The welcome window’s steps are optional.

- The account
learner, which you created in the installer.
The prompt. Press Ctrl+Alt+T to open a terminal; on a Windows or Linux host, use the left Ctrl key, because the right one is the Host key. The prompt reads learner@rootvolt:~$: user learner, computer rootvolt, in your home directory. Module B03 explains the terminal.
The system. Type these four commands, pressing Enter after each:
lsb_release -duname -mfree -hlsblk -d -o NAME,SIZE,TYPEIn the tested VM, they printed:
learner@rootvolt:~$ lsb_release -dNo LSB modules are available.Description: Ubuntu 24.04.4 LTSlearner@rootvolt:~$ uname -mx86_64learner@rootvolt:~$ free -h total used free shared buff/cache availableMem: 3.8Gi 1.1Gi 1.4Gi 34Mi 1.6Gi 2.7GiSwap: 3.8Gi 0B 3.8Gilearner@rootvolt:~$ lsblk -d -o NAME,SIZE,TYPENAME SIZE TYPEloop0 4K looploop1 74M looploop2 251.7M looploop3 91.7M looploop4 531.4M looploop5 10.8M looploop6 18.5M looploop7 576K looploop8 48.1M loopsda 25G disksr0 1024M romEach command answers one question about the VM:
lsb_release -dprints the Description of the installed release. In the tested VM, it isUbuntu 24.04.4 LTS: Ubuntu 24.04 LTS with its point release, 4. The line above it,No LSB modules are available., is a notice you can ignore. With the 24.04.5.1 image, the point release differs.uname -mprints the machine’s hardware name:x86_64with the amd64 image. On a Mac with Apple silicon, the arm64 image printsaarch64.free -hshows memory in units that are easy to read (-h). The total on the Mem: line is3.8Gi: the 4096 MB of Base Memory you set, minus the part the kernel keeps for itself. The used and free values change from minute to minute.lsblklists the disks.-dleaves out the partitions on each disk, and-ochooses the columns: name, size, and type. The linesda, size25G, typedisk, is the virtual disk. Thelooplines are files that Ubuntu uses as small disks for its snap applications, andsr0, typerom, is the optical drive. Their number and sizes vary; this check needs onlysda.
If all four match, the lab is ready.
Mistakes to recognize
Section titled “Mistakes to recognize”Hardware virtualization is off in the firmware. The VM does not start. On an Intel processor, the error includes:
VT-x is disabled in the BIOS for all CPU modesOn an AMD processor:
AMD-V is disabled in the BIOS (or by the host OS)VT-x and AMD-V are Intel’s and AMD’s names for hardware virtualization, the processor features a VM needs. Some computers ship with them off in the firmware, the settings program that runs before the operating system, often called the BIOS. Restart, open the firmware settings, and turn the feature on. The way in and the setting’s name depend on the manufacturer; the computer’s manual has both.
Unattended installation left on. If Proceed with Unattended Installation stays ticked, VirtualBox installs Ubuntu without asking you anything. In testing, the result had a default account, ubuntu, instead of learner, and the optical drive held a generated image named Unattended-… instead of the Ubuntu image. Remove the VM in the VirtualBox Manager, delete its files, and create it again with the box unticked.
The installer starts again after the restart. No error appears; you see the installer’s language list instead of the login screen. The image is still in the optical drive. Do not install again: “Erase disk” would erase the system you installed. Close the VM’s window, choose Power off the machine, remove the image in Settings, Storage, and start the VM again.
Too little memory. VirtualBox shows no message; you notice the effects. A guest with too little is very slow, or does not start: the manual says, “A VM will not start if it does not have enough RAM to boot.” A host with too little “might excessively swap memory to the hard disk, which will effectively bring the host system to a standstill.” Power off the VM and change Base Memory in Settings, System.
Good to know
Section titled “Good to know”Windows, Hyper-V, and WSL 2. The manual says: “A green turtle icon indicates that a native hypervisor, such as Hyper-V, is running on the host.” The VM then runs, but slower. WSL 2 from lesson B02.1 needs one of those Windows features, Virtual Machine Platform. The manual advises turning off Hyper-V Platform, Virtual Machine Platform, and Windows Hypervisor Platform, which stops WSL 2 from working. If the VM runs well enough with the turtle, leave them on.
Macs with Apple silicon. The manual lists Ubuntu 24.04 among the guests that “might run” on Arm hosts, with limited support: Oracle does not promise to resolve problems with it. The steps are the same, with the arm64 image.
3D acceleration. Ubuntu’s 24.04 release notes say some applications, including the desktop wallpaper, “do not display correctly with VirtualBox or VMWare with 3D Acceleration”. Keep Enable 3D Acceleration off in the VM’s Display settings.
Security Angle
Section titled “Security Angle”Three VirtualBox features can open the boundary between guest and host: the shared clipboard, drag and drop, and shared folders. The manual says, “For security reasons, the shared clipboard is disabled by default”. Drag and drop is off by default too, and a shared folder exists only if you create one.
Keep all three off in the lab VM. A harmful file you study in the guest then has no path to your host’s files, and restoring a snapshot (lesson B02.4) removes what it did.
Try it yourself
Section titled “Try it yourself”Goal: Show from the host side that the guest’s disk is one file that grew during the installation.
- Shut down Ubuntu: open the menu at the top right of its screen and choose Power Off.
- On the host, find
rootvolt-lab.vdiand note its size. - In VirtualBox, open Settings, Storage for
rootvolt-lab, select the hard disk, and note its Virtual size and Actual size. - Check that the optical drive in the same window is empty.
Expected: The file is several gigabytes, far less than 25 GB; the virtual size is 25.00 GB; the actual size matches the file; the optical drive is empty.
Hint
Before the installation, the actual size was 2.00 MB. The disk is dynamically allocated. What happened to the file while the installer wrote the system?
Solution
The file holds only what the guest has written, the installed system: several gigabytes. The virtual size, 25.00 GB, is what the guest sees and the most the file can grow to.
If the optical drive still holds the image, remove it now, so the next start cannot open the installer.
- The course VM,
rootvolt-lab, runs Ubuntu 24.04 LTS in VirtualBox 7.2 with 4096 MB of memory, 2 processors, and a 25 GB dynamically allocated disk, in a folder whose path holds no personal name. - The guest’s whole disk is one file on the host,
rootvolt-lab.vdi. The installer calls itVBOX HARDDISK sda, and “Erase disk” erased only that disk. - You unticked Proceed with Unattended Installation, checked OS Version by hand, and chose the user
learnerand the computer namerootvolt. - After the installation, the image comes out of the optical drive; otherwise the VM starts the installer again.
Next, in Network modes and snapshots (B02.4), you choose how the VM reaches the network and take your first snapshot.
Further reading
Section titled “Further reading”All sources were checked on 1 November 2026, for VirtualBox 7.2. The steps were tested with VirtualBox 7.2.18.
- Oracle VirtualBox User Guide, release 7.2: Creating a New Virtual Machine, with unattended installation, memory, and processors; Installing VirtualBox, with the host packages and the Arm host limitations; Working with Virtual Machines, on starting a VM, the Host key, the green turtle, removable media, and the shared clipboard; Virtual Storage, on dynamically allocated images; Troubleshooting, on the VM folder and Hyper-V; and About Oracle VirtualBox, with the supported guests on Arm hosts.
- VirtualBox source code:
HMR3-x86.cpp, which defines the VT-x and AMD-V error messages. - Ubuntu Desktop documentation: Install Ubuntu Desktop, for 24.04 LTS, and the Ubuntu 24.04 LTS release notes, with the 3D acceleration issue.
- Ubuntu manual pages: lsb_release(1), uname(1), free(1), and lsblk(8).
- Linux kernel documentation: Linux allocated devices, which lists
/dev/sdaas the first disk of this kind. - Microsoft Learn: Manual installation steps for older versions of WSL, on the Virtual Machine Platform feature.