How to convert qemu statment to proxmx conf format

spinmaster

New Member
Mar 15, 2023
3
0
1
Hi all, I am running an arm version of Proxmox (I know, not supported :) )

I have the following qemu statement that successfully runs the openwrt vm from the provided image.

Code:
qemu-system-aarch64 -m 512 -nographic -cpu cortex-a72 -smp 1 -M virt -bios /usr/share/pve-edk2-firmware/aarch64/QEMU_EFI.fd -drive format=raw,file=openwrt-armsr-armv8-generic-ext4-combined.img

However I cannot find the correct voodu to convert it to a working Proxmox configuration.

I imported the downloaded img using using:
Code:
qm importdisk 100 ./openwrt-armsr-armv8-generic-ext4-combined.img local

The Proxmox file I have so far:
Code:
arch: aarch64
bios: ovmf
boot: order=scsi0
cores: 2
memory: 512
meta: creation-qemu=8.0.2,ctime=1697397737
net0: virtio=BE:9B:58:86:0C:B8,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: local:100/vm-100-disk-1.raw,iothread=1,size=243564032
scsihw: virtio-scsi-single
serial0: socket
smbios1: uuid=f24426f9-fc3d-48e3-814e-a7ff91d66960
sockets: 1
vga: serial0

When starting the the vm I get:

Code:
starting serial terminal on interface serial0

and then nothing....

Can anyone help convert this to a working Proxmox conf file.
Thanks
 
I've now checked the imported image and the output from fdisk shows it does have the correct efi partition (I also mounted it and can confirm the correct files and folders are there (plus I already know he image works as it works with the 'qumu-system-aarch' command in the first post.

Bash:
root@proxmox-arm-sd:/var/lib/vz/images/100# fdisk -lu ./vm-100-disk-1.raw
Disk ./vm-100-disk-1.raw: 232.28 MiB, 243564032 bytes, 475711 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C0056D2D-E821-88B0-1418-4BF8BDA76600

Device                  Start    End Sectors  Size Type
./vm-100-disk-1.raw1      512 262655  262144  128M EFI System
./vm-100-disk-1.raw2   262656 475647  212992  104M Linux filesystem
./vm-100-disk-1.raw128     34    511     478  239K BIOS boot


I then found this useful command:
Code:
qm showcmd 100 --pretty
Which outputs:

Bash:
WARN: no efidisk configured! Using temporary efivars disk.
/usr/bin/kvm \
  -id 100 \
  -name 'vm100,debug-threads=on' \
  -no-shutdown \
  -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server=on,wait=off' \
  -mon 'chardev=qmp,mode=control' \
  -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' \
  -mon 'chardev=qmp-event,mode=control' \
  -pidfile /var/run/qemu-server/100.pid \
  -daemonize \
  -smbios 'type=1,uuid=f24426f9-fc3d-48e3-814e-a7ff91d66960' \
  -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//AAVMF_CODE.fd' \
  -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/tmp/100-ovmf.fd,size=67108864' \
  -smp '2,sockets=1,cores=2,maxcpus=2' \
  -nodefaults \
  -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
  -nographic \
  -cpu host \
  -m 512 \
  -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pcie.0,addr=0x1e' \
  -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pcie.0,addr=0x1f' \
  -device 'pci-bridge,id=pci.3,chassis_nr=3,bus=pcie.0,addr=0x5' \
  -device 'qemu-xhci,id=qemu-xhci' \
  -readconfig /usr/share/qemu-server/pve-aarch64.cfg \
  -chardev 'socket,id=serial0,path=/var/run/qemu-server/100.serial0,server=on,wait=off' \
  -serial chardev:serial0 \
  -device 'virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x3,free-page-reporting=on' \
  -device 'virtio-scsi-pci,id=virtioscsi0,bus=pcie.3,addr=0x1' \
  -drive 'file=/var/lib/vz/images/100/vm-100-disk-1.raw,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on' \
  -device 'scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100' \
  -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown' \
  -device 'virtio-net-pci,mac=BE:9B:58:86:0C:B8,netdev=net0,bus=pcie.0,addr=0xb,id=net0,rx_queue_size=1024,tx_queue_size=1024' \
  -machine 'type=virt+pve0,gic-version=host'

So judging by the warning at the top and the line:
Bash:
 -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/tmp/100-ovmf.fd,size=67108864' \

It's not looking at the efi partition inside vm-100-disk-1.raw, but instead still creating and using a temp efi partition.

So my question now is after adding a Proxmox efidisk, In the config file, is it possible to redirect it to use the partition in the vm-100-disk-1.raw? (I incorrectly assumed if I did not supply an efidisk it would look for the efi partition on the first disk).

I tried adding the following without success:
Bash:
efidisk0: local:100/vm-100-disk-1.raw,efitype=4m,size=64M

Maybe I could dd from the vm-100-disk-1.raw to the efidisk proxmox creates?

TIA
 

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!