Converting vmware images to proxmox images¶
Besides proxmox I am using both vmware workstation and virtualbox on my laptop, and I would like to be able to run some of the images on proxmox.
This should be possible according to:
https://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE
I tested this and had succes converting Vulnerable Pentesting Lab Environment: 1 from vulnhub to proxmox.
It was "pretty straight forward" .... considering I am still a proxmox noob, what I did was:
- Copy the vmware files from vulnhub, unzip them and open in vmware workstation or aternatively Virtualbox
- Export the virtual machine from vmware using the
file->Export to OVF ...option or if using virtualboxexport appliance- use the default Format settings, they should be fine.
VMWARE TIP - if you replace the .ovf extension with .ova during export you get a single file, this is what I usually do - Copy the
.ovafile to the/tmpdirectory on the proxmox server withscpusing
scp VPLE.ova user@<proxmox ip>:/tmp - Open the proxmox shell by selecting the node and pressing the
shellbutton - Extract
VPLE.ovato.ovfformat using
tar -xvf VPLE.ova
resulting in the following files in/tmp: -
From the
/tmpdirectory import the virtual machine to proxmox using
qm importovf 200 /tmp/exported-vm.ovf local-lvm
which is kind of tricky/not intuitive.
200 is the VM id that will used in proxmox, this has to be and id not already in use.
local-lvm is thestorageIDof your proxmox VM storage. This confused me to think that I need to specify the folder for my storage in ie.
/var/lib/vz/template/iso/which is wrong and gave me an error:root@proxmox:/tmp# qm importovf 200 VPLE.ovf /var/lib/vz/template/iso/ 400 Parameter verification failed. storage: invalid format - storage ID '/var/lib/vz/template/iso/' contains illegal charactersThis article helped me to use the command
pvesm statusto show available storage:root@proxmox:~# pvesm status Name Type Status Total Used Available % local dir active 236258376 20409668 205480676 8.64% vms zfspool active 1885863936 69213684 1816650252 3.67%the name column is the
storageID
The correct choice for me would be to usevms, but I actually made a mistake and choselocal.
I'll include the mistake in here to show how I fixed it later.Finally, running the correct command imported the
.ovffile!root@proxmox:/tmp# qm importovf 200 VPLE.ovf local Formatting '/var/lib/vz/images/200/vm-200-disk-0.raw', fmt=raw size=21474836480 preallocation=off transferred 0.0 B of 20.0 GiB (0.00%) transferred 204.8 MiB of 20.0 GiB (1.00%) transferred 409.6 MiB of 20.0 GiB (2.00%) transferred 614.4 MiB of 20.0 GiB (3.00%) transferred 819.2 MiB of 20.0 GiB (4.00%) transferred 1.0 GiB of 20.0 GiB (5.00%) transferred 1.2 GiB of 20.0 GiB (6.00%) transferred 1.4 GiB of 20.0 GiB (7.00%) transferred 1.6 GiB of 20.0 GiB (8.00%) transferred 1.8 GiB of 20.0 GiB (9.00%) transferred 2.0 GiB of 20.0 GiB (10.00%) transferred 2.2 GiB of 20.0 GiB (11.00%) ...... truncated transferred 20.0 GiB of 20.0 GiB (100.00%) -
Back in proxmox my VM showed as
200 (VPLE)and was turned off. Perfect!
I assigned a network interface from the hardware section of the VM usingaddand selecting the bridge I am using and virtIO as model.
Then I tried to start the VM but got I an error
TASK ERROR: storage 'local' does not support content-type 'images'
Ahhh, this is the mistake I mentioned. The solution is to select the harddisk in the VM hardware section and useDisk Actionto move the disk to a storage that supports images, in my case, you guessed itvms(which is a zfs pool with 2 disks in raid mirror mode)This worked and I was able to start the MV.
-
Bonus specific to the Vulnerable Pentesting Lab Environment: 1 VM
After staring the environment and logging in through the console I checked the ip with
hostname -Ias instructed and I only got
172.17.0.1and no address from my DHCP ?? weird.... Troubleshooting the issue showed me that my physical NIC (ENS18) was down.
I usedsudo ifconfig ens18 upwhich brought the interface up, but still no ip address from DHCP.
Fix was to renew the dhcp lease with
sudo dhclient -r
and then
sudo dhclientto request a new lease.This worked and output was:
Navigating to 192.168.1.102 from a machine on the network gave me the VPLE welcome screen.
I haven't tested all the VPLE applications, only a few that seems to work.
Remember to clean up your /tmp dir as the image files can consume a lot of space.