> For the complete documentation index, see [llms.txt](https://docs.platform9.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform9.com/private-cloud-director/virtualized-clusters/virtualmachine/mount-iso-on-a-running-vm.md).

# 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 <code class="expression">space.vars.product\_name</code>.
* The ISO files you want to provide to the VM.
* Access to the <code class="expression">space.vars.product\_name</code> UI, or [`pcdctl`](/private-cloud-director/automation-and-cli/pcdctl-command-line.md) 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](#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.

   ```bash
   sudo apt-get update
   sudo apt-get install -y udftools parted qemu-utils
   ```
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.

   ```bash
   CARRIER=iso-carrier
   ISOS=(app-installer.iso drivers.iso)
   SIZE_GIB=$(( ( $(du -cb "${ISOS[@]}" | tail -1 | cut -f1) + 1073741823 ) / 1073741824 + 1 ))
   echo "Carrier size: ${SIZE_GIB} GiB"
   ```

   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.

   ```bash
   truncate -s ${SIZE_GIB}G ${CARRIER}.raw
   sudo parted -s ${CARRIER}.raw mklabel msdos mkpart primary 1MiB 100%
   sudo sfdisk --part-type ${CARRIER}.raw 1 7
   ```
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.

   ```bash
   LOOP=$(sudo losetup --find --partscan --show ${CARRIER}.raw)
   sudo mkudffs --media-type=hd --blocksize=512 --udfrev=0x0201 --label=ISOCARRIER ${LOOP}p1
   ```

   `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.

   ```bash
   sudo mkdir -p /mnt/carrier
   sudo mount -t udf ${LOOP}p1 /mnt/carrier
   sudo cp "${ISOS[@]}" /mnt/carrier/
   sudo umount /mnt/carrier
   sudo losetup --detach ${LOOP}
   ```
6. Convert the image to compressed QCOW2 to reduce the upload size.

   ```bash
   qemu-img convert -c -O qcow2 ${CARRIER}.raw ${CARRIER}.qcow2
   qemu-img info ${CARRIER}.qcow2
   ```

   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

{% hint style="warning" %}
Set the disk format to `qcow2`. Do not select `iso`. An image with the `iso` disk format is attached to VMs as an optical drive, which requires the VM to be powered off.
{% endhint %}

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.

{% hint style="info" %}
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`.
{% endhint %}

For details about uploading images through the UI, including the Image Library Service certificate, see [Upload an Image Using the UI](/private-cloud-director/images-and-image-library/image-upload-via-ui.md).

To add the image with `pcdctl` instead, authenticate `pcdctl` as described in [Import Images](/private-cloud-director/images-and-image-library/image-library---images.md#import-images), then run:

```bash
pcdctl image create iso-carrier --os-interface admin --insecure --file iso-carrier.qcow2 --disk-format qcow2 --container-format bare
```

To make the carrier image available to other tenants, see [Share Images Across Tenants](/private-cloud-director/images-and-image-library/share-images-across-tenants.md).

## 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:

```bash
pcdctl volume create --image iso-carrier --size <size-gib> iso-carrier-vol
```

### 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.

```bash
pcdctl volume set --read-only iso-carrier-vol
```

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:

```bash
pcdctl volume set --read-write iso-carrier-vol
```

## Step 4: Attach the Carrier Volume to the Running VM

You do not need to stop the VM.

{% hint style="info" %}
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.
{% endhint %}

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`:

```bash
pcdctl server add volume <vm-name> iso-carrier-vol
```

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

## Step 5: Mount the ISO in the Guest

{% tabs %}
{% tab title="Windows" %}
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.

   ```powershell
   Get-Disk | Where-Object IsOffline -eq $true | Format-Table Number, FriendlyName, OperationalStatus, Size
   ```
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.

   ```powershell
   Set-Disk -Number <disk-number> -IsOffline $false
   ```
3. Find the carrier's drive letter and list the ISO files on it.

   ```powershell
   $carrier = Get-Volume -FileSystemLabel ISOCARRIER
   Get-ChildItem "$($carrier.DriveLetter):\" -Filter *.iso
   ```
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`.

   ```powershell
   Mount-DiskImage -ImagePath "$($carrier.DriveLetter):\<file-name>.iso" -PassThru | Get-Volume
   ```

{% hint style="info" %}
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**.
{% endhint %}
{% endtab %}

{% tab title="Linux" %}

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

   ```bash
   sudo mkdir -p /mnt/carrier /mnt/iso
   sudo mount -o ro /dev/disk/by-label/ISOCARRIER /mnt/carrier
   ls /mnt/carrier
   ```
2. Mount an ISO file from the carrier. Replace `<file-name>` with the name of the ISO file.

   ```bash
   sudo mount -o loop,ro /mnt/carrier/<file-name>.iso /mnt/iso
   ls /mnt/iso
   ```

{% endtab %}
{% endtabs %}

## Step 6: Unmount the ISO and Detach the Carrier Volume

{% hint style="warning" %}
Unmount the ISO files and release the carrier disk inside the guest before you detach the volume.

* **Windows:** if an ISO is still mounted or a file on it is open, Windows blocks the removal. The detach fails after several retries, and the volume stays attached to the VM. To recover, close the open files, complete the steps below, and detach the volume again.
* **Linux:** Linux does not block the removal. The detach succeeds, and any program that still reads from the ISO receives I/O errors. Unmount first to avoid interrupting running programs.
  {% endhint %}

Release the carrier inside the guest.

{% tabs %}
{% tab title="Windows" %}
Run these commands in PowerShell as an administrator. Replace `<file-name>` and `<disk-number>` with the values you used in Step 5.

```powershell
$carrier = Get-Volume -FileSystemLabel ISOCARRIER
Dismount-DiskImage -ImagePath "$($carrier.DriveLetter):\<file-name>.iso"
Set-Disk -Number <disk-number> -IsOffline $true
```

{% endtab %}

{% tab title="Linux" %}

```bash
sudo umount /mnt/iso
sudo umount /mnt/carrier
```

{% endtab %}
{% endtabs %}

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`:

```bash
pcdctl server remove volume <vm-name> iso-carrier-vol
```

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`:

```bash
pcdctl volume delete iso-carrier-vol
```

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](/private-cloud-director/virtualized-clusters/virtualmachine.md#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](/private-cloud-director/virtualized-clusters/virtualmachine/virtual-machine-actions.md#unmount-iso).

## 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:

  ```bash
  sudo umount -l /mnt/iso
  sudo umount -l /mnt/carrier
  ```
* **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.

## Related Pages

* [Virtual Machine Actions](/private-cloud-director/virtualized-clusters/virtualmachine/virtual-machine-actions.md): the Mount ISO and Unmount ISO actions for powered-off VMs
* [Upload an Image Using the UI](/private-cloud-director/images-and-image-library/image-upload-via-ui.md): upload options and the Image Library Service certificate
* [Volume](/private-cloud-director/storage/volume.md): attaching and detaching volumes, and other volume actions


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.platform9.com/private-cloud-director/virtualized-clusters/virtualmachine/mount-iso-on-a-running-vm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
