Booting from a DD image

Discussions related to using VirtualBox on Windows hosts.
Post Reply
RichardS
Posts: 3
Joined: 21. Jul 2017, 16:41

Booting from a DD image

Post by RichardS »

Is it possible to transform a dd image into a bootable Virtualbox image?

Imagine I have a computer with Windows. I boot Linux from a USB stick and do a
dd if=/dev/sda of=/some-external-disk/backup.dd

Can I transform this backup.dd into something that I can run as VirtualBox image (and boot)?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Booting from a DD image

Post by mpack »

The answer is yes, but why on earth would you use such a clumsy and alien method of creating a virtual image of a Windows host?

Just download and run Disk2VHD. No need to boot from a Linux stick.

Caveat: VHD is not a very good format. I suggest converting it to VDI (VirtualBox's native format) using CloneVDI, and build the VM around the VDI instead.


Getting it into a usable virtual format is one thing. Getting it to boot is a different matter entirely - and has nothing to do with the container format. Basically your VMs hardware will be very different from that of the original PC. This is going to give you problems which are usually surmountable - but the details depend on the Windows version.
RichardS
Posts: 3
Joined: 21. Jul 2017, 16:41

Re: Booting from a DD image

Post by RichardS »

mpack wrote:Getting it to boot is a different matter entirely...
OK, so I assume thats the center of my question: How can I boot from a RAW image?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Booting from a DD image

Post by socratis »

I've deleted your duplicate post from the "Windows guests" subforum. According to the forum rules, duplicate posts are not allowed. It's not good etiquette...
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.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Booting from a DD image

Post by socratis »

RichardS wrote:How can I boot from a RAW image?
There is an advanced option to use a raw disk in VirtualBox. See ch. 9.9. Advanced storage configuration.

Problem is that everything I've seen so far (including the manual) talks about "disk" access, not a raw disk-image file, so I'm not sure if it's going to work or not. Give it a shot. I assume you have a backup, so even if things go wrong, you could always restore.

BTW, most users are reluctant to help others with raw access, because of the intrinsic possibility to do damage to your disk. Your case is a little bit more risk free, because you're only jeopardizing an easily replaceable file.
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.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Booting from a DD image

Post by mpack »

You seem to have missed the point a tad.
RichardS wrote:
mpack wrote:Getting it to boot is a different matter entirely...
OK, so I assume thats the center of my question: How can I boot from a RAW image?
I wonder why you dropped the second half of my sentence from your quote: ... - and has nothing to do with the container format ? Use raw format will make the problem harder, not easier.

The main problems arise from the content of the virtual disk, not how it's stored. But I can't tell you in advance what those will be. Why don't you follow the instructions I gave above, and then we'll see what problems you encounter. They will arise from the fact that your VM is not a perfect clone of the original PC.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Booting from a DD image

Post by mpack »

Socratis, the OP asks about a "dd image" in the first post. And in the topic title for that matter. This isn't a raw disk access problem. "Raw format" in this case refers to a dumb dump of every sector on the original drive, creating a file as big as the original drive.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Booting from a DD image

Post by socratis »

mpack, I noticed the title and the general idea, that's why I thought it the same type of access like a raw disk. Why is it not? You'd still have to go through the MBR, the partitions and the whole nine yards. What is the difference between trying to mount a .dd image versus a whole disk? The .dd is an exact replica of a disk, isn't it? What am I missing here?
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.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Booting from a DD image

Post by mpack »

One involves accessing the physical disk: VirtualBox only provides one way of doing that, but there's no need to go there since it was not the question asked.

The other involves accessing an image. VirtualBox provides many ways of doing that, all of them more convenient than the route suggested in post #1. That is the subject of this discussion.
RichardS
Posts: 3
Joined: 21. Jul 2017, 16:41

Re: Booting from a DD image

Post by RichardS »

I got myself a now notebook, my old one will be retired soon.

So my idea was this:
1) Create a dump of the old notebooks hard drive
2) Put it, as a file (DD, RAW, whatever), on the new notebook
3) Use VirutalBox, VMWare, whatever to run this image on the new notebook, so that I can use my old applications, files, etc (at least until my new notebook is setup properly)
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Booting from a DD image

Post by mpack »

Exactly. You have a standard P2V (Physical to Virtual) migration project, perfectly doable, and you should use the Disk2VHD method I outlined in my first reponse.

Disk2VHD will create the image directly in a virtual disk format - VHD. This format is not ideal for VirtualBox, so you use CloneVDI to convert this container format to the VDI, the VirtualBox native format. Then you build a VM around the VDI.

While your thought to use DD would work, it's very laborious and wastes a lot of time and disk space, because a dumb imager like DD is too dumb to even skip unused disk sectors. You'll end up with a humungous file that you still have to convert to a more practical format. Better to go directly from physical to usable virtual disk in one step.
rakesh
Posts: 1
Joined: 31. Mar 2020, 15:22

Re: Booting from a DD image

Post by rakesh »

how can convert clone-of-os.dd image on linux how can i run on VirtualBox image (and boot)?
please tell me procedure to convert clone-of-os.dd to clone-of-os.iso to boot into virtualbox?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Booting from a DD image

Post by mpack »

On a Windows host? I suggest you use CloneVDI with the "Compact" option enabled to convert the image to VDI. This assumes it's a whole disk image since a partition image would be useless.

You then build a VM around the VDI.

And p.s., you do not convert the dd image so an ISO. An ISO is an image (e.g. a dd copy) of a data CD or data DVD, neither of which is involved here.
Post Reply