2

This question is based on How can I clone a hard drive directly to a vdi image

ps. I've done this question only to share the answer.

PS. Obviously you need to install Virtualbox to be able to do it...

  • So you have to install vbox first? – Moab Mar 22 '19 at 00:40
  • what? didn't get it. Of Course? – Michel Conrado Diz Mar 22 '19 at 00:47
  • Clearly you cannot do it in Windows without installing something first, your answer does not include all one has to do before creating the image, so it is an incomplete answer. – Moab Mar 22 '19 at 01:18
  • Well, I assume that anyone who is going to read this has the basics of logic in their heads. Master a keyboard and mouse that will understand what this issue is that I raised. Obviously you need to install Virtual Box. The whole situation behind it is about Virtual Box... – Michel Conrado Diz Mar 22 '19 at 01:22
  • Quote VDI: This format is the VirtualBox-specific VirtualBox Disk Image and stores data in files bearing a ".vdi" – Michel Conrado Diz Mar 22 '19 at 01:24

1 Answers1

4

I've did this question only to share the answer.

cd  "C:\Program Files\Oracle\VirtualBox"

First check the driver with:

VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive1

\\.\PhysicalDrive0

\\.\PhysicalDrive1

\\.\PhysicalDrive2 ... and so on. If you see the right one with partitions and exact size, memorize the name.

Now you just do like:

VBoxManage convertfromraw \\.\PhysicalDrive0 MyImage.vdi --format VDI

Converting from raw image file="\\.\PhysicalDrive0" to file="MyImage.vdi"...

Creating dynamic image with size 120034123776 bytes (114474MB)...

I've tested just to copy a Windows install from a small SSD. And then I ran in Virtualbox 6.

  • the correct format for device path in windows is "\\.\PhysicalDrive0", you have typo and used one backslash in your examples – Majid May 25 '20 at 10:17
  • @Majid it is not a typo. The superuser's sanitation wrapped out the backslash. I should use ` I guess - so it would not be removed. If it was a typo, I wouldn't be able to reproduce it in my own machine tho. I gonna fix it thanks. – Michel Conrado Diz May 29 '20 at 04:15
  • 1
    i had to run the CMD as an administrator ;) – G-Cyrillus Dec 12 '20 at 10:12