How to import ISO image to disk in Proxmox
28 Jul 2024 - 4 min readImporting an ISO image to a disk in Proxmox involves several steps. This guide will walk you through the process of converting an ISO to a disk image and managing it using Proxmox tools like qm
and qemu-img
.
Table of Contents
- How to Import an ISO to Disk in Proxmox Using
qm
- Alternative: Using
qemu-nbd
to Attach an ISO Directly
How to Import an ISO to Disk in Proxmox Using qm
Step 1: Upload the ISO to Proxmox
Before importing an ISO, you need to upload it to your Proxmox server. You can use either the web interface or the command line.
Upload via Web Interface
Log in to the Proxmox Web Interface:
- Open your browser and go to
https://<your-proxmox-ip>:8006
.
- Open your browser and go to
Navigate to the Storage View:
- Click on the Datacenter in the sidebar.
- Select the Storage where you want to upload the ISO (e.g.,
local
orlocal-lvm
).
Upload ISO:
- Click on the Content tab.
- Click Upload.
- Choose ISO Image from the Content dropdown.
- Select the ISO file from your local machine and click Upload.
Upload via Command Line
Upload the ISO using
scp
:Replace
/path/to/your.iso
with the path to your ISO file and<your-proxmox-ip>
with the IP address of your Proxmox server.
Step 2: Convert ISO to Disk Image
The next step involves converting the ISO to a disk image format (e.g., QCOW2 or RAW) that can be used by Proxmox.
Convert ISO to Disk Image
Use
qemu-img
to convert the ISO:Replace
/path/to/storage/your-iso-file.iso
with the path to your ISO file and/path/to/storage/your-disk-image.qcow2
with the path where you want to save the disk image.Notes:
qcow2
is a commonly used disk image format. You can also useraw
format:
Step 3: Import the Disk Image into Proxmox Storage
Identify Your Storage
List available storages with:
Import Disk Image
Use the
qm importdisk
command to import the disk image:Replace
VMID
with a temporary or placeholder VM ID,/path/to/storage/your-disk-image.qcow2
with the path to your disk image, andSTORAGE
with the storage name.
Step 4: Attach the Imported Disk to an Existing VM (Optional)
Attach Disk Image to VM
Use
qm set
to attach the imported disk to an existing VM:Replace
EXISTING_VMID
with your VM ID,STORAGE
with the storage name, andvm-disk.qcow2
with the name of the imported disk.Verify the Disk is Attached
Check the VM’s configuration with:
Alternative: Using qemu-nbd
to Attach an ISO Directly
If you need to attach an ISO directly to a disk image without creating a VM, use qemu-nbd
.
Step 1: Load nbd Kernel Module
Load the nbd
kernel module:
Step 2: Connect ISO to nbd Device
Connect the ISO file to an nbd device:
Step 3: Copy ISO Content to Disk Image
Create a new disk image and copy the ISO content:
Step 4: Disconnect the ISO
Disconnect the nbd device:
Step 5: Import the Disk Image
Import the disk image into Proxmox:
Summary
- Convert ISO to Disk Image: Use
qemu-img
for conversion. - Import Disk Image: Use
qm importdisk
for importing. - Attach Disk Image: Use
qm set
to attach the disk to a VM. - Alternative: Use
qemu-nbd
for direct ISO attachment.
This guide provides steps to convert and manage ISO files within Proxmox effectively.