[SOLVED] export/import VM

tessus

Member
Oct 5, 2020
34
4
13
Toronto, Canada
I have a fairly nice VM that I would like to share with someone, who is also running Proxmox.

How can I export the VM (plus disk), so that they can import it on their Proxmox server? (same as cloud images in qcow2 or raw format, plus the VM meta data .conf file) Is there a way, or do I just copy the conf file and export the disk in whatever format? (No VM export command that packages everything into a nice file?)
 
I have a fairly nice VM that I would like to share with someone, who is also running Proxmox.

How can I export the VM (plus disk), so that they can import it on their Proxmox server? (same as cloud images in qcow2 or raw format, plus the VM meta data .conf file) Is there a way, or do I just copy the conf file and export the disk in whatever format? (No VM export command that packages everything into a nice file?)
Hi,
the easiest way to achieve this is by creating a backup of the VM and transfer it via some channel to the other host, where you can restore the VM from backup (also providing different storage targets, VMID, ecc.).

Also, backups are also rather Proxmox VE version independent, so if you are not running the same major version, the backup/restore path should work.
 
Thanks a bunch for the reply. Yes, this seems like a great way to exchange images between Proxmox users/servers. I am not sure why I didn't think of this myself.

Ok, now let's turn it up a notch: there might be a necessity to make an image available to people who are not using Proxmox. What is the best way then? There are a bunch of different image formats, but it usually isn't a problem to convert them if necessary. Is there an export command, or do I just have to convert my hdd-zfs:vm-130-disk-0 to a qcow2?
 
Thanks, I know how to convert images. I was asking whether there was an export command in Proxmox (something in pvesh or another tool), or whether I had to convert the image myself.

After that it would be good to know whether I can do that while the VM is running or from a snapshot, or do I need to shutdown the VM.
 
Thanks, I know how to convert images. I was asking whether there was an export command in Proxmox (something in pvesh or another tool), or whether I had to convert the image myself.
That is the export command. You name a LV/zvol/image file of a disk and it will export it as a image file.


After that it would be good to know whether I can do that while the VM is running or from a snapshot, or do I need to shutdown the VM.
You usually want to clean the image first, removing everthing custom/unique like network config, MACs, SSH fingerprints, logs etc so its possible to run multiple VMs based on that image in parallel. See for example: https://gist.github.com/zc640618/64e3a468b24b3d619aae0909864da120
 
Thanks again for your reply.

That is the export command. You name a LV/zvol/image file of a disk and it will export it as a image file.

Ok, so the latter of the 2 options in my question. ;-)

You usually want to clean the image first, removing everthing custom/unique like network config, MACs, SSH fingerprints, logs etc so its possible to run multiple VMs based on that image in parallel. See for example: https://gist.github.com/zc640618/64e3a468b24b3d619aae0909864da120
Thanks, I also wrote a similar script a long time ago.
 

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!