VMware ESXi and vSphere Cluster Management

Oracle VirtualBox: Beginner Course for Creating and Managing Virtual Machines

Learn Oracle VirtualBox from the beginning: install it, create VMs, install Windows or Linux guests, manage disks and snapshots, configure networking, and troubleshoot common problems.

Course overview

Oracle VirtualBox is a desktop virtualization application. It lets you create and run software-defined computers called virtual machines (VMs) on a physical computer. This course covers installation, guest operating systems, virtual hardware, storage, networking, snapshots, command-line administration, security, and troubleshooting.

You should be comfortable using a Windows, macOS, or Linux desktop, installing software, managing files and folders, checking disk space, and understanding basic networking terms such as IP address, router, DNS, and Internet connection.

1. Virtualization fundamentals

Core terms

  • Physical host: The real computer providing processor, memory, storage, networking, graphics, and USB hardware.
  • Host operating system: Windows, macOS, or Linux installed directly on the physical computer.
  • Virtual machine: A software-defined computer with virtual hardware, configuration files, and one or more virtual disks.
  • Guest operating system: The operating system installed inside a VM, such as a Linux distribution or Windows.
  • Hypervisor: Software that creates and manages VMs. VirtualBox is a Type 2, or desktop, hypervisor.
  • Virtual hardware: Devices presented to the guest, including virtual CPUs, RAM, a chipset, firmware, storage controllers, disks, network adapters, display hardware, audio, and USB controllers.
  • Virtual disk: A host file that behaves like a hard drive inside the guest.
  • ISO image: A file containing the contents of optical installation media. An ISO is installation media, not an installed VM.

A Type 2 hypervisor runs as an application on a host operating system. A bare-metal, or Type 1, hypervisor runs directly on server hardware and normally provides a dedicated virtualization platform. VirtualBox is convenient for desktops, laboratories, development, and education; bare-metal products are more common for large server environments.

Why use a VM?

  • Test software without changing the main operating system.
  • Learn Linux, Windows administration, networking, and security in a repeatable lab.
  • Run several operating systems on one computer.
  • Separate experimental applications from everyday work.
  • Create a disposable test environment using snapshots or clones.

Resources are shared with the host. A VM receives assigned CPU cores and RAM, consumes storage through virtual disk files, uses a virtual network adapter, shares graphics processing through configured display features, and can access USB devices only when you explicitly pass them through. Assigning too many resources to a VM can make the host slow or unresponsive.

2. Plan the host before installation

Check hardware and storage

  • Confirm that the host platform is supported by the VirtualBox release you intend to install.
  • Check free disk space. The host needs room for the VirtualBox installation, guest operating systems, updates, snapshots, clones, and temporary files.
  • Check installed RAM. Leave enough memory for the host and other applications.
  • Check processor capability and whether hardware virtualization is available.
  • Choose a VM folder on a fast drive with sufficient capacity. A secondary SSD is often useful for several large VMs.

Intel processors commonly expose hardware virtualization as VT-x; AMD processors commonly expose it as AMD-V. The setting is controlled in BIOS or UEFI firmware and may be named Intel Virtualization Technology, SVM, Secure Virtual Machine, or a similar term.

If VirtualBox reports that hardware virtualization is unavailable, check firmware first. Also review host hypervisor features and security virtualization features that may already control the processor virtualization capability. On some systems, Hyper-V-related components, virtualization-based security, or another hypervisor can affect how VirtualBox accesses hardware acceleration. Change such settings only when you understand their effect, then restart the host.

Starting resource guidelines

Guest workload | RAM starting point | CPU starting point | Virtual disk starting point | Notes

Light Linux desktop | 2–4 GB | 2 cores | 25–40 GB | Reduce graphics effects on modest hosts.

Linux server lab | 1–2 GB | 1–2 cores | 10–25 GB | Increase resources for databases or graphical tools.

Windows test desktop | 4–8 GB | 2–4 cores | 64 GB or more | Check the selected Windows version's requirements and licensing.

Small two-machine lab | 1–4 GB per guest | 1–2 cores per guest | 15–40 GB per guest | Leave memory and CPU capacity for the host.

3. Download and install VirtualBox

  1. Visit the official Oracle VirtualBox download location and select the installer for the host operating system.
  2. Check the downloaded file name and release version. Avoid unofficial mirrors or modified installers.
  3. Run the installer with an administrator account when requested.
  4. Review the installation features. Networking components may briefly interrupt network connectivity while they are installed. File associations can make VM definition files and appliance files easier to open from the desktop.
  5. Accept administrative prompts and allow driver installation when appropriate.
  6. Restart the host if the installer or operating system requests it.
  7. Open VirtualBox Manager and use its version information to confirm that installation completed successfully.

The optional Extension Pack adds selected features such as enhanced USB support and other capabilities. Its version should match the installed VirtualBox release. Install it only from a trusted official source and review the license and feature requirements before using it.

4. Understand VirtualBox Manager

VirtualBox Manager is the main graphical administration console. The machine list shows registered VMs. The toolbar provides actions such as creating, starting, pausing, and discarding machines. The details area shows assigned hardware, storage, network adapters, and other configuration. The settings dialog changes virtual hardware and integration features. Logs help diagnose boot, storage, networking, and acceleration failures. Virtual Media Manager reviews virtual disks and optical media, including media that is currently unattached.

  • Create: Build a new VM definition and optionally create a new virtual disk.
  • Register: Add an existing VM definition to the machine list after its files have been moved or copied correctly.
  • Import appliance: Bring in an OVF/OVA package created by an export operation.
  • Add existing machine: Open an existing VM definition file rather than creating a new one.

Global Preferences control defaults that apply beyond one VM, including the default machine folder, input behavior, language, network definitions, and extensions.

State | Meaning

Powered off | The guest is stopped and can normally have all settings changed.

Running | The guest is executing; many hardware settings are locked.

Paused | Execution is temporarily suspended; assigned resources remain reserved.

Saved | The VM memory state was written to disk so it can resume later.

Aborted | The VM stopped unexpectedly or was forcibly terminated; inspect logs and guest files.

5. Create a virtual machine

  1. Select New, then choose a descriptive name and a destination folder with enough space.
  2. Select the guest operating-system family and version. This helps VirtualBox choose sensible defaults.
  3. Assign RAM conservatively. Do not allocate most of the host's memory to one guest.
  4. Assign a reasonable number of virtual processors. More cores do not automatically mean better performance.
  5. Choose BIOS or enable EFI/UEFI when the guest requires modern firmware. EFI is the modern firmware interface used by many current operating systems.
  6. Create a virtual hard disk now or plan to attach one later.
  7. Review storage controllers, display, network, audio, USB, and shared-feature settings before the first boot.

Virtual disk provisioning and formats

Option | How host storage is consumed | Advantages | Limitations | Best use case

VDI, dynamically allocated | Grows as guest data is added | Efficient initial use of space; native VirtualBox format | Host must have room for future growth; may need compaction | Normal VirtualBox labs

VDI, fixed-size | Reserves the configured capacity at creation | Predictable allocation and sometimes consistent performance | Creation takes longer and immediately consumes the full size | Dedicated fast storage with known capacity

VHD | Uses dynamic or fixed provisioning supported by the format | Useful when compatibility with Microsoft virtualization tools matters | Feature behavior can vary between products | Cross-platform or Microsoft-oriented workflows

VMDK | Uses provisioning supported by the format | Useful when compatibility with VMware tools matters | Portability does not guarantee identical features | Interoperability with VMware environments

A dynamically allocated disk can still consume its maximum configured capacity over time. A fixed-size disk reserves that capacity immediately. Choose VDI for ordinary VirtualBox work unless portability requirements suggest VHD or VMDK.

6. Install a guest operating system

  1. Obtain a legitimate ISO from the operating-system publisher.
  2. Open the VM's storage settings and attach the ISO to its virtual optical drive.
  3. Check the boot order so the optical drive is available before the empty virtual disk.
  4. Start the VM and follow the guest installer.
  5. When the installer asks for a disk, select the VM's virtual disk. Partitioning here affects the virtual disk, not the host's physical partitions.
  6. Create appropriate user accounts, apply licensing requirements, install updates, and use strong passwords.
  7. After installation finishes, eject or detach the ISO. Otherwise the VM may boot into the installer again.
  8. Restart and confirm that the guest boots from its installed virtual disk.

Windows guests require suitable licensing and may require specific firmware, memory, storage, or security settings. Linux guests usually offer a wide range of desktop and server installation choices. In either case, install guest-specific drivers or integration components when supported, then apply updates.

7. Configure virtual hardware and integration

System, display, and storage

  • System: Adjust boot order, chipset, RAM, CPU count, execution cap, EFI, and acceleration. An execution cap limits the percentage of host CPU time available to the VM.
  • Display: Configure video memory, graphics controller, monitor count, scaling, and optional 3D acceleration. Guest drivers must support some advanced display features.
  • Storage: Add storage controllers, attach or detach virtual disks, and mount or eject ISO files in optical drives.
  • Other devices: Configure audio, USB controllers, serial ports, and selected virtual peripherals.

Power off the VM completely before changing settings that affect its virtual motherboard, CPU, RAM, firmware, controllers, or attached storage. Some display and integration settings can be changed while running, but changing them while powered off is safer.

Guest Additions

Guest Additions are guest-side components that improve communication between VirtualBox and a supported guest. From the running VM window, choose the VirtualBox menu option to insert the Guest Additions image, run the installer inside the guest, and reboot the guest when prompted.

Depending on guest support and enabled settings, Guest Additions can provide seamless mouse integration, automatic display resizing, shared clipboard, drag and drop, time synchronization, and shared folders. Keep Guest Additions aligned with the host VirtualBox release where possible. If a feature stops working after an upgrade, reinstall the matching Guest Additions and reboot.

Shared folders may require guest-side permissions or membership in a particular group. Clipboard sharing, drag and drop, and shared folders are convenient but increase the path by which data can cross the host-guest boundary.

8. Manage virtual disks and media

  • Create: Use the VM wizard or Virtual Media Manager to create a VDI, VHD, or VMDK.
  • Attach: Connect a disk to a compatible controller and port in Storage settings.
  • Detach: Remove the disk from the VM configuration without necessarily deleting its host file.
  • Remove: Remove a medium from Virtual Media Manager. Confirm carefully whether you are removing only the registration or deleting the file.
  • Clone: Make an independent copy using VirtualBox media or VM cloning tools.
  • Resize: Increase the virtual disk capacity, then expand partitions and file systems inside the guest. Increasing the host file alone does not enlarge the guest partition.
  • Move: Use VirtualBox move functionality or move the complete VM folder while the VM is powered off.

Virtual disks have UUIDs, which identify registered media. Directly copying a disk file can create a UUID conflict if both the original and copy are registered. Prefer cloning, importing, or VirtualBox media-management commands instead of raw duplication.

After deleting data inside a guest, a dynamically allocated disk may still occupy the old host space. Free space inside the guest first, then use a suitable zero-fill and compacting procedure for that guest and disk format. Compaction is not a substitute for deleting unused snapshots. Snapshots create disk chains, and writes can cause those chains to grow.

9. Manage the VM lifecycle

Action | Effect on guest | When to use it | Risk or caution

Shut down | Requests a normal operating-system shutdown | Routine completion of work | Guest may delay while applications close

ACPI shutdown | Sends a virtual power-button request | When the guest supports ACPI and its interface is unavailable | Not the same as an immediate power cut

Reset | Reboots virtual hardware | Recovery from a frozen guest | Can lose unsaved data

Pause | Temporarily stops execution | Short testing or inspection pause | Resources remain allocated

Save state | Writes VM memory state to host storage | Resume later without a full guest boot | Uses disk space and may become invalid after some changes

Force power off | Immediately stops the VM | Last resort when normal shutdown fails | Equivalent to unplugging a physical computer

You can rename a VM without changing the guest's internal hostname. To move it, power it off and use VirtualBox's move operation when available, or move all related components together and register the definition at the new location. A full clone is independent; a linked clone depends on a parent disk chain and uses less initial storage but is less portable.

Removing a VM from the list can retain its files. Deleting associated files removes the VM disks and configuration from the host, so verify backups first. Exporting creates an OVF/OVA appliance that can be imported on another host. Review hardware, network, and credentials after importing.

10. Snapshots, clones, exports, and backups

A snapshot records a point-in-time VM state, commonly before installing risky software or changing system configuration. Give snapshots meaningful names and descriptions such as clean-baseline-after-updates.

  1. Power down or pause as appropriate for the workload.
  2. Create a snapshot before the risky change.
  3. Perform the test.
  4. Restore the snapshot if the test must be discarded. Changes after that snapshot, including guest files and possibly saved memory state, are discarded.
  5. Delete obsolete snapshots deliberately. VirtualBox may merge disk-chain data, causing substantial disk activity and taking time.

Method | Primary purpose | Portability | Storage impact | Recovery limitations

Snapshot | Short-term restore point | Low to moderate | Can create growing disk chains | Not an independent backup; chain damage affects recovery

Full clone | Independent working copy | Moderate to high | Requires substantial additional space | Does not automatically track later changes to the source

Linked clone | Fast dependent copy | Lower | Saves initial space through parent disks | Requires the parent chain; unsuitable if the parent is lost

OVA/OVF export | Transfer or package a VM | High, subject to compatibility | Creates an appliance package | May not preserve every host-specific setting

Independent backup | Disaster recovery | Depends on method | Requires separate backup storage | Must be tested and kept separate from the host

Snapshots are not backups. Keep independent copies of VM definition files and virtual disks on separate storage, and test restoration before relying on the backup.

11. Virtual networking

A VM uses a virtual network adapter, which appears inside the guest as a network interface. In VirtualBox, each adapter has an attachment mode, MAC address, enabled state, and cable-connected state. The guest can use DHCP or a static IP address, depending on the network design.

Mode | Guest Internet access | Visible on physical LAN | Host-to-guest connectivity | Guest-to-guest connectivity | Typical use case

NAT | Usually yes | No direct inbound visibility | Usually not directly initiated without forwarding | Usually no between separate default NATs | Simple outbound Internet access

NAT Network | Usually yes | No direct inbound visibility | Limited unless configured | Yes, for VMs on the same NAT Network | Several VMs sharing a private network

Bridged adapter | Usually yes | Yes, as another LAN device | Yes through the LAN | Yes through the LAN | Services that must appear on the physical network

Host-only adapter | No ordinary Internet by itself | No | Yes | Yes, on the host-only network | Host-managed labs and private testing

Internal network | No | No | No, unless another adapter provides a path | Yes, for VMs using the same internal network name | Fully isolated VM-to-VM labs

NAT port forwarding

NAT hides the guest behind the host. To expose one service without placing the VM directly on the LAN, forward a host port to a guest port. For example, forward host TCP port 2222 to guest TCP port 22 for SSH, then connect to the host's address on port 2222. The guest service, guest firewall, and host firewall must all allow the connection.

Lab examples

  • For a Linux learning VM, use NAT, attach a Linux ISO, install the guest, remove the ISO, install Guest Additions, and enable clipboard sharing only if needed.
  • For a Windows test environment, use a licensed image, configure required firmware and storage, update the guest, create a clean baseline snapshot, and restore it after application tests.
  • For two isolated machines, connect both guests to the same internal network or host-only network, assign compatible IP addresses or use DHCP, and test guest-to-guest connectivity.
  • For an SSH service behind NAT, keep the adapter in NAT mode and map a nonconflicting host TCP port to guest port 22.

12. Security and safe operation

A VM provides useful separation, but it is not an absolute security boundary. Vulnerabilities, misconfiguration, integration features, network exposure, and unsafe guest software can create risk.

  • Keep the host, VirtualBox, Guest Additions, and guests updated.
  • Use strong guest credentials and least-privilege accounts.
  • Use trusted installation images and verify their integrity when the publisher provides verification data.
  • Disable shared folders, clipboard sharing, drag and drop, USB passthrough, and unnecessary network adapters when they are not required.
  • Prefer NAT or internal networking for experiments. Bridged mode exposes the guest to the physical LAN.
  • Limit NAT port forwarding to required ports and bind host rules narrowly when possible.
  • For untrusted or malware-testing software, use a disposable, fully updated lab with no personal data, no unnecessary integration, and no connection to sensitive networks. Treat the guest as potentially compromised.
  • Store independent VM backups separately from snapshots and the primary host disk.

13. Command-line management with VBoxManage

VBoxManage is VirtualBox's command-line administration utility. It is useful for repeatable setup, scripts, remote administration, and inspection. Check the command syntax for your installed release, quote VM names containing spaces, and confirm the VM state before destructive operations.

VBoxManage list vms
VBoxManage list runningvms
VBoxManage showvminfo "Lab Linux"
VBoxManage startvm "Lab Linux" --type gui
VBoxManage controlvm "Lab Linux" acpipowerbutton
VBoxManage snapshot "Lab Linux" take "clean-baseline" --description "Updated base installation"
VBoxManage snapshot "Lab Linux" restore "clean-baseline"
VBoxManage clonevm "Lab Linux" --name "Lab Linux Copy" --register --mode all
VBoxManage modifyvm "Lab Linux" --nic1 nat
VBoxManage modifyvm "Lab Linux" --natpf1 "ssh,tcp,127.0.0.1,2222,,22"
VBoxManage modifyvm "Lab Linux" --nic2 hostonly --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter"
VBoxManage createmedium disk --filename "/path/to/LabLinux.vdi" --format VDI --size 40960 --variant Standard
VBoxManage storageattach "Lab Linux" --storagectl "SATA" --port 0 --device 0 --type hdd --medium "/path/to/LabLinux.vdi"

These commands list and inspect machines, start and shut down a guest, create and restore snapshots, create a full clone, configure NAT and host-only adapters, forward SSH, create a dynamic VDI, and attach it to a SATA controller. Export and import operations should be performed only after checking the relevant command syntax and ensuring the VM is in a suitable powered-off state.

14. Maintenance and troubleshooting

Open a VM's logs from VirtualBox Manager when investigating startup, acceleration, storage, display, or device problems. Keep the host application, Extension Pack, and Guest Additions aligned with compatible releases. Back up VM definitions and disks before moving, upgrading, cloning, resizing, or deleting a machine.

Hardware virtualization unavailable

Confirm that the processor supports VT-x or AMD-V, enable the relevant BIOS or UEFI setting, review competing host hypervisor and security virtualization features, and restart the host. If the host hardware lacks the required capability, VirtualBox cannot provide hardware-accelerated virtualization.

Guest does not boot

Check that a bootable ISO or installed virtual disk is attached, verify the storage controller and attachment path, review boot order, and confirm that installation completed. Detach an ISO after setup so the guest boots from its virtual disk.

Guest has no Internet

Confirm that the adapter is enabled and marked cable connected. Use NAT as a baseline test. Inside the guest, check the IP address, default gateway, DNS, and network driver. For bridged mode, try the correct physical adapter and consider restrictions on the host network.

VM is slow or host becomes unresponsive

Reduce excessive RAM or CPU allocation, leave capacity for the host, free disk space, inspect snapshot growth, and monitor both host and guest. Updates and high-demand workloads can temporarily consume substantial resources.

Integration features fail

Clipboard sharing, display resizing, and shared folders commonly fail when Guest Additions is missing, outdated, incompatible with the host release, or disabled in VM settings. Install the matching Guest Additions, reboot the guest, enable only the required feature, and check guest permissions for shared folders.

Moved or copied VM reports missing disks or UUID conflicts

Move the complete VM folder rather than selected files. Prefer VirtualBox move, clone, or export/import workflows. If necessary, reattach the correct disk through Storage settings. A raw copied disk may retain an identity already registered in VirtualBox.

USB devices cannot attach

Check compatible Extension Pack support, enable a suitable USB controller, close host applications using the device, and review host permissions. USB passthrough transfers control of the device from the host to the guest and can interrupt host applications.

15. Practical course projects

  1. Linux learning VM: Create a conservative VM, install Linux from an ISO, detach the ISO, install Guest Additions, and test clipboard sharing.
  2. Windows testing VM: Install a properly licensed Windows guest, apply updates, configure required tools, take a clean snapshot, install a test application, and restore the baseline.
  3. Two-machine isolated lab: Create two guests, attach both to the same internal or host-only network, assign compatible addresses, and verify that they communicate without ordinary LAN exposure.
  4. Service forwarding: Run SSH or a web service in a NAT guest and create a narrowly scoped host-to-guest port-forwarding rule.
  5. Migration and appliance: Power off a prepared VM, back up its files, move it to a larger drive or export it as an OVA, then register or import it and verify storage and networking.

Exam-relevant notes

  • An ISO is installation media; a virtual disk is the installed guest's drive.
  • VirtualBox is a Type 2 desktop hypervisor.
  • Dynamic disks grow as guest data is added; fixed disks reserve capacity at creation.
  • Removing a disk from a VM is not automatically the same as deleting its host file.
  • NAT is the simplest outbound network mode; bridged mode places the guest on the physical LAN; host-only connects host and guests privately; internal networking connects only suitably configured guests.
  • Snapshots are convenient restore points, not independent backups.
  • A full clone is independent; a linked clone depends on its parent.
  • Guest Additions improve integration but must be installed inside the guest and kept compatible with the host.
  • Use normal guest shutdown whenever possible; forced power off risks filesystem corruption and data loss.
  • Before destructive disk, snapshot, move, clone, or delete operations, verify the VM state and maintain an independent backup.

For continued study, see the Oracle VirtualBox Online Course.