Proxmox - vhd to qcow2

  • Category: 電腦相關
  • Last Updated: Tuesday, 07 February 2017 15:53
  • Published: Friday, 03 February 2017 17:12
  • Written by sam

Default Azure disk format is VHD

First download it and convert

qemu-img convert wantgooS-os-1946.vhd -O qcow2 wantgooS-os-1946.qcow2

or conver to vmdk

root@wantgoo:/sharelocal# qemu-img convert wantgooS-os-1946.vhd -O vmdk wantgooS-os-1946.vmdk

And goto Proxmox portal create vm, and don't start it.

vi /etc/pve/qemu-server/100.conf --> repleace to yours environment
bios: ovmf
boot: dcn
bootdisk: scsi0
cores: 1
ide2: hostshare:iso/111.iso,media=cdrom,size=604M
kvm: 0
memory: 512
net0: virtio=EE:C5:08:0A:07:6C,bridge=vmbr0
numa: 0
ostype: l26
scsi0: hostshare:100/vm-100-disk-1.qcow2,cache=writethrough,size=31457280512
scsihw: virtio-scsi-pci
smbios1: uuid=fddd4887-bc71-4358-8918-b5594d95087a
sockets: 1

than cp to your destination (sharelocal is my attach dir from windows)

cp /sharelocal/wantgooS-os-1946.qcow2 /sharelocal/images/100/vm-100-disk-1.qcow2

And prepare to goto rescur mode, download your source disk and place to right directory.  (My test VHD is suddenly dead from Azure and not boot up again.)

root@wantgoo1:/sharelocal/template/iso# ls
111.iso  ubuntu-16.04-server-amd64.iso
root@wantgoo1:/sharelocal/template/iso# pwd
/sharelocal/template/iso

Modify .conf to mount disk(iso)

ide2: hostshare:iso/ubuntu-16.04-server-amd64.iso,media=cdrom,size=655M

proxmox vm