[SOLVED] Migrating a linux machine to a Proxmox hosted VM

variableman

New Member
Jun 14, 2021
19
2
3
58
I recently got a Dell R720. I'm running Proxmox as my hypervisor. I also have a physical machine that hosts my website that I would like to migrate to a vm running on proxmox. I have been able to capture an image of the physical machine using dd but I am unsure what to do with it in proxmox. I have been able to mount the drive so that proxmox has access to the image file but am unsure how to copy it to my new vm. Any help is very much appreciated.

Cheers everyone.
 
When you already have a .raw or .qcow2 file then you can move it (in a default PVE installation) to
Code:
/var/lib/vz/images/100/vm-100-disk-0.raw
where you have to replace 100 with the ID of the VM that you want to use (target VM so to say) and the 0 with some unused number (so 0 is only OK if you have no disks in the VM).

Then run
Code:
# qm rescan --vmid 100
rescan volumes...
VM 100 add unreferenced volume 'local:100/vm-100-disk-10.raw' as 'unused0' to config

You can then double-click the entry in the Hardware Overview of your VM in the PVE GUI to attach the unused disk as IDE/SATA/...
 
When you already have a .raw or .qcow2 file then you can move it (in a default PVE installation) to
Code:
/var/lib/vz/images/100/vm-100-disk-0.raw
where you have to replace 100 with the ID of the VM that you want to use (target VM so to say) and the 0 with some unused number (so 0 is only OK if you have no disks in the VM).

Then run
Code:
# qm rescan --vmid 100
rescan volumes...
VM 100 add unreferenced volume 'local:100/vm-100-disk-10.raw' as 'unused0' to config

You can then double-click the entry in the Hardware Overview of your VM in the PVE GUI to attach the unused disk as IDE/SATA/...
Dominic,

The directory you reference (/var/lib/vz/images/...) is empty on my system. The vm disks I create seem to be referenced in the /dev/pve directory. I've attached a picture below rather than a long winded approach of explaining. I didn't do anything unusual when installing ProxMox VE. So, would I copy the raw image into this location instead?
Untitled.png
 
Dominic,

The directory you reference (/var/lib/vz/images/...) is empty on my system. The vm disks I create seem to be referenced in the /dev/pve directory. I've attached a picture below rather than a long winded approach of explaining. I didn't do anything unusual when installing ProxMox VE. So, would I copy the raw image into this location instead?
View attachment 26818


Ahhh... empty for my case. I see what you are doing. I'll give it a try!
 
Ahhh... empty for my case.
Yes :) The path /var/lib/vz belongs to the storage (of PVE) "local" and it seems you have created all your VMs on the storage "local-lvm". This is completely fine. I just find it easier to manually copy files around in the "local" storage. You can then use the "Move disk" command in the Hardware Overview of your VM in the GUI to move the disk images between storages without knowing any command line syntax about them.

I have been able to capture an image of the physical machine using dd
Do you mean that you now have a single file that contains your entire physical disk? As with other formats, files can basically be .raw files even if their filename does not end in .raw. So if you have used dd and now have a single file, then you probably have a raw file.
 
Last edited:

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!