Page 1 of 1
Physical to virtual ?
Posted: 3. Nov 2009, 17:19
by dnaton
Hello,
Is there a way to transform a physical Pc to have finally a VM with all the applications installed on the physical PC ?
This is possible with WMware but is it possible with VirtualBox ?
Regards,
Damien
Re: Physical to virtual ?
Posted: 3. Nov 2009, 17:29
by mpack
Re: Physical to virtual ?
Posted: 3. Nov 2009, 17:45
by dnaton
Thanks : I think it exactly what I need

.
Regards,
Damien
Re: Physical to virtual ?
Posted: 3. Nov 2009, 17:51
by dnaton
One question more
Either pull the drive from the windows machine or copy the data with a low level image tool (like dd) to a USB drive or other removable media. If making an image, DO NOT image just the partition, this will not work!
Use VBoxMange convertfromfaw to convert the image or to copy from the drive you pulled from the windows machine.
If you are converting from the image, the syntax is just
VBoxManage convertfromraw ImageFile.dd OutputFile.vdi
What software can I use to make the image : Is for example Macrium Reflect good for this task ?
Regards,
Damien
Re: Physical to virtual ?
Posted: 3. Nov 2009, 18:23
by mpack
No idea, I've never used Macrium Reflect (I use Acronis Trueimage). However, just from the website, MR does seems to have the list of features I would want to see (*), such as whole image backup and ability to create a BartPE recovery CD (an ISO of such a CD is an essential tool for "restoring" the backup into a VM that doesn't have any OS installed on its virtual hard drive yet).
Re: Physical to virtual ?
Posted: 3. Nov 2009, 22:11
by Etepetete
I would suggest using the latest Knoppix (6.1) and the dd command as in the howto. I know for sure that it works. I've successfully cloned a physical machine that way.
Re: Physical to virtual ?
Posted: 4. Nov 2009, 05:17
by MarkCranness
Another vote for dd.
I tried various
UBCD4WIN disk image programs, and clonezilla as installed with
Parted Magic but none worked for various reasons.
dd worked (does need to be run from the Unix command line).
After import, you may need a few tweaks to get it to boot (I did), and might also need to worry about activation.
Do as much as you can in the VM setup to make it look like the original PC, DMI setup (look in the manual), DMIDecode on the original PC followed by setextradata in the VM to make it look the same, network card MAC address. This link may be useful:
http://forums.virtualbox.org/viewtopic.php?f=2&t=9697.
Boot first with a snapshot and no network access to see if it requests activation. If it does, revert the snapshot, tweak and try again.
Re: Physical to virtual ?
Posted: 4. Nov 2009, 07:24
by Etepetete
It is also not just done with only a few clicks and as MarkCranness noted you do have to pay particular attention to things you may have never encountered before. I have posted a step-by-step description of how I did it in the German forum here:
http://forums.virtualbox.org/viewtopic. ... 93#p103538. Even if you don't understand German you might want to take a look at it to get a feel of what it all entails. By the way, I didn't have activation problems thanks to the MergeIDE tool. And yes, if you don't configure the DMISettings of your VM correctly, you're in for blue screens and the like. (Speaking out of experience

)
Don't despair, go for it, once you succeed you'll be ten feet taller afterwards!
P.S. Don't forget to backup your work at regular intervals.
Re: Physical to virtual ?
Posted: 4. Nov 2009, 11:42
by mpack
Just for the record, I've used Acronis TrueImage to do at least three P2Vs, and two P2Ps, and all worked. Acronis is very fast too - because of compression and the fact that it understand NTFS and hence doesn't copy unused sectors: when backing up to a slow USB drive this is especially useful since it means a lot less data being written compared to dumb imagers.
MergeIDE btw will not prevent activation issues - it is purely about preventing a BSOD on startup when Windows fails to recognize the IDE HDD controller on the new hardware. I've never bothered with DMI stuff, because I wasn't trying to avoid a Windows activation message, all I cared about was not having to reinstall all my apps, or tweak all those Windows registry settings again to get things working the way I want.
Re: Physical to virtual ?
Posted: 4. Nov 2009, 13:00
by Etepetete
mpack wrote:MergeIDE btw will not prevent activation issues - it is purely about preventing a BSOD on startup when Windows fails to recognize the IDE HDD controller on the new hardware...
Thanks again mpack for making me smarter. As you know I spent quite some time gleaning the necessary info from this forum and other documentation. I obviously got something mixed up.
mpack wrote:...Acronis is very fast too - because of compression...
One question I have, as I understand it, the VBoxManage convertfromraw command can't work with compressed images. Did I misunderstand something? If I didn't what trick do you use to get around that?
Re: Physical to virtual ?
Posted: 4. Nov 2009, 16:32
by mpack
Etepetete wrote:mpack wrote:...Acronis is very fast too - because of compression...
One question I have, as I understand it, the VBoxManage convertfromraw command can't work with compressed images. Did I misunderstand something? If I didn't what trick do you use to get around that?
That's correct, "VBoxManage convertfromraw" cannot use the .tib files you get from Acronis, because they are not raw files. That's why I said you need to make a BartPE bootable CD (rather, an ISO image of that CD). You only need to create this once, then the CD can be used for all future P2V and P2P projects. Then you create your new VM with a new HDD, and boot up with the BartPE+Acronis ISO in the virtual CD drive - and basically follow the prompts to restore the image onto the VM hard disk. That's the theory anyway - basically it's exactly the procedure you would follow when doing a P2P migration with Acronis.
The only tricky bit I find, once you boot up the BartPE CD, is getting access to the media that the compressed image is stored on. It could be on a removeable USB drive... but I haven't had much luck getting USB to work reliably with VBox. An alternative is to access the image from a network shared folder (bear in mind that guest additions aren't installed at this point, so VBox shared folders are not available) - and I simply don't know how to get a network shared folder going after a BartPE CD boot. The only sure method I have involves some juggling beforehand using another VM to copy the image file into a temporary VDI which can be attached to my new VM as a second drive, which I know I
can access reliably after the BartPE bootup.
Re: Physical to virtual ?
Posted: 4. Nov 2009, 16:51
by Etepetete
Thanks mpack, you have convinced me to stick with a dumb imaging program.
It is enough for me dealing with dd than to do the type of juggling you are able to do. I'll just hope that sometime soon the VBoxManage createfromraw command will be able to handle compressed images. Having enough storage space for images is a prerequisite for using the dd command. Of course you can change my ways by implementing the possibility of using gzipped images into your fantastic CloneVDI tool. Then I would only need to use Clonezilla to image partitions and let your tool take care of the rest.
Re: Physical to virtual ?
Posted: 17. Nov 2009, 14:20
by mpack
Hi Erich, you may want to review
this discussion - since I investigated and found a much more convenient way to do P2Vs using Acronis and BartPE, that avoids all that VDI juggling and copying I mentioned before. This new way would be much faster than your preferred method using dd, so IMHO it would be worth your time to learn.
Re: Physical to virtual ?
Posted: 20. Feb 2014, 22:35
by MMMUser
Does anyone know if the CAT (cat /dev/sdg | VBoxManage convertfromraw stdin OutPutFile.vdi NUMBEROFBYTES) command from the "How to migrate existing Windows installations to VirtualBox" instructions is actually a dos command because I get a "'cat' is not recognizable as an internal or external command" (and a yahoo search returns info on a linux command)?????????????
Re: Physical to virtual ?
Posted: 21. Feb 2014, 02:18
by mpack
DOS is long dead, so nothing you read on this site will assume DOS - it will always be for Linux (as in the tutorial), or for Windows NT command console.
Anyway, the discussion above was state of the art in 2009. But this is 2014, and the preferred P2V tool today is Disk2VHD. You can still follow the Wiki if XP is involved, but ignore the step by step instructions and use Disk2VHD instead.