VMware ESXi and vSphere Cluster Management

Virtual Disks in Oracle VirtualBox

Learn how Oracle VirtualBox virtual disks work, including image files, iSCSI targets, raw disks, controllers, storage chains, planning, and troubleshooting.

A guest virtual machine normally needs persistent disk storage for its operating system, installed applications, configuration, and personal or application data. In Oracle VirtualBox, this storage is presented to the guest as a virtual hard disk.

A virtual disk is a disk device made available to a guest operating system by VirtualBox. The guest sees a hard disk and uses its usual disk drivers, partitioning tools, and filesystems. Behind the scenes, however, VirtualBox can store that disk in an image file, connect it to an iSCSI target, or provide access to a physical disk.

Host, guest, and virtual disk terminology

  • Host: The physical computer and operating system on which VirtualBox runs.
  • Guest virtual machine: The operating system and virtual hardware environment running inside VirtualBox.
  • Virtual disk: A disk device that VirtualBox makes available to the guest.
  • Virtual hard disk: The hard-drive-like device recognized by the guest. It can be backed by an image file, network storage, or a physical disk.
  • Backing storage: The actual host, network, or physical storage resource used to provide the virtual disk.
  • Virtual hard disk controller: Virtual hardware that connects virtual disks to the guest operating system.

How VirtualBox presents storage to a guest

From the guest's perspective, a virtual machine detects a hard disk connected to a virtual storage controller. The guest may then initialize the disk, create a partition table, format a partition, and mount a filesystem just as it would with a physical computer.

From the host's perspective, VirtualBox maps a backing storage resource to that guest-visible disk. The resource might be a file on a host volume, a remotely supplied iSCSI block device, or a physical disk resource. VirtualBox handles the connection between the resource and the virtual hardware exposed to the guest.

The guest generally does not need to know which backing method is being used. It interacts with the virtual disk through normal operating-system disk drivers and storage utilities. The backing method still matters to the administrator because it affects portability, performance, availability, capacity planning, and operational risk.

The storage chain

Virtual storage is easiest to understand as a chain:

Host disk image file, iSCSI target, or physical disk
                    |
                    v
        VirtualBox storage attachment
                    |
                    v
        Virtual hard disk controller
                    |
                    v
        Guest-visible virtual hard disk
                    |
                    v
       Guest partitions and filesystems

The image file, iSCSI target, or physical disk is the backing resource. The storage attachment tells VirtualBox which resource supplies a particular virtual disk. The controller is the virtual hardware interface through which the guest accesses that disk. The guest-visible hard disk is the device the guest formats and uses.

A guest can have more than one virtual disk. For example, one disk can hold the operating system and another can hold application data. Each disk attachment has a controller assignment and a port or device position. These positions can affect device ordering and, in some configurations, which disk the guest attempts to boot.

Virtual disk backing methods

Host disk image files

A disk image file is a large file on host storage that stores the contents and structure of a guest disk. VirtualBox presents the file's contents to the guest as a hard disk.

Image-file-backed disks are the common choice for ordinary local virtual machines because they are straightforward to create, organize, copy, and move with the virtual machine configuration. They also provide useful separation from the host's own disk partitions: the guest normally works inside the image rather than directly modifying host filesystems or partitions.

The image file consumes space on the host volume where it is stored. Depending on the disk configuration, the file may reserve substantial capacity immediately or grow as the guest writes data. In either case, the host must retain enough free space, and the image must remain accessible whenever the virtual machine runs.

iSCSI-backed virtual disks

iSCSI is a protocol for accessing remote block storage across an IP network. An iSCSI target is a remotely exported block-storage resource provided by an iSCSI storage server.

VirtualBox can attach available iSCSI storage as guest storage. The guest sees a virtual hard disk, while the data is supplied by the storage server rather than by a local image file on the host.

iSCSI is block storage, not a normal shared network folder. With a shared folder, the guest accesses files through a network file-sharing protocol. With iSCSI, the guest receives storage that behaves more like a disk or block device and can typically partition and format it according to the guest operating system's needs.

This method depends on network reachability, correct attachment settings, and the availability of the iSCSI server and target. Network interruptions or storage-server outages can make the virtual disk unavailable or affect guest operations.

Raw physical disk access

Raw disk access gives a guest direct access to a physical host disk or selected physical disk resource. Instead of placing the guest's storage inside an image file, VirtualBox exposes a physical storage resource through the virtual machine configuration.

Raw access is an advanced configuration because mistakes can affect real host storage. The administrator must identify the correct physical disk, confirm permissions, and prevent unsafe concurrent use. The host and guest must not independently write to the same filesystem or disk structures at the same time unless a specialized design explicitly supports that arrangement.

Virtual disk backing methods compared

Backing methodWhere the data residesTypical use caseAdvantagesOperational considerations
Host disk image fileAs a file on a host storage volumeTypical local development, testing, and learning virtual machinesPortable, easy to organize, and normally isolated from host partitionsRequires sufficient host capacity and reliable access to the image file
iSCSI targetOn a storage server reached over an IP networkCentralized or network-backed guest storageUses shared or centralized block-storage infrastructureDepends on network connectivity, target availability, and correct attachment settings
Direct physical disk accessOn a physical host disk or selected physical disk resourceSpecialist workloads requiring direct access to an existing disk resourceCan provide direct access to physical storage without an image layerHigher risk; requires correct disk identification, permissions, and exclusive-access safeguards

Virtual hard disk controllers

Every virtual storage device must be attached to a virtual hard disk controller before the guest can use it. The controller is the virtual hardware interface between the guest and its disk devices.

VirtualBox supports commonly used disk-controller standards, but controller types are not interchangeable for every guest or configuration. Controller choice can affect:

  • Whether the guest operating system can detect the disk.
  • Which drivers or compatibility support the guest requires.
  • Boot configuration and whether the operating system disk is available early enough during startup.
  • The order in which disks appear to the guest.
  • Features and device behavior available through the selected controller standard.

When configuring a VM, attach each virtual disk to an appropriate controller and assign its port or device position deliberately. The primary operating-system disk should be placed where the intended guest operating system expects to find its boot device. Additional disks should be assigned clear, stable positions so that device ordering is predictable.

Virtual storage component relationships

ComponentRoleVisible to host or guestExample
Backing storage resourceSupplies the data for a virtual diskPrimarily managed from the host or storage environmentA disk image file, iSCSI target, or physical disk
Virtual disk attachmentMaps a backing resource to a VM disk deviceConfigured in VirtualBox; represented to the guest as a disk connectionAn image file assigned to a VM's storage configuration
Virtual hard disk controllerProvides the virtual hardware interface used to access attached disksPresented to and detected by the guestA compatible virtual storage-controller standard
Guest-visible hard diskActs as the disk device that the guest partitions and formatsVisible inside the guest operating systemThe guest's operating-system disk or data disk

Practical configurations

Typical local virtual machine

A new guest can use a disk image file located on the host's internal drive. VirtualBox attaches that image as the guest's primary hard disk through a compatible virtual disk controller. The guest installer creates partitions and a filesystem on the virtual disk, while the resulting data is stored in the host image file.

Guest using centralized storage

A virtual machine can attach to an iSCSI target hosted on a storage server. The guest still sees a hard disk, but its blocks are supplied by network-provided storage instead of a local image file. This design requires reliable network access and an available target whenever the VM needs the disk.

Advanced access to an existing disk

A specialist might configure a guest to access a physical disk directly when a workload requires access to that disk's existing block device. Before doing so, the administrator must verify the disk identity and ensure that the host and guest will not perform conflicting writes.

Multiple guest disks

A guest may have one virtual disk for its operating system and a second virtual disk for application data. Both disks are attached to virtual storage controllers, but they appear as separate disks inside the guest. Separating operating-system and application data can simplify capacity planning and some maintenance tasks, although it does not replace backups.

Storage planning and selection

  • Choose an image file for most local learning, development, and test VMs where portability and simple organization matter.
  • Choose an iSCSI target when centralized network block storage is available and the VM can tolerate or properly manage its dependence on network and server availability.
  • Choose raw disk access only for a well-understood specialist requirement. The operational and data-loss risk is higher than with an image file.
  • Plan host capacity: account for the current image size, expected guest growth, snapshots or other storage overhead, and free space required by the host operating system.
  • Plan performance: local storage avoids network latency, iSCSI performance depends on the network and storage server, and raw access does not automatically make every workload faster.
  • Plan availability: an image-backed VM depends on the host volume, an iSCSI-backed VM depends on the network and target, and a raw-disk VM depends on safe access to the physical disk.
  • Plan access controls: direct physical storage access grants a guest more consequential access to host resources and therefore requires stricter permissions and procedures.

Configuring virtual storage

  1. Create or select a virtual disk backed by a host disk image file when a local image-based disk is appropriate.
  2. Attach an available iSCSI target when network block storage is required and its server and network dependencies are understood.
  3. Configure raw physical disk access only after identifying the correct disk and understanding the required permissions and exclusive-access safeguards.
  4. Attach every virtual storage device to an appropriate virtual hard disk controller.
  5. Assign controller ports or device positions consistently, especially when the VM has multiple disks.
  6. Verify controller compatibility and boot-disk placement for the intended guest operating system.
  7. Inside the guest, confirm that the expected disk is detected before creating partitions or filesystems.

Troubleshooting virtual disks

The guest does not detect an expected disk

  • Likely causes: The disk is not attached to a virtual hard disk controller, it is attached to an unsupported or unsuitable controller, or the VM configuration does not contain the expected attachment.
  • Checks: Confirm that the disk is present in the VM storage configuration. Confirm its controller assignment and device position. Check that the guest has drivers or compatibility for the selected controller.

An iSCSI-backed disk is unavailable

  • Likely causes: The iSCSI server or target is unreachable, network connectivity is unavailable, or the target is not available to the configured VirtualBox connection.
  • Checks: Verify network access to the storage server. Verify the target's availability and attachment settings. Confirm that the VM configuration references the intended target.

The VM cannot access a directly attached physical disk

  • Likely causes: The host user lacks permission, the wrong physical disk resource was selected, or the host or another process is using the disk in a conflicting manner.
  • Checks: Verify the selected disk identity before making changes. Review host permissions and exclusive-access requirements. Avoid simultaneous host and guest writes to the same disk.

The host runs out of storage with an image-backed disk

  • Likely causes: The host volume holding the image has insufficient free space, or guest data growth exceeded the original storage plan.
  • Checks: Check free space on the host storage volume. Review the image's location and size. Plan adequate host capacity before expanding guest storage use.

Exam-relevant summary

  • A virtual disk is the hard-disk-like device presented to a guest, not necessarily the physical resource that stores its data.
  • A disk image file, iSCSI target, and physical disk are alternative backing resources.
  • iSCSI provides remote block storage, which differs from accessing files through a shared network folder.
  • Raw disk access is advanced and can affect real host storage if configured or used incorrectly.
  • Each virtual disk must be connected through a virtual hard disk controller.
  • Controller choice affects compatibility, boot behavior, device ordering, and available features.
  • The complete path is backing resource, VirtualBox attachment, virtual controller, and guest-visible disk.

For the central concept, remember that a Virtual Disk is the guest-facing storage device, while its backing resource and controller determine how VirtualBox supplies that storage.