Import Disk Image to VM
Import a disk image file (.img, .qcow2, .vmdk or .raw) into an existing Proxmox VM. ProxMenux collects every decision up-front — target VM, Proxmox storage, source directory, interface, SSD emulation, boot order — and then runs qm importdisk for every selected image.
What this does
How the script runs
The flow has two phases. Phase 1 collects every decision (VM, storage, source directory, images, per-image options) up-front via dialogs. Phase 2 runs qm importdisk for each selected image. Until Phase 2 begins, nothing is copied and the VM config is not touched.
┌─────────────────────────────────────────────┐
│ PHASE 1 — Collect every decision │
│ (nothing touched yet) │
└──────────────────┬──────────────────────────┘
▼
qm list — user picks target VM
(target VM should be powered off)
│
▼
pvesm status -content images
├─ 0 candidates → abort
│ "no storage for disk images"
├─ 1 candidate → auto-select, skip dialog
└─ 2+ → user picks
│
▼
Source directory
├─ default: /var/lib/vz/template/iso
└─ custom: user types absolute path
└─ not a directory → abort
│
▼
Scan the directory (maxdepth 1)
for *.img *.qcow2 *.vmdk *.raw
├─ 0 results → abort
│ "no compatible disk images found"
└─ N results → continue
│
▼
User selects one or several images
(checklist — multiple allowed)
│
▼
For each image, user picks:
├─ Bus: scsi (default) / virtio / sata / ide
├─ SSD emulation (ssd=1)
│ └─ offered only when bus ≠ virtio
└─ Bootable? (adds to boot order in Phase 2)
│
▼
Summary of everything Phase 2 will do
│
┌──────── Cancel OR Confirm ────┐
▼ ▼
Exit, nothing ┌─────────────────┴─────────────────┐
was changed │ PHASE 2 — Import and attach │
└─────────────────┬─────────────────┘
▼
For each selected image:
├─ qm importdisk <VMID> \
│ <source-file> \
│ <target-storage>
│ (format conversion is transparent:
│ qcow2/vmdk/img → raw when the
│ target cannot hold the source
│ format natively — LVM, ZFS, …)
│
├─ Find next free {bus}N slot
│ (scans qm config)
│
└─ qm set <VMID> -{bus}N \
<storage>:vm-<VMID>-disk-N[,ssd=1]
│
▼
If any image was marked bootable:
└─ qm set <VMID> --boot order={bus}N
(first bootable wins; others can be
reordered later in the Proxmox UI)
│
▼
Verify: qm config <VMID> shows the
new slot(s) and, if applicable, the
new boot order
│
▼
Source image file on the host is
kept unchanged (copied, not moved)Prerequisites
- At least one VM defined on the host. The target VM should be powered off.
- At least one image file of a supported format in the source directory. Supported:
.img,.qcow2,.vmdk,.raw. - Enough free space on the target Proxmox storage to hold each imported disk.
- ProxMenux looks for images in
/var/lib/vz/template/isoby default. You can point it to any other directory on the host when it asks.
Step-by-step
Pick the target VM
ProxMenux reads qm list and shows every VM. Pick the one that will receive the imported disk(s).
Pick the Proxmox storage
The list contains every storage that has the images content type enabled. If there is only one candidate it is auto-selected and the dialog is skipped.
Pick the source directory
Choose the default directory (/var/lib/vz/template/iso) or type a custom path — typically where you downloaded / uploaded the image. The script rejects paths that do not exist.
Pick one or several images
The directory is scanned for .img / .qcow2 / .vmdk / .raw files. You can select several at once; each will go through the per-image options in the next step.
Per-image options
For every selected image ProxMenux asks:
- Interface —
scsi(default),virtio,sataoride. Matches how the guest will see the disk. - SSD emulation — only offered for non-VirtIO interfaces. Adds
ssd=1so the guest advertises the disk as solid-state (useful for OS-level TRIM / alignment). - Bootable — if yes, ProxMenux adds the disk to the boot order so it becomes the primary boot device of the VM.
Import and attach
ProxMenux runs qm importdisk for every image (converting format on the fly where needed), attaches the resulting disk to the next free slot (scsiN, sataN, …) with your chosen options and — if you marked any disk as bootable — updates the boot order. Progress shows in the terminal.
Manual equivalent
A single-image import maps to three qm commands:
# 1. import the image file into the target storage (here: local-lvm)
qm importdisk 101 /var/lib/vz/template/iso/server.qcow2 local-lvm
# 2. attach the imported disk as scsi1 with SSD emulation
qm set 101 -scsi1 local-lvm:vm-101-disk-1,ssd=1
# 3. (optional) make it the primary boot device
qm set 101 --boot order=scsi1Image format conversion
.qcow2), qm importdisk converts the image transparently. This can take several minutes for multi-GB images; plan accordingly and do not interrupt the script.Troubleshooting
"No compatible disk images found"
.img / .qcow2 / .vmdk / .raw file. Check the extension (case matters), that the file sits directly in the selected directory (no sub-directories are searched) and that permissions allow root to read it.Import is slow
Imported disk boots into UEFI shell
Related
- Import Disk to VM — same flow but for raw physical disks (passthrough).
- Import VM from OVA / OVF — when you have a full VM package, not just a disk image.
- UUP Dump ISO Creator — generate a Windows ISO if you need one for a fresh install.
- Storage and Disks commands — qm importdisk and qemu-img convert reference.
- Disk Manager overview.