Page 1 of 1

Cannot create the disk image "windows.vdi": VERR_ALREADY_EXI

Posted: 27. May 2015, 18:08
by Ogami musashi
Hello,

I'm runing a linux host, and would like to convert a physical windows 7 (installed first) to a VM.

I'm following the virtualBox tutorial on wiki.archlinux
The plan is to first create a windows disk image on an external drive (fdisk says it is NTFS/exFAT) using

Code: Select all

{ dd if=/dev/sda bs=512 count=$(cat /sys/block/sda/sda1/start) ; dd if=/dev/sda2 bs=512 count=$(cat /sys/block/sda/sda2/size) ; } | VBoxManage convertfromraw stdin windows.vdi $(( ($(cat /sys/block/sda/sda1/start) + $(cat /sys/block/sda/sda2/size)) * 512 ))
However when trying the creation of windows image i get stuck with this error:

Code: Select all

Error code VERR_ALREADY_EXISTS at /build/virtualbox/src/VirtualBox-4.3.28/src/VBox/Storage/VDI.cpp(607)....Cannot create the disk image "windows.vdi": VERR_ALREADY_EXISTS
The VERR_ALREADY_EXISTS error seems to have many manifestation so i can't find an already existing post with a solution.

Can somebody help me?

Thanks

Re: Cannot create the disk image "windows.vdi": VERR_ALREADY

Posted: 27. May 2015, 19:11
by mpack
You say you are running a Linux host, so which Win7 machine are you trying to P2V? Is this a different host, or another partition on the same host PC? If it's the former then Disk2VHD would be a much better choice as a disk imager than some creaking old copy of dd.

VERR_DISK_EXISTS suggests to me that you already have a VM called "Windows", and the folder already contains a file called "Windows.vdi". Not so?

I'm not at all sure how well VirtualBox will cope with translating a byte stream "stdin" to a block base output. It certainly gets my hackles up, but a Linux expert would be better placed to comment.

Finally, I'm not big on parsing dd command lines... but do I gather that you are trying to clone the "sda2" partition? If so then resulting disk image will be non-bootable. P2V'd disk images need to be whole disk images.

Re: Cannot create the disk image "windows.vdi": VERR_ALREADY

Posted: 28. May 2015, 10:03
by Ogami musashi
Hello,
EDIT: ah i found the windows.vdi! don't know why i didn't find it in the first place.

Now you're remark about not booting kind of bugs me, here is my configuration:

The host for the windows VM would resides on the same machine yes. i have the partition that way( knowing that windows was installed first then dual booted with linux):

sda1: 100 system volume information (containing the MBR if i'm not mistaken)
sda2: the windows installation partition

...
sda3..sda5: Linux partitions

sdb: the external disk on which i wish to install the VM





I'll try Disk2VHD and/or VMware converter

Re: Cannot create the disk image "windows.vdi": VERR_ALREADY

Posted: 28. May 2015, 10:29
by mpack
Well, as I said, what you are doing would not work anyway, since "sda2" is not a disk (it's only a partition), and therefore an image of it will not be a disk either.

You need to image the entire disk, and then use a partition manager to eliminate unwanted partitions from it. Or, perhaps smarter imaging tools are now available for Linux - the crudeness of dd for this task is a large part of your problem. You want a tool that images the entire disk, but lets you skip partitions, and which creates a modern image format such as VDI or VMDK.

Re: Cannot create the disk image "windows.vdi": VERR_ALREADY

Posted: 28. May 2015, 10:41
by Ogami musashi
Yes you're probably right! I'll try dd (i edited my post, there was indeed an existing windows.vdi) and if it doesn't boot then i'll try converters yes!

Thank you!