# How to boot a virtual machine from an ISO image

Source: https://docs.quake.ai/docs/compute/how-to/boot-from-iso
Markdown: https://docs.quake.ai/docs/compute/how-to/boot-from-iso.md

---

# How to boot a virtual machine from an ISO image

Install a custom operating system on Quake AI by booting from an ISO image. This process uses two volumes: a blank root drive and an ISO-backed drive. After the installation completes, you can snapshot the root volume and use it to launch new instances.

**Overview:**

1. Create a blank volume (root drive A)
2. Create a volume from the ISO image (volume B)
3. Boot a VM with both volumes attached: A as the root drive, B as the ISO
4. Install the OS from the ISO to the blank volume
5. Detach and delete the ISO volume
6. Snapshot or image the root volume for reuse

<PrerequisiteBlock methods={["console", "cli"]}>

- A Quake AI account with a project
- An ISO image [uploaded to your project](/docs/compute/how-to/create-image) with disk format `ISO`

</PrerequisiteBlock>

## Step 1. Create a blank root volume

<MethodTabs>
<Method label="Console">

1. Go to **Storage** > **Volumes** > **Create Volume**. The Console opens a full **Create Volume** page (`Storage / Volumes / Create Volume` breadcrumb), not a modal dialog.
2. Name it `iso-root-drive`.
3. Set **Data Source Type** to **Blank Volume** (the default).
4. Set the capacity to at least 20 GiB (enough for the OS plus applications). The **Capacity (GiB)** field accepts any size from 1 GiB up to your project's volume quota and volume-type limits.
5. Leave **Volume Type** at the default (`Flash_Premium`) unless you have a specific tuning need.
6. Select **Confirm**.

</Method>
<Method label="CLI">

```bash
openstack volume create \
  --size 20 \
  --description "Root drive for ISO install" \
  iso-root-drive
```

Wait for it to become available:

```bash
openstack volume show iso-root-drive -c status
```

</Method>
</MethodTabs>

## Step 2. Create a volume from the ISO image

<MethodTabs>
<Method label="Console">

1. Go to **Storage** > **Volumes** > **Create Volume**.
2. Name it `iso-boot-media`.
3. Set **Data Source Type** to **Image**. An **Operating System** filter row appears with chips (`CentOS`, `Ubuntu`, `Fedora`, `Windows`, `Debian`, `Coreos`, `Arch`, `Freebsd`, `Rocky`, `Others`) and an image-picker table below it.
4. Filter by the OS chip that matches your ISO and select your ISO image from the picker table. The picker table includes **Min System Disk**, **Min Memory**, and **Format** columns: filter on **Format** (`iso`) to find ISO images, and check the minimum values so your flavor and root volume meet them.
5. Set the capacity to at least 1 GiB.
6. Select **Confirm**.

</Method>
<Method label="CLI">

```bash
openstack volume create \
  --size 1 \
  --image "YOUR_ISO_IMAGE_NAME" \
  --description "ISO boot media" \
  iso-boot-media
```

Wait for it to become available:

```bash
openstack volume show iso-boot-media -c status
```

</Method>
</MethodTabs>

## Step 3. Launch a VM with both volumes

Boot an instance with `iso-root-drive` as the primary volume and `iso-boot-media` as a secondary drive. The VM boots from the ISO volume first.

<MethodTabs>
<Method label="Console">

1. Select **Compute** > **Instances** > **Create Instance**.
2. Name the instance `iso-installer`.
3. Set **Start Source** to **Bootable Volume** and pick `iso-boot-media` from the Bootable Volume picker (columns: `Name`, `Size`, `Status`, `Type`, `Created At`).
4. Choose a flavor with sufficient RAM for the installation (at least 2 GB).
5. Select **Next: Network Config** and choose your network.
6. Select **Next: System Config** and set a password (you will access this VM via the web console, not SSH).
7. Select **Next: Confirm Config** and **Confirm**.
8. After the instance is running, attach `iso-root-drive`:
   - Go to the instance detail page.
   - Open the **Volumes** action icon (the third icon in the top-right action bar) and select **Attach Volume**.
   - Pick `iso-root-drive` from the picker (the dialog has `Available` and `Shared` tabs with columns `ID/Name`, `Type`, `Size`, `Shared`, `Created At`) and select **OK**.

</Method>
<Method label="CLI">

```bash
# Get the volume IDs
BOOT_VOL_ID=$(openstack volume show iso-boot-media -f value -c id)
ROOT_VOL_ID=$(openstack volume show iso-root-drive -f value -c id)

openstack server create \
  --flavor c2a.large \
  --volume "$BOOT_VOL_ID" \
  --block-device-mapping "vdb=$ROOT_VOL_ID:::false" \
  --network PublicEphemeral \
  iso-installer
```

Wait for the instance to become active:

```bash
openstack server show iso-installer -c status
```

</Method>
</MethodTabs>

## Step 4. Install the operating system

1. Go to **Compute** > **Instances** and select `iso-installer`.
2. Select **Console** to open the web-based VNC console.
3. Complete the OS installation using the installer on the ISO. When prompted to select an installation target, choose the blank root drive (typically the larger volume, `vdb` or `/dev/sdb`).
4. Shut down the instance from within the OS once installation completes.

## Step 5. Detach and delete the ISO volume

After the installation is done, remove the ISO volume:

<MethodTabs>
<Method label="Console">

1. Go to the `iso-installer` instance detail page.
2. Select the **Volumes** tab.
3. On the `iso-boot-media` row, open the **Volume** action icon dropdown (middle of the three per-row icons) and select **Detach**. Confirm in the dialog.
4. Go to **Storage** > **Volumes** and delete `iso-boot-media`.

</Method>
<Method label="CLI">

```bash
openstack server remove volume iso-installer iso-boot-media
openstack volume delete iso-boot-media
```

</Method>
</MethodTabs>

## Step 6. Boot from the installed volume

Start the instance; it now boots from `iso-root-drive` with the installed OS:

<MethodTabs>
<Method label="Console">

On the instance detail page, open the **Instance Status** action icon (the second of the six top-right action icons) and select **Start**. (The dropdown lists `Start`, `Reboot`, `Shelve` for a `Shutoff` instance.)

</Method>
<Method label="CLI">

```bash
openstack server start iso-installer
```

</Method>
</MethodTabs>

Access the instance via the web console (**Compute** > **Instances** > `iso-installer` > **Console**) or via SSH if you configured SSH access during installation.

## Reuse the installed image

To create other instances from the same installation, take a snapshot of the root volume:

<MethodTabs>
<Method label="Console">

<NoMoreButton />

The Volume action icon dropdown on a Storage > Volumes row exposes seven items in this order: **Attach**, **Create Snapshot**, **Create Image**, **Clone Volume**, **Restore From Snapshot**, **Extend Volume**, **Change Type**. The Reuse step uses the second and third items.

1. Shut down the instance.
2. Go to **Storage** > **Volumes**, find `iso-root-drive`. On its row, open the **Volume** action icon dropdown (middle of the three per-row icons) and select **Create Snapshot**. To skip the snapshot step and write directly to the image catalog, select **Create Image** from the same dropdown.
3. Use the snapshot as a source when creating future volumes, or create an image from the volume for use in the image catalog.

</Method>
<Method label="CLI">

```bash
openstack volume snapshot create \
  --volume iso-root-drive \
  my-custom-os-snapshot
```

Or create a Glance image directly from the volume:

```bash
openstack image create \
  --volume iso-root-drive \
  "My Custom OS"
```

</Method>
</MethodTabs>

## See also

- [Create a volume](/docs/block/how-to/create-volume)
- [Create a volume snapshot](/docs/block/how-to/create-snapshot)
- [Create a virtual machine image](/docs/compute/how-to/create-image)
- [Use the virtual machine console](/docs/compute/how-to/use-vm-console)
