VMware ESXi and vSphere Cluster Management
Install a Guest Operating System in Oracle VirtualBox
Learn how to install a guest operating system in Oracle VirtualBox by attaching an ISO, booting the VM, completing the installer, and removing the ISO afterward.
A guest operating system is an operating system running inside a virtual machine (VM). The VM is a software-defined computer with virtual processors, memory, storage, firmware, and other hardware devices.
The physical computer running VirtualBox uses a host operating system. The operating system installed inside the VM is the guest. For example, Windows can be the host operating system while Ubuntu runs as the guest operating system in VirtualBox.
Installing a guest OS is similar to installing an operating system on physical hardware: you boot from installer media, choose language and storage options, create a user account, and wait for the files to be copied. The main difference is that the installer runs against virtual hardware rather than the physical computer's hardware.
This guide assumes that you have already created a VM. For background on creating one, see the guest OS installation guide.
Guest OS installation methods
VirtualBox can provide installer media in several ways. Installer media is bootable media containing the files required to install an operating system.
Prerequisites
Before starting, confirm that the VM and its installation resources are ready. The intended guest OS determines how much memory, CPU, storage, and firmware support it needs.
Attach an ISO image when starting the VM
- Open Oracle VirtualBox Manager, the graphical interface used to create, configure, and start VirtualBox VMs.
- Select the target VM. Check that you have selected the VM intended for this installation.
- Start the VM.
- When the startup media selection prompt appears, choose the option to select a virtual optical disk file.
- Browse to the operating system's installer ISO and select it.
- Confirm the selection. VirtualBox mounts the ISO in the VM's virtual optical drive, which is the virtual hardware device that reads ISO files or physical optical discs.
The exact wording and appearance of the dialog can vary between VirtualBox versions and host operating systems. If the startup prompt does not appear, stop the VM and attach the ISO through its Storage settings instead.
Attach an ISO through Storage settings
- Power off the VM if it is running.
- Select the VM in VirtualBox Manager and open its settings.
- Open Storage.
- Select the virtual optical drive under the VM's storage controller.
- Choose the command to select or mount an optical disk file.
- Browse to the installer ISO and confirm it.
- Save the VM settings.
The Storage view should show the ISO associated with the virtual optical drive. This view is useful when troubleshooting because it confirms whether installation media is actually mounted.
Boot the VM from installation media
The VM follows its configured boot order, which is the sequence of devices checked for bootable media. If optical media is enabled and placed before the virtual hard disk, the VM can start from the attached ISO.
After startup, the VM window should display the operating system's boot menu or installer screen. From this point, the installation process is generally the same as it would be on a physical computer.
If the VM starts an existing operating system, displays a message that no bootable device exists, or immediately returns to a firmware screen, review the optical drive attachment and boot order. Firmware settings may also be relevant when the guest OS expects BIOS or UEFI booting.
Complete the operating system installer
- Choose the installation language, keyboard layout, and locale when the installer asks for them.
- Configure network settings if required. Some installers can proceed offline, while others use the network for updates or additional packages.
- Accept the operating system's license or installation terms when required.
- Create the requested user account and password. Some operating systems also ask for a computer name, time zone, or administrator account.
- When asked where to install the OS, select the VM's virtual hard disk. This is a file-backed virtual storage device presented to the guest as a disk.
- Allow the installer to partition and format the virtual disk when appropriate. Verify the target disk before accepting any destructive storage operation.
- Wait while the installer copies files, configures the boot loader, and completes setup.
- Allow the VM to reboot when prompted.
Example: install Ubuntu from an ISO
- Create or select a VM configured for an Ubuntu-compatible guest architecture.
- Obtain the appropriate Ubuntu installer ISO from an authorized Ubuntu source.
- Select the Ubuntu VM in VirtualBox Manager and start it.
- At the startup media prompt, select the Ubuntu ISO as the virtual optical media.
- Follow Ubuntu's graphical installer. Choose the language, keyboard layout, network options, time zone, and user credentials requested by the installer.
- Choose the VM's virtual hard disk as the installation destination and allow the installer to create its partitions.
- Wait for installation to finish and let the VM restart.
- Eject the ISO, restart if necessary, and sign in to the newly installed Ubuntu guest.
Installing from a physical disc
- Insert a bootable operating system installer disc into the host computer's optical drive.
- Power off the VM if it is running.
- Open the VM's Storage settings in VirtualBox Manager.
- Attach the host optical drive to the VM's virtual optical drive instead of selecting an ISO file.
- Ensure that optical booting is available in the VM's boot order.
- Start the VM and proceed through the operating system installer.
The physical disc is read through the host's drive, but the installer still installs onto the VM's virtual hard disk.
Network-based installation with PXE
PXE, or Preboot Execution Environment, allows a computer to boot and begin installation from a network server rather than from local optical media.
- Configure the VM's network adapter so it can reach the PXE environment.
- Make network boot an available option in the VM's firmware or boot order.
- Start the VM and select network boot if it is not selected automatically.
- Follow the deployment workflow supplied by the PXE server.
PXE installation requires network services such as a suitable PXE server and is usually intended for managed environments. It is not required for the ISO-based workflow in this guide.
After-installation boot behavior
When installation finishes, remove or eject the ISO from the virtual optical drive. If it remains mounted and optical media has priority in the boot order, the VM may start the installer again instead of the newly installed system.
- Shut down or pause the VM as appropriate.
- Use the VM window's removable-media controls or open Storage settings in VirtualBox Manager.
- Eject the installer ISO from the virtual optical drive.
- Restart the VM.
- Verify that the guest OS starts from the virtual hard disk and that you can sign in.
After the guest OS works, a typical next step is installing Guest Additions or the integration tools appropriate to the guest. These tools can improve features such as display resizing, mouse integration, shared clipboard support, and time synchronization.
Troubleshooting
The VM does not start the installer
- Possible cause: No ISO is attached. Fix: Check the startup media selection or the VM's Storage settings.
- Possible cause: The ISO is not bootable, is incomplete, or is not suitable for the guest architecture. Fix: Obtain a complete, compatible ISO from the operating system publisher or an authorized source.
- Possible cause: The boot order prioritizes the virtual hard disk. Fix: Enable optical booting and place it before the virtual hard disk temporarily, or use the VM's boot menu.
The VM keeps returning to the installer
- Possible cause: The ISO remains mounted. Fix: Eject or remove it from the virtual optical drive.
- Possible cause: Optical media remains ahead of the virtual hard disk. Fix: Remove the ISO and restart, or change the boot order so the virtual hard disk is selected first.
The installer cannot find a disk
- Possible cause: No virtual hard disk is attached. Fix: Open Storage settings and confirm that a virtual disk exists and is connected to the VM.
- Possible cause: The storage controller configuration is not supported by the intended guest OS. Fix: Review the VM's Storage settings and select a controller supported by that operating system.
The installer is slow or unstable
- Possible cause: The VM has insufficient memory or CPU resources. Fix: Increase the allocation within the guest OS requirements and the host's available capacity.
- Possible cause: Resource-intensive applications are using the host. Fix: Close unnecessary host applications and retry.
- Possible cause: Hardware virtualization support is unavailable or disabled. Fix: Check the host firmware and VirtualBox settings for hardware virtualization support where applicable.
Command-line note
No command-line commands are required for the core graphical workflow. Advanced users can use VirtualBox command-line tools to start VMs and manage storage attachments, but VirtualBox Manager is sufficient for selecting the VM, mounting the ISO, changing boot settings, and ejecting installation media.
Exam-relevant notes
- The host operating system runs on the physical computer; the guest operating system runs inside the VM.
- An ISO image is a disk-image file commonly used as bootable operating-system installation media.
- The virtual optical drive mounts an ISO or exposes a physical optical disc to the VM.
- The guest OS is installed onto the VM's virtual hard disk, not normally onto the host's system disk.
- If the VM boots from the virtual hard disk instead of the installer, check whether optical booting is enabled and whether the boot order is correct.
- After installation, eject the ISO so the VM boots from its virtual hard disk.