existing WinXP to .vdi

This is for discussing general topics about how to use VirtualBox.
bjlockie

existing WinXP to .vdi

Post by bjlockie »

How do I convert an existing partition (WinXP) to a .vdi file?
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post by stefan.becker »

You can read the User Doc, that solves your Problems => 9.8.
quackking
Posts: 19
Joined: 11. Jun 2007, 16:38

Post by quackking »

I don't think this answers the question bjlockie is asking. Here is why.

I read 9.8 and it does not say how to copy/convert from the native partition which is referenced by the VMDK file to an actual .vdi file. Instead the VMDK image passes read/write requests from Virtualbox through to the original hard drive. I think bjlockie wants to create a 'vdi mirror' of the original drive.

Am I missing something? Is it possible to convert an existing Windows system image (in my case, a Win2K install which takes an entire hard drive that I have access to and can either temporarily install into an Ubuntu Feisty box, or can network to) into a .vdi file?

Ideally there would be something equivalent to the old DOS "Xcopy" command, but it would be called "vdicopy"

eg.

vdicopy <source hard drive> <destination vdi file>

I am aware that the destination VDI might need to be tweaked for HALs etc.

I wonder if one of the PC migration tools would work..
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Transfer a physical partition to virtual disk

Post by Ingo »

I'm also looking for a solution to transfer a physical installation into an image.vdi. This howto http://www.virtualbox.org/wiki/Migrate_Windows assumes that we already have an image.vdi but don't declare how to get it. And it seems there is nobody here who has made this work before. Maybe this is a way to do it:
- create a virtual disk with enough space to hold all files from the existing partition (may be smaller).
- create an image for raw hard disk access from the existing partition.
- bind both images as harddisks (e.g. D: and E: ) to a virtual machine with the desired OS (eg. WinXP).
- start the virtual machine and copy all data from the partition to the virtual disk.
- create a new VM with the copied virtual disk, try to boot it, fix it with the Installation CD (repair, console fixmbr etc.).
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Transfer a physical partition to virtual disk

Post by Ingo »

OK, I've done it for Windows XP like this:

1. have a running WinXP virtual machine
2. create a writethrough virtual disk for the physical partition
 Edit: :

Code: Select all

VBoxManage internalcommands createrawvmdk -filename .VirtualBox/VDI/WinXPraw.vmdk -rawdisk /dev/hd[a..z] -partitions [1..9] -relative
Attention! Read carefully VirtualBox User Manual chapter 9.9!
Warning: Raw hard disk access is for expert users only. Incorrect use or use of an outdated con?guration can lead to total loss of data on the physical disk. Most importantly, do not attempt to boot the partition with the currently running host operating system in a guest. This will lead to severe data corruption.
 
3. create a target disk image to just hold all stored files from the physical partition
4. attach the physical disk as primary slave
5. attach the target disk image as secondary slave
6. start the WinXP virtual machine
7. format target drive F:
8. don't forget to set it active (set boot flag) in the disk manager
9. to really copy all flags and whistles I use

Code: Select all

xcopy D:\ F:\ /s /e /c /q /g /h /k /o /x /y
you should get one error message "access denied" for the "System Volume Information" folder
 Edit: : if you get more then something is going wrong. 
10. shut down your VM
11. create a new VM with the coppied virtual drive as primary master
12. mount the Windows Setup CD
13. repair your copy, see http://www.virtualbox.org/wiki/Migrate_Windows

that's it and should always work as long as repair does it.
Last edited by Ingo on 8. Sep 2007, 20:16, edited 3 times in total.
bernstein
Posts: 4
Joined: 5. Sep 2007, 14:54

Re: Transfer a physical partition to virtual disk

Post by bernstein »

Ingo wrote:OK, I've done it for Windows XP like this:
thanks for the info, will try this with a my current ubuntu install
is probably a little easier because linux shouldn't need to be fixed in the last step

this should really be added to the documentation or at least to http://www.virtualbox.org/wiki/Migrate_Windows
ebgonline
Posts: 2
Joined: 7. Sep 2007, 12:46

Re: Transfer a physical partition to virtual disk

Post by ebgonline »

Ingo wrote:OK, I've done it for Windows XP like this:

1. have a running WinXP virtual machine
2. create a writethrough virtual disk for the physical partition

Code: Select all

VBoxManage internalcommands createrawvmdk -filename .VirtualBox/VDI/WinXPraw.vmdk -rawdisk /dev/hda -partitions 1 -relative
3. create a target disk image to just hold all stored files from the physical partition
4. attach the physical disk as primary slave
There i become a problem. After creating /mypath/xp.vmdk i found xp.vmdk and xp-pt.vmdk in /mypath, but i can't let Virtualbox know.
If I use add (Hinzufügen) in VB Drivemanager i get an Error

Code: Select all

Assertion failed: [mid && children().size() == 0]
at '/home/vbox/vbox-1.5.0/src/VBox/Main/HardDisklmpl.cpp' (536)
in virtual nresult HardDisk::trySetRegistered(PRBool).

Please contact the product vendor.

Fehlercode: 0x80004005
Komponente: HArdDisk
Interface: lHArdDisk
     {fd443ec1-000f-4f5b-9282-d72760a66916}
Callee: IVirtualbox
     {76b25f3c-15d4-4785-a9d3-adc6a462beec}
if i use createrawvmdk with -register i get an error too.

My system is an IBM T23 with Kubuntu 7.04 on /dev/sda5, on /dev/sda1 is Win XP. I want to use the on /dev/sda1 installed XP in a virtual machine.

Bjoern
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Re: Transfer a physical partition to virtual disk

Post by Ingo »

ebgonline wrote:There i become a problem.
Not really! (become is not get) That means: "Da werde ich ein Problem." :-)))
I'm pleased to help you. But your error message looks not very good. It seems there is an internal error in the program code. I did the cloning with VirtualBox 1.4 and will check it with Vers. 1.5 now. You will hear from me later, its very early now.
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Hello ebgonline,
here I'm again. I've tried to create a raw disk image with VirtualBox 1.5 with no problems. I mounted a blank test partition to a WinXP virtual machine and formated it. So I don't know what your problem is.
But be aware that you have to modify my example to your needs! Read chapter 9.9 of the VirtualBox User Manual carefully.
My example will modify your first partition on the first IDE-drive!
That's normaly a system boot partition and may result in a data lost. The failed assertion indicates that there is an essential condition not given. It is a programmed abort, not an uncontrolled breakdown.
Thanks to the programmer!

I have changed my example.

Does the error also comes up if you use a new created blank partition on your hard drive?
chalkie1975
Posts: 8
Joined: 16. Oct 2007, 00:30

Post by chalkie1975 »

I get the "trySetRegistered(PRBool)" error too.

Why does this happen?
Brazen
Posts: 13
Joined: 18. Oct 2007, 16:13

PING

Post by Brazen »

Why not use something like PING (Partimage Is Not Ghost) to create a disk image and then restore the image to a vdi hard drive?
galv
Posts: 1
Joined: 3. Nov 2007, 19:13

Re: PING

Post by galv »

Brazen wrote:Why not use something like PING (Partimage Is Not Ghost) to create a disk image and then restore the image to a vdi hard drive?
I'm trying to do that with an old win98 install... no success so far ... can somebody give me some pointers??

Thanks
ebgonline
Posts: 2
Joined: 7. Sep 2007, 12:46

Post by ebgonline »

Jetzt habe ich kubuntu 7.10 mit Virtualbox 1.5.2 installiert.
Ich habe /dev/hda mit xp.vdmk "verlinkt".
Will ich die erzeugte Festplatte in Virtualbox einbinden, erhalte ich die Fehlermeldung:

Code: Select all


VD: error opening image file '/virtual/xp.vmdk' (VERR_ACCESS_DENIED).


Fehlercode:
0x80004005
Komponente:
HardDisk
Interface:
IHardDisk {fd443ec1-000f-4f5b-9282-d72760a66916}
Callee:
IVirtualBox {76b25f3c-15d4-4785-a9d3-adc6a462beec}

 
v3ctor
Posts: 2
Joined: 10. Nov 2007, 20:33

Post by v3ctor »

simonb@simonb-laptop:~$ sudo /usr/lib/virtualbox/VBoxManage internalcommands createrawvmdk -filename /home/simonb/.VirtualBox/VDI/WinXPraw.vmdk -rawdisk /dev/sda -partitions 1 -relative
VirtualBox Command Line Management Interface Version 1.5.2
(C) 2005-2007 innotek GmbH
All rights reserved.

ERROR: VMDK: cannot go backwards for partitioning information in '/home/simonb/.VirtualBox/VDI/WinXPraw.vmdk'
Error code VERR_INVALID_PARAMETER at /home/vbox/vbox-1.5/src/VBox/Devices/Storage/VmdkHDDCore.cpp(2112) in function int vmdkCreateImage(VMDKIMAGE*, const char*, VDIMAGETYPE, uint64_t, unsigned int, const char*, uint32_t, uint32_t, uint32_t)
Error while creating the raw disk VMDK: VERR_INVALID_PARAMETER
bella za
Posts: 1
Joined: 9. Dec 2007, 22:07
Location: Italy

Migrating from vmx to vdi

Post by bella za »

Hi everybody,
it's my first post in this forum.
I have some problem to create an XP guest into an XP host (it crashes during the disc formatting, just at the begin of the installation), so I'd like to use an VMWare .vmx image and migrate it into a .vdi image. Or maybe I could use a physical partition?
I've found in the forum instructions to migrate with Linux OS, but nothing in Windows XP.
Is there anybody which may help me? :)
Post Reply