Help converting vmdk to proxmox

ptmuldoon

Well-Known Member
Apr 28, 2012
36
2
48
I'm still very new to Proxmox trying to move away from Esxi and struggling in converting my existing vmdk VM's over to proxmox. I've done a lot of reading, yet not sure where I am going wrong thus far. Some articles mention that you need to use the vmware diskmanager utility and some don't so not sure if going in the right direction or not.

I have a new Proxmox install formatted under ZFS in a Raid 1 format. So I think when I create a VM, that the vm disk is located in my 'local-zfs' directory.

My storage.cfg looks as follows:
Code:
dir: local
        path /var/lib/vz
        content iso,vztmpl,backup
zfspool: local-zfs
        pool rpool/data
        sparse
        content images,rootdir

When I run zfs list I see this
Code:
NAME                           USED  AVAIL  REFER  MOUNTPOINT
rpool                         20.4G   902G   104K  /rpool
rpool/ROOT                    1.22G   902G    96K  /rpool/ROOT
rpool/ROOT/pve-1              1.22G   902G  1.22G  /
rpool/data                    19.2G   902G  16.0G  /rpool/data
rpool/data/subvol-101-disk-0  2.15G  5.85G  2.15G  /rpool/data/subvol-101-disk-0
rpool/data/subvol-102-disk-0  1.04G  6.96G  1.04G  /rpool/data/subvol-102-disk-0
rpool/data/vm-100-disk-0        56K   902G    56K  -
rpool/data/vm-103-disk-0        56K   902G    56K  -

I am trying to convert a Windows10 VM, and I did uninstall VMWare Tools and ran the MergeIDE file. The windows VM that I am trying to convert is 64GB.
Code:
qemu-img info Win10OffBackup.vmdk
image: Win10OffBackup.vmdk
file format: vmdk
virtual size: 64G (68719476736 bytes)
disk size: 38G

I have a created a VM that has an ID of 103 (and I see that above). I created this VM with a 64GB IDE drive and left it powered off.

I then convert the vmdk as follows:
Code:
qemu-img convert -p -O raw Win10OffBackup-flat.vmdk local-z

But each time when I try and boot the VM, there is no boot disk found and when I run zfs list again, the vm-103-disk-0 is same size at 56K?

Am I trying to convert and place the file in the correct location?

Or possibly the convert command is wrong as it is not replacing the vm-103-disk-0 at all? Where should I see the converted file? But I know trying /local-zfs/vm-103-disk-0 on the convert command doesn't work.

I've also tried with this and get not a bootable disk when it starts
Code:
qemu-img convert -p -O raw Win10OffBackup-flat.vmdk /rpool/data/vm-103-disk-0

And I've also noticed that it appears something is copying somplace as it appears my Available disk space is decreasing. Where would I look to find these files that taking up this space? It showed 902G earlier, and now is 893G? And I even now removed the VM103?
Code:
rpool                         29.0G   893G   104K  /rpool
rpool/ROOT                    1.22G   893G    96K  /rpool/ROOT
rpool/ROOT/pve-1              1.22G   893G  1.22G  /
rpool/data                    27.8G   893G  24.6G  /rpool/data
rpool/data/subvol-101-disk-0  2.14G  5.86G  2.14G  /rpool/data/subvol-101-disk-0
rpool/data/subvol-102-disk-0  1.04G  6.96G  1.04G  /rpool/data/subvol-102-disk-0
rpool/data/vm-100-disk-0        56K   893G    56K  -
So......... I'm stumped!!
 
Last edited:
Holy %&#$, I got it working.

For anyone else, I came across this post here:
https://forum.proxmox.com/threads/storage-local-and-local-zfs.31761/

And in that post, it mentions to copy the converted file to dev/zvol/rpool/data/....

So for me, this convert worked.
Code:
 qemu-img convert -p -O raw Win10OffBackup-flat.vmdk /dev/zvol/rpool/data/vm-103-disk-0

And then started the VM and it booted up the windows machine and looks like everything is there and internet working on it.

Thus far, my Unraid VM (with usb and pci passthru), Plex Server Container and OpenHab container (with usb passthru) all seem to much quicker than under Esxi.
 
  • Like
Reactions: Sourcenux
Hi ptmuldoon,

I stumbled into this forum after a deep google search to solve a similar problem as yours.

I have a vmdk image (Windows 10) created by VMware Workstation 14.

The steps I took on the image.vmdk file:-
Uninstalled Vmware Tools
Update mergeide registry to enable IDE
Shutdown VM & removed all snapshots
Use vmware-vdiskmanager to create image-flat.vmdk

Transfer image-flat.vmdk into Proxmox & convert it to raw format
qemu-img convert image-flat.vmdk -O raw image-flat.raw

Create a VM with ID 888 in Proxmox with ide HD in /local_storage (Directory type & Content Disk-Image)
Move image-flat.raw to /local_storage/images/888/
Delete /local_storage/images/888/vm-888-disk.raw
Update /etc/pve/local/qemu-server/888.conf by replacing vm-888-disk.raw with image-flat.raw

Power on VM 888, it detects "ata0-0: QEMU HARDDISK ATA-7..." but "Nothing to boot" and "No bootable device. Retrying in 1s..."

It cycle non-stop & never boot to Windows 10 OS

I spent 2 full days trying to solve till now..... Any help is appreciated.

Thank you
 
Thanjs for the reply.

May I know do you have some sample script to do that ?

As I searched through internet most of the examples are using qemu-img convert
 
From 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

And it works with TAB-completion too
 
Thanks for the info. I will try that & feedback.

BTW, have you tried using this method. yourself & it works ?
 
I managed to import successfully as Harddisk (ide0) & tested each of the format:-
qm importdisk 888 image-flat.vmdk local-storage --format qcow2
qm importdisk 888 image-flat.vmdk local-storage --format raw
qm importdisk 888 image-flat.vmdk local-storage --format vmdk

None of them work. The VNC console show "No bootable device. Retrying...."

I check the source file using qemu-img info image-flat.vmdk
image: image-flat.vmdk
file format: raw
virtual size: 30G (32212254720 bytes)
disk size: 30G

I also unzip the mergeide.zip & update the registry in Windows OS. Shutdown the VM & run vmware-vdiskmanager to create image-flat.vmdk

Is there anything wrong with the vmdk image or imported image or something else ?
 
did the vm boot with efi? if that is the case you have to change the vm from seabios to ovmf
 
Hi Dominik,

YESsss. BIOS changed to OVMF (UEFI). It works !.. Thank you.

However, the windows display is fixed at 800x600 & device driver is "Microsoft Basic Display Driver". The system resolution is grey off & I unable to change to a higher setting like 1920x1080.

Other natively created VMs by Proxmox with the same OS & display driver do not have this problem & all can set to 1920x1080.

Do you have any hints how to set to FHD ?

Thanks
 
you can change the display resolution with ovmf by either using spice as a display or changing it in the ovmf boot menu
quote from our docs:

When using OVMF with a virtual display (without VGA passthrough), you need to set the client resolution in the OVMF menu(which you can reach with a press of the ESC button during boot), or you have to choose SPICE as the display type.
 
I have change in ovmf boot menu & reboot it display the correct resolution as set.

But it was only one time. The next power on it went back to the low resolution.

May I know how to set it as permanent ?
 
I have been trying to get this working, to no avail.

root@proxmox:/mnt/pve/VirtualMachines# /root/ovftool/ovftool vi://root@172.20.252.250/Netbox . Enter login information for source vi://172.20.252.250/ Username: root Password: ********** Opening VI source: vi://root@172.20.252.250:443/Netbox Opening OVF target: . Writing OVF package: ./Netbox/Netbox.ovf Transfer Completed Completed successfully root@proxmox:/mnt/pve/VirtualMachines# cd Netbox/ root@proxmox:/mnt/pve/VirtualMachines/Netbox# qm importovf 101 Netbox.ovf VirtualMachines --format qcow2 Formatting '/mnt/pve/VirtualMachines/images/101/vm-101-disk-0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=metadata compression_type=zlib size=42949672960 lazy_refcounts=off refcount_bits=16 transferred 0.0 B of 40.0 GiB (0.00%) transferred 409.6 MiB of 40.0 GiB (1.00%) <SNIP> transferred 40.0 GiB of 40.0 GiB (100.00%) root@proxmox:/mnt/pve/VirtualMachines/Netbox# root@proxmox:/mnt/pve/VirtualMachines/Netbox# qm set 101 -efidisk0 VirtualMachines:101/vm-101-disk-1.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K

Then I added an "EFI Disk"

proxmox_VM_config_change_for_EFI_Disk.png

Then I connected the "EFI Disk" to the VM, so that it matched the output shown on the Hardware screen for that disk.

update VM 101: -efidisk0 VirtualMachines:101/vm-101-disk-1.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K root@proxmox:/mnt/pve/VirtualMachines/Netbox#

But when I boot, I get this.

proxmox_EFI_shell.png
 

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!