how to create an image from a HD

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
traeumer
Posts: 7
Joined: 23. Jan 2014, 11:24
Primary OS: Mac OS X other
VBox Version: OSE Fedora
Guest OSses: windows 7, Fedora, linuxes

how to create an image from a HD

Post by traeumer »

Hi,

i had to remove a HD from a Laptop. The HD is formatted with NTFS, two partitions, and running Windows XP.
Now I want to create a image file to use with a virtualbox ( maybe vmware player also) VM.
The original HD should remain unchanged.

So far I have found instructions how to use the HD:

Code: Select all

sudo VBoxManage internalcommands createrawvmdk -filename /Volumes/<PATH>/xp.vmdk -rawdisk /dev/disk3

sudo VBoxManage storageattach xp1 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /Volumes/<PATH>/xp.vmdk

sudo /Applications/VirtualBox.app/Contents/MacOS/VirtualBox
 
or tools to create the imgage under windows - but I need to create the image from the HD on my Mac leaving the HD untouched.


Any help appreciated
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: how to create an image from a HD

Post by mpack »

That command doesn't image the disk, it creates a raw-access wrapper around the physical disk. I really wouldn't recommend that, as there's danger that the host and guest will try to access it at the same time, and corrupt the disk.

Better would be to image the disk to any format supported by VirtualBox (i.e. VDI, VMDK, VHD - in that order of preference). There are a number of tools around which can do a good job of this task, producing a compacted image file. There are further tools that will do a half-assed but working job of it, producing a full size disk image that you should compact manually. On a Windows host I would image the disk using Disk2VHD then convert VHD to VDI using VBoxManage or CloneVDI. On a Mac - I'll leave recommendations to a Mac user.
traeumer
Posts: 7
Joined: 23. Jan 2014, 11:24
Primary OS: Mac OS X other
VBox Version: OSE Fedora
Guest OSses: windows 7, Fedora, linuxes

Re: how to create an image from a HD

Post by traeumer »

thanks for your reply. I know that my commands do not image the disk - I justed wanted to show that I have thought about the problem, before just asking a question :wink: But I've read the warnings in the manual too.

So, waiting for the Mac user replying.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: how to create an image from a HD

Post by mpack »

If the drive is in an external caddy, which I'm assuming it is, can't you just take it to a Windows PC and run Disk2VHD on it? I doubt that the Mac has anything simpler.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: how to create an image from a HD

Post by socratis »

traeumer wrote:So, waiting for the Mac user replying.
I once had to do the same thing to an old NT4 system. I used a WinXP (maybe Win7) machine, where I mounted the external HD via USB (1.0), run Disk2VHD and saved the result in a read-write shared folder. Worked like a charm. The VM built around said drive is still running without an issue...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply