For the complete documentation index, see llms.txt. This page is also available as Markdown.

Mount an ISO on a Running VM by Using an ISO Carrier Volume

Overview

The Mount ISO VM action attaches an ISO from the image library as a read-only optical drive, and it requires the VM to be powered off. When you cannot stop a VM, you can use an ISO carrier volume instead.

An ISO carrier volume is a small data volume that stores one or more ISO files on a Universal Disk Format (UDF) file system. Because the carrier is an ordinary data volume, you can attach it to a running VM and detach it again without stopping the VM. Inside the VM, the guest operating system mounts the ISO file natively: Windows presents it as a DVD drive, and Linux mounts it as a loop device. The guest sees the original ISO, including its volume label and file system.

The workflow has two parts:

  • Once per set of ISOs: build a carrier image on a Linux machine and add it to the image library.

  • Each time you need the ISO in a VM: create a volume from the carrier image, attach it to the running VM, mount the ISO in the guest, then unmount it and detach the volume.

In this guide, you will build a carrier image, create a carrier volume from it, attach the volume to a running VM, mount the ISO in a Windows or Linux guest, and detach the volume when you are done.

Prerequisites

  • A Linux machine running Ubuntu or Debian, with sudo access and free disk space of about twice the combined size of the ISO files. The mkudffs tool that formats the carrier is not packaged for Rocky Linux 10 or Red Hat Enterprise Linux 10. Any Ubuntu VM works, including a VM that runs in Private Cloud Director.

  • The ISO files you want to provide to the VM.

  • Access to the Private Cloud Director UI, or pcdctl installed and configured for your region.

  • A guest operating system that can mount the ISO:

    • Windows: Windows Server 2012 or Windows 8, or later, for the Mount-DiskImage cmdlet.

    • Linux: a kernel with UDF and loop device support. Mainstream distributions include both by default.

  • A VM that has a free hot-plug slot for one more disk. VMs that use the q35 machine type have a limited number of hot-plug slots. See Troubleshooting.

  • To attach the carrier from the UI, a VM that boots from a volume. For a VM with an ephemeral root disk, use pcdctl to attach and detach the carrier.

Why the Carrier Uses UDF

The carrier must be readable by the guest operating system without installing extra packages, and it must hold ISO files larger than 4 GB. UDF is the only file system that met both requirements on every guest that was tested:

Carrier file system
Windows Server 2022
Ubuntu 24.04 cloud image
Rocky Linux 10.2 cloud image

UDF

Mounts while the disk is read-only

Mounts with no extra packages

Mounts with no extra packages

NTFS

Mounts only after you clear the disk's read-only attribute

Mounts through the preinstalled ntfs-3g package

Fails: no NTFS support in the kernel

exFAT

Mounts

Fails: no exFAT support in the cloud kernel

Mounts

Step 1: Build the Carrier Image

Run these commands on the Ubuntu or Debian machine, in the directory that contains your ISO files.

  1. Install the tools that partition, format, and convert the carrier image.

  2. Set the carrier name, list the ISO files to include, and calculate the carrier size. The size is the combined size of the ISO files, rounded up to a whole GiB, plus 1 GiB of headroom.

    Note the size. You need it when you create the carrier volume.

  3. Create the disk image with a single partition. The partition type 0x07 makes Windows assign a drive letter to the carrier.

  4. Format the partition as UDF 2.01 with a 512-byte block size and the label ISOCARRIER. The guest steps later in this guide find the carrier by this label.

    mkudffs warns that a UDF file system on a partition cannot be read on Apple systems. You can ignore this warning.

  5. Copy the ISO files onto the carrier.

  6. Convert the image to compressed QCOW2 to reduce the upload size.

    The virtual size in the output equals the carrier size from step 2. After you upload the image, you can delete ${CARRIER}.raw.

Step 2: Add the Carrier Image to the Image Library

  1. Navigate to Virtual Machines > Images and VM Snapshots in the left-hand navigation menu.

  2. Select Add Image.

  3. In the Image Selection section, choose Upload Image File and select iso-carrier.qcow2, or choose Upload Image via URL and enter the Image Download URL.

  4. Under Image Settings, enter a Name, for example iso-carrier.

  5. Set Operating System to Other.

  6. Confirm that Disk Format is qcow2.

  7. Optionally, set Visibility. The default is Private.

  8. Select Add Image. The image status changes from queued to active when the upload completes.

For Upload Image via URL, the Image Library Service host downloads the file, so the URL must be reachable from that host. The URL must also use port 80 or 443. A URL on another port is rejected, and the UI reports Request failed with status code 400.

For details about uploading images through the UI, including the Image Library Service certificate, see Upload an Image Using the UI.

To add the image with pcdctl instead, authenticate pcdctl as described in Import Images, then run:

To make the carrier image available to other tenants, see Share Images Across Tenants.

Step 3: Create a Carrier Volume

Use one carrier volume per VM. To provide the same ISO files to several VMs at once, create a separate carrier volume for each VM from the carrier image.

  1. Navigate to Storage > Volumes in the left-hand navigation menu.

  2. Select Create New Volume.

  3. Under Choose a Source, select Image, then select the carrier image in the image list.

  4. Enter a Name, for example iso-carrier-vol, and a Size in GiB that is at least the carrier size from Step 1. Choose a Volume Type.

  5. Select Create Volume and wait until the volume status is available.

To create the volume with pcdctl, replace <size-gib> with the carrier size:

Optional: Make the Carrier Volume Read-Only

A read-only carrier volume cannot be modified from inside the VM, which is useful when you reuse the same volume across VMs. Set the flag while the volume is not attached. There is no UI action for this today.

Windows and Linux guests mount the carrier and its ISO files normally when the volume is read-only. To make the volume writable again, run:

Step 4: Attach the Carrier Volume to the Running VM

You do not need to stop the VM.

In the UI, you can attach a volume only to a VM that boots from a volume. For a VM that uses an ephemeral root disk, Manage Volumes is unavailable, and the VM is not listed when you choose Actions > Attach Volume from the Volumes list. Attach the carrier volume to such a VM with pcdctl, as shown below.

  1. Navigate to Virtual Machines > Virtual Machines in the left-hand navigation menu.

  2. Select the VM in the VM grid view, then choose Other > Manage Volumes.

  3. Select Attach for the carrier volume.

  4. In the attach confirmation, leave Delete volume when VM is deleted cleared if you plan to reuse the carrier volume, then select Attach.

You can also attach the volume from the Volumes list: select the volume, choose Actions > Attach Volume, select the VM, then select Attach Volume.

To attach the volume with pcdctl:

The volume status changes to in-use within a few seconds, and the VM keeps running.

Step 5: Mount the ISO in the Guest

Run these commands in PowerShell as an administrator.

  1. Find the carrier disk. By default, Windows Server brings a newly attached disk up offline and read-only.

  2. Bring the carrier disk online. Replace <disk-number> with the number from the previous command. The disk stays read-only, which does not prevent you from mounting the ISO files.

  3. Find the carrier's drive letter and list the ISO files on it.

  4. Mount an ISO file. Replace <file-name> with the name of the ISO file. The output shows the drive letter of the new DVD drive, with the drive type CD-ROM.

You can also use the Windows GUI: in Disk Management, right-click the carrier disk and select Online, then in File Explorer, right-click the ISO file on the carrier and select Mount.

  1. Mount the carrier read-only by its label. The label path works regardless of the device name the disk receives in the guest.

  2. Mount an ISO file from the carrier. Replace <file-name> with the name of the ISO file.

Step 6: Unmount the ISO and Detach the Carrier Volume

Release the carrier inside the guest.

Run these commands in PowerShell as an administrator. Replace <file-name> and <disk-number> with the values you used in Step 5.

Then detach the carrier volume from the VM. You do not need to stop the VM.

  1. Navigate to Virtual Machines > Virtual Machines in the left-hand navigation menu.

  2. Select the VM in the VM grid view, then choose Other > Manage Volumes.

  3. Select Detach for the carrier volume, then select Detach in the confirmation.

To detach the volume with pcdctl:

The volume status returns to available, and the VM keeps running.

Step 7: Reuse or Delete the Carrier Volume

To reuse the carrier volume, attach it to another VM by repeating Steps 4 through 6.

When you no longer need the carrier volume, delete it:

  1. Navigate to Storage > Volumes in the left-hand navigation menu.

  2. Select the volume, then select the delete icon.

  3. Select Confirm in the confirmation dialog.

To delete the volume with pcdctl:

The carrier image stays in the image library, so you can create a new carrier volume from it at any time.

Limitations

  • The carrier is a data disk, not an optical drive, so a VM cannot boot from the ISO files on it. To install an operating system from an ISO, create the VM with the Install from ISO option, as described in Install OS from ISO Wizard. To attach an ISO to a powered-off VM as an optical drive, use the Mount ISO action.

  • Use one carrier volume per VM. To use the same ISO files on several VMs at once, create a carrier volume for each VM from the same carrier image.

  • The carrier holds the ISO files that you copied onto it when you built it. To add or update ISO files, build and upload a new carrier image.

  • This guide does not remove an ISO that is already attached to a VM as an optical drive, for example with the Mount ISO action. Detaching that ISO still requires the VM to be powered off. See Virtual Machine Actions.

Troubleshooting

  • Attaching the volume to a VM that uses the q35 machine type fails, and the volume returns to available. The VM has no free hot-plug slot. VMs that use the q35 machine type have a limited number of hot-plug slots, and each volume that you attach to the running VM uses one. On the hypervisor host, the Compute Service log records No more available PCI slots. Detach another volume that was attached to the running VM to free a slot, then attach the carrier volume again.

  • The carrier disk is offline or read-only in Windows. This is the default behavior of Windows Server for newly attached disks. Bring the disk online as described in Step 5. You do not need to clear the read-only attribute.

  • The volume status stays in-use after you detach it from a Windows VM. Windows still uses the carrier. Unmount the ISO files, take the carrier disk offline, then detach the volume again.

  • Programs in a Linux VM report I/O errors after you detach the volume. The volume was detached while the ISO was still mounted. Stop the programs that use the ISO, then remove the stale mounts:

  • The carrier appears as an optical drive, or the UI reports "Stop the VM before attaching or detaching an ISO-based volume". The carrier image was uploaded with the iso disk format. Upload the carrier again with the qcow2 disk format, and create a new carrier volume from the new image.

  • Manage Volumes is unavailable for the VM, or the VM is not listed when you attach the volume. The VM uses an ephemeral root disk, and the UI attaches volumes only to VMs that boot from a volume. Attach the carrier volume with pcdctl server add volume.

  • Adding the carrier image with Upload Image via URL fails with Request failed with status code 400. The URL uses a port other than 80 or 443. Serve the file on port 80 or 443 from a location the Image Library Service host can reach.

Last updated

Was this helpful?