Install a Guest Operating System in Oracle VirtualBox
Learn how to attach an operating system ISO to an Oracle VirtualBox VM, boot the installer, install the guest OS, and troubleshoot common boot problems.
A guest operating system is an operating system installed and executed inside a virtual machine (VM). A VM is a software-defined computer created and run by VirtualBox. The physical computer's operating system is the host operating system; it runs VirtualBox and provides access to hardware resources. The operating system inside the VM is the guest.
Installing a guest OS generally follows the same workflow as installing an operating system on physical hardware: start from installation media, choose language and storage settings, create a user account, and let the installer copy files to a disk. The difference is that VirtualBox supplies virtual hardware, such as a virtual optical drive, virtual hard disk, memory, and network adapter.
If you have not created a VM yet, follow Create a virtual machine first. For background information, see What is a guest operating system? and What is a virtual machine?
Installation media and methods
VirtualBox can provide an installer to a VM in several ways. The main procedure in this lesson uses an ISO image file.
Prerequisites
- Create the target VM, or identify an existing VM that does not yet have an operating system.
- Obtain the correct bootable installer ISO for the guest operating system you intend to install.
- Confirm that the VM has enough virtual memory and a virtual hard disk with sufficient capacity for the operating system and its applications. Review VirtualBox memory management and Virtual disks if you need to adjust these resources.
- Keep the ISO accessible on the host computer. Avoid moving, renaming, or disconnecting it during installation.
- Check that the host has enough free memory and storage to run the VM. See VirtualBox system requirements for general planning guidance.
Attach an ISO when starting the VM
- Open Oracle VirtualBox Manager.
- Select the intended VM in the machine list. Confirm that it is the correct VM and that its virtual hard disk is attached.
- Click Start. If this is the VM's first boot and no startup medium is attached, VirtualBox displays a startup-media prompt.
- At the prompt, choose the option for a virtual optical disk file.
- Browse to the installer ISO on the host computer and select it.
- Confirm the selection. VirtualBox connects the ISO to the VM's virtual optical drive, which behaves like a CD/DVD drive inside the VM.
A virtual optical drive is the VM device that can read either an ISO file or a physical installer disc. You can also configure or change the ISO before starting the VM through its storage settings. For a physical disc or an additional optical device, see Add a DVD or CD-ROM drive.
Boot from the installer and install the guest OS
After the ISO is attached, VirtualBox starts the VM and presents the ISO as a boot device. Booting is the process of starting a computer or VM from a selected device or installation medium.
- Wait for the operating system installer to appear in the VM window. The first screen may offer options such as starting the installer, testing the media, or selecting an installation mode.
- Choose the option that starts the installation.
- Follow the guest operating system's own installer screens. VirtualBox provides the virtual hardware, but the operating system vendor supplies the installation workflow.
- Choose the requested language, region, keyboard layout, and time zone.
- Create the required user account and password. Some installers also ask for a computer name, license information, or privacy settings.
- When the installer asks where to install the operating system, select the VM's virtual hard disk. This is a file-backed virtual storage device presented to the guest as a disk.
- Review the disk setup carefully. If this is a new VM with no important data, the installer may be able to use the entire virtual disk. Do not select a host disk by mistake; the guest normally sees only the virtual storage assigned to it.
- Start the installation and wait while the installer partitions or formats the virtual disk and copies files.
- Allow the VM to reboot when installation finishes. The first restart may take several minutes.
Practical example: installing from an ISO
- Create or select an existing VM configured for the operating system.
- Click Start in VirtualBox Manager.
- When VirtualBox asks for startup media, select the downloaded installer ISO as the startup optical disk.
- Let the VM boot into the installer.
- Complete the installer prompts for language, keyboard, account, time zone, and disk setup.
- Choose the VM's virtual hard disk as the installation destination.
- Wait for the installation to complete and allow the VM to restart.
- Eject the ISO, then verify that the installed guest OS starts from the virtual hard disk.
Choosing a different installation source
Physical installer disc
If an ISO is unavailable, insert a bootable installer disc into the host's optical drive and attach that drive to the VM's virtual optical drive. Start the VM and choose the disc as the startup medium. The guest OS installer then runs much like it would from a physical computer.
PXE network boot
PXE allows a VM to obtain boot instructions and installation files from a network server instead of local optical media. This method is useful when an organization maintains a network deployment service. It requires a working PXE environment, suitable network connectivity, and a VM configured to attempt network boot.
After installation
- Remove or eject the installer ISO after the operating system has been installed. You can eject it from the VM's virtual optical drive or detach it through the VM's storage settings.
- Restart the VM if necessary. With the ISO removed, the VM should boot from its virtual hard disk.
- Sign in and verify that the guest OS starts normally. Test basic input, display, storage, and network functions.
- Install VirtualBox Guest Additions when supported by the guest OS. Guest Additions can improve display resizing, pointer integration, clipboard sharing, and other host-guest integrations.
- Consider taking a snapshot after the clean installation and initial configuration. A snapshot can provide a recovery point before major changes; see Take a snapshot.
Troubleshooting
The VM does not start the installer
- Check that an ISO is selected and attached to the VM's virtual optical drive.
- Confirm that the selected file is a bootable installation image and that its download completed successfully.
- Check the VM's boot order. The optical drive must be available as a boot device before the virtual hard disk if you are starting a fresh installation.
- Close and restart the VM after correcting the media or storage settings.
The selected ISO cannot be used
- Confirm that the download completed without corruption. If the operating system publisher provides a checksum, compare it with the downloaded file.
- Confirm that the ISO matches the intended operating system and CPU architecture.
- Choose a bootable installer image rather than a non-bootable disk image or an incomplete download.
- Verify that the ISO remains at the host path selected in VirtualBox and that the host can read it.
The installer cannot find a suitable disk
- Power off the VM and confirm that a virtual hard disk is attached.
- Check that the virtual disk is large enough for the chosen guest OS and its required partitions.
- Review the VM's storage controller and disk attachment settings. The hard disk controller configuration determines how the virtual disk is presented to the guest.
- Restart the installer after correcting the virtual storage configuration.
The VM returns to the installer after restarting
- Eject or detach the ISO from the virtual optical drive.
- Check that the virtual hard disk is present and ahead of the optical drive in the boot order.
- If the VM still does not boot from the disk, the operating system installation may not have completed successfully. Run the installer again or inspect its final error message.
Exam-relevant notes
- The host operating system runs VirtualBox; the guest operating system runs inside the VM.
- An ISO image is a file containing bootable installation media, while a virtual optical drive is the VM device that reads that media.
- A virtual hard disk is the normal installation destination for a guest OS.
- PXE is a network-based boot method, not a type of local ISO file.
- After installation, detach the installer media so the VM boots from its virtual hard disk.