can a VM be restored from a .qcow2 disk image?

jesus614

New Member
Oct 30, 2022
1
0
1
Hello, I had a problem with my managed VPS provider, the data was lost and I am not responsible.

It only sent me a disk image of the virtual machine in .qcow2 format and I have no idea how to use it to recover a cpanel account that I had there (1 website).

Could I use promox to restore this VM or at least mount the drive and explore the files and save the data?
 
You could create a new VM, then use qm importdisk and qm rescan YourVMID. It should then show up for that VM as unused disk which you could attach using the webUI. See: https://pve.proxmox.com/pve-docs/qm.1.html

You also might want to boot as Live Linux ISO inside the VM, as the qcow2 disk might not boot with wrong VM options.
 
Last edited:
I have a similar issue where I need to mount a previously used HDD in Proxmox after reinstalling. The HDD (4TB) was originally used for OMV, and it contains the following files:

- /dump
- /images/112/vm-112-disk-0.qcow2
- /lost+found
- /private
- /snippets
- /template

Based on my research, I discovered that the .qcow2 file (1.5TB) stores the VM data. I found some YouTube tutorials on how to restore it, but I don't have enough storage space to restore the VM to another HDD. Therefore, I need to utilize the main HDD (4TB) instead.

When I attempt to mount the disk from scratch in Proxmox, I only have the option to "Wipe Disk," which would erase all data. My question is: Is it possible to mount the HDD as it was in the previous installation, so I can access the OMV VM in Proxmox?
 
The 4TB disk should be mounted in a path in your Proxmox host, let's suppose /mnt/disk4tb. What I would do is:

- Create a VM with id 112. Install a similar OS to the one that ran the qcow2 disk (to be sure that I can read the filesystem).
- Add a directory type storage to Proxmox pointing to the path /mnt/disk4tb and make sure "disk image" is enabled in "Content".
- Check that browsing to that storage in the webUI does show the qcow2 disk.
- In Proxmox host run qm rescan 112. The disk should be added as "unused" to the VM. Attach the disk the VM.
- Boot the VM and mount the filesystem of the qcow2 disk, check it's contents, copy what I need, etc. Maybe even make the VM boot from that qcow2 disk.
 
  • Like
Reactions: fastrick
The 4TB disk should be mounted in a path in your Proxmox host, let's suppose /mnt/disk4tb.
And you need to mount that yourself using the CLI by adding a new line to the /etc/fstab or something similar. The GUI only allows you to work with empty disks.
 
  • Like
Reactions: fastrick
The 4TB disk should be mounted in a path in your Proxmox host, let's suppose /mnt/disk4tb. What I would do is:

- Create a VM with id 112. Install a similar OS to the one that ran the qcow2 disk (to be sure that I can read the filesystem).
- Add a directory type storage to Proxmox pointing to the path /mnt/disk4tb and make sure "disk image" is enabled in "Content".
- Check that browsing to that storage in the webUI does show the qcow2 disk.
- In Proxmox host run qm rescan 112. The disk should be added as "unused" to the VM. Attach the disk the VM.
- Boot the VM and mount the filesystem of the qcow2 disk, check it's contents, copy what I need, etc. Maybe even make the VM boot from that qcow2 disk.
I did it but the system doesn't boot. So I converted the qcow2 file to raw and mount it. The file inside is just from the openmediavault, so it doesn't have any filesystem. So I solved it the hard way: I mounted the raw file and made upload of all files to backup on the cloud.
 

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!