IMG files as VM media

sentein

New Member
Oct 10, 2022
4
0
1
I have a few programs i have been trying to load into a VM. Proxmox does not like IMG files as installation media. Is there a utility that will burn the IMG file onto a VM? if i transfer the IMG file to the Proxmox server i cannot seem to get the file to import into the premade VM like i have found from so many other people. I guess any tips or trick would be very welcome.
 
What does qemu-img report about this image? For example:
Code:
qemu-img info /mnt/pve/bbnas/template/iso/cirros-0.5.1-x86_64-disk.img
image: /mnt/pve/bbnas/template/iso/cirros-0.5.1-x86_64-disk.img
file format: qcow2
virtual size: 112 MiB (117440512 bytes)
disk size: 15.1 MiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false

IMG is just a text string, its more important what the actual file is. For example, all below file are "img" when downloaded from the OS providers, however we can use them with PVE without any issues:
Code:
pvesm list bbnas|egrep -v snip
Volid                                                        Format  Type            Size VMID
bbnas:iso/cirros-0.5.1-x86_64-disk.img                       iso     iso         16338944
bbnas:iso/cirros-0.5.2-x86_64-disk.img                       iso     iso         16300544
bbnas:iso/kinetic-server-cloudimg-amd64-disk-kvm.img         iso     iso        625344512
bbnas:iso/ubuntu-18.04-minimal-cloudimg-amd64.img            iso     iso        519241728
bbnas:iso/ubuntu-21.04-server-cloudimg-amd64-disk-kvm.img    iso     iso        559218688
bbnas:iso/ubuntu-22.04-minimal-cloudimg-amd64-bb-vdbench.img iso     iso       2141585408
bbnas:iso/ubuntu-22.04-minimal-cloudimg-amd64.img            iso     iso        291241984



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Thank you bbgeek17
Below i have posted what i have as an output for the IMG file. I have been trying to use one of these IMGs for a few months now. The dev team will not create an ISO for this and i am getting frustrated with the little information i am finding on getting an img to work. Every time i feel like i am close something else stops it from working. I would really like to use the server for this as bare metal seems like a waste.

Code:
qemu-img info /mnt/pve/Drive1/template/iso/batocera-x86_64-35-20220917.img
image: /mnt/pve/Drive1/template/iso/batocera-x86_64-35-20220917.img
file format: raw
virtual size: 6.5 GiB (6980390912 bytes)
disk size: 6.5 GiB
 
You need to provide more technical details on what exactly you tried and how exactly it didnt work.
Raw is a supported file format to import:
man qm
Code:
qm importdisk <vmid> <source> <storage> [OPTIONS]

       Import an external disk image as an unused disk in a VM. The image format has to be supported by qemu-img(1).

       <vmid>: <integer> (1 - N)
           The (unique) ID of the VM.

       <source>: <string>
           Path to the disk image to import

       <storage>: <string>
           Target storage ID

       --format <qcow2 | raw | vmdk>
           Target format

This seems to work just fine:
Code:
qm create 1000 --name vm1000 --memory 256 --socket 1 --cores 1 --bootdisk scsi0 --boot c --onboot no --scsihw virtio-scsi-pci --net0 virtio,bridge=vmbr0,firewall=1 --ide2 iscsi0:cloudinit --agent enabled=1 --args '"-chardev file,id=char0,mux=on,path=/tmp/serial.1000.log,signal=off -serial chardev:char0"' --serial1 socket --vga serial1 --ipconfig0 ip=dhcp --scsi0 iscsi0:0,iothread=0,import-from=/mnt/pve/bbnas/template/iso//batocera-x86_64-35-20220917.img
ide2: successfully created disk 'iscsi0:vm-1000-cloudinit,media=cdrom'

It appears to start the boot:
Code:
Machine UUID 6feafe32-796d-4fda-81d4-d8d61e4e7c85^M


iPXE (http://ipxe.org) 00:12.0 C000 PCI2.10 PnP PMM+0FF90D90+0FEF0D90 C000^M
Press Ctrl-B to configure iPXE (PCI 00:12.0)...^M                                                                               ^M



Press ESC for boot menu.^M

Booting from Hard Disk...^M

SYSLINUX 6.03 EDD  Copyright (C) 1994-2014 H. Peter Anvin et al^M
Booting Batocera.linux...^M
^[[2J

But this is as far as it got or I was interested in seeing it through.

Good luck.

Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
You need to provide more technical details on what exactly you tried and how exactly it didnt work.
Raw is a supported file format to import:
man qm
Code:
qm importdisk <vmid> <source> <storage> [OPTIONS]

       Import an external disk image as an unused disk in a VM. The image format has to be supported by qemu-img(1).

       <vmid>: <integer> (1 - N)
           The (unique) ID of the VM.

       <source>: <string>
           Path to the disk image to import

       <storage>: <string>
           Target storage ID

       --format <qcow2 | raw | vmdk>
           Target format

This seems to work just fine:
Code:
qm create 1000 --name vm1000 --memory 256 --socket 1 --cores 1 --bootdisk scsi0 --boot c --onboot no --scsihw virtio-scsi-pci --net0 virtio,bridge=vmbr0,firewall=1 --ide2 iscsi0:cloudinit --agent enabled=1 --args '"-chardev file,id=char0,mux=on,path=/tmp/serial.1000.log,signal=off -serial chardev:char0"' --serial1 socket --vga serial1 --ipconfig0 ip=dhcp --scsi0 iscsi0:0,iothread=0,import-from=/mnt/pve/bbnas/template/iso//batocera-x86_64-35-20220917.img
ide2: successfully created disk 'iscsi0:vm-1000-cloudinit,media=cdrom'

It appears to start the boot:
Code:
Machine UUID 6feafe32-796d-4fda-81d4-d8d61e4e7c85^M


iPXE (http://ipxe.org) 00:12.0 C000 PCI2.10 PnP PMM+0FF90D90+0FEF0D90 C000^M
Press Ctrl-B to configure iPXE (PCI 00:12.0)...^M                                                                               ^M



Press ESC for boot menu.^M

Booting from Hard Disk...^M

SYSLINUX 6.03 EDD  Copyright (C) 1994-2014 H. Peter Anvin et al^M
Booting Batocera.linux...^M
^[[2J

But this is as far as it got or I was interested in seeing it through.

Good luck.

Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
From the looks of it i had the import string incorrect to do what i needed it to. I will try it again tonight. Thank you for the help. I am pretty sure with what you have laid out here i can get it to run.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!