Convert a VMWare vmdk to Qemu raw For use on Proxmox

The other day I was playing with an Fog and I wanted to load it up on my Proxmox server.  They provided a VMWare images so I just needed to convert it which is very simple. I simply rand the following:

1
qemu-img convert -f vmdk FOGServer.vmdk -O raw images/104/vm-104-disk-1.raw

I manually created the configs for it although you probably could have done some of this from the gui.  First I needed to create the directory for it which would go in /var/lib/vz/images and I used the next number which was 104, created a dir by that name and placed the raw file in there.  Then I needed to find out the disk size.  For that I ran the following:

1
qemu-img info -f raw vm-104-disk-1.raw

Then I just copied an existing conf file.  They reside in /etc/qemu-server.  They are named by the VMID so 104.conf will be used for this config.  Make it look similar to this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# nano 104.conf
name: fog
ide2: none,media=cdrom
vlan0: rtl8139=F6:F0:4C:D3:72:1D
bootdisk: ide0
ostype: other
ide0: local:104/vm-104-disk-1.raw
memory: 4092
sockets: 1
boot: dc
freeze: 0
cpuunits: 1000
acpi: 1
kvm: 1

Then you can start it from the web interface.

Leave a Reply

Your email address will not be published. Required fields are marked *