Page 1 of 1
Existing harddisk to .vdi file
Posted: 15. Oct 2010, 16:27
by cyberclaus
Hi,
I'm useing VBox on a Mac. And I still have on older Linux computer. This I would now to turn off. But in case of .... I thought by myself: Saving the entire Linux harddisk to an .ISO-file and then convert it to an .vdi file (which is used in VBox). Can this file be processed by VBox? How can I convert it? Has anyone of you out there an information for me?
Thanks in advance
Greets
cyberclaus
Re: Existing harddisk to .vdi file
Posted: 15. Oct 2010, 16:40
by Perryg
Re: Existing harddisk to .vdi file
Posted: 15. Oct 2010, 19:42
by ChipMcK
Wow, Perryg has quite a list!
Important item: the source is linux
So P2V tool for linux is required, such as VMware vCenter Converter Standalone, which has a version for linux,
http://downloads.vmware.com/d/info/data ... dalone/4_0.
I have used the Windows version of the tool. Got it right on 2nd try. Disk2VHD (Windows only) is easier,
http://technet.microsoft.com/en-us/sysi ... 56415.aspx
best
Re: Existing harddisk to .vdi file
Posted: 19. Oct 2010, 11:06
by cyberclaus
Thank you for your answers.
I tried the VMWare Converter but failed. It recognized the lokal (Linux = Source) computer but not the Mac (Destination) in the net. (A general system error occured.) No idea where and what.
Isn't there another way to convert it. My problem is time - that I don't have. I will have the Linux harddisk here for a longer period of time but not the Linux computer. From next week on can I only connect the harddisk via an USB set to the Mac. I thought to manage all that on the Mac.
I appreciate all help I can get.
Thanks
Re: Existing harddisk to .vdi file
Posted: 19. Oct 2010, 12:22
by mpack
Then you have to do it the slow way: use the Linux utility "dd" to copy an image of your disk to a file. Of course this image will be the same size as the original disk, so you'll need an even larger disk to store it (possible USB external, though that will slow things down by x4 or more). Once you have the image you can use "VBoxManage convertfromraw <inputfilename> <outputfilename.vdi>" - see the VBox user manual for exact syntax, but don't worry about the other options since the defaults are fine for you.
You should be warned also that the above procedure changes the UUID of the drive, which causes some Linux installations to fail to boot. You would have to modify your boot script to identify the boot disk using its new UUID (sorry about inaccurate terminology, though I know in vague terms what needs to be done, I'm not a regular Linux user).
Re: Existing harddisk to .vdi file
Posted: 19. Oct 2010, 20:26
by cyberclaus
Thank you very much.
All you beskribed worked well !!!
But ....
The new virtual box refuse to boot. FATAL: No bootable medium found! System halted.
Has anyone a hint for me?
Greets
Re: Existing harddisk to .vdi file
Posted: 19. Oct 2010, 22:23
by mpack
That means it didn't go as well as you hoped. Bear in mind that the VBox "convertfromraw" feature is extremely dumb: it'll basically wrap a VDI header around whatever you give it, so the fact that it seemed to succeed is no guarantee that it did anything sensible. The main thing to be sure of is that when you dd the original drive you image the entire disk, and not just the root partition. A Linux partition isn't bootable on its own.
Re: Existing harddisk to .vdi file
Posted: 20. Oct 2010, 06:06
by ChipMcK
I think that is a reference to GRUB partition
There are a number of threads about getting GRUB installed afterwards, some dealing with raw vmdk files; I do not recall more detail, but they are shattered across the forums
best
Re: Existing harddisk to .vdi file
Posted: 20. Oct 2010, 10:55
by cyberclaus
mpack, you're absolutely right.
But to do this do I need another (bigger) harddisk. I'm gonna try and report later this or next week.
Thanks alot.
Re: Existing harddisk to .vdi file
Posted: 21. Oct 2010, 14:42
by cyberclaus
Okey, here I'm back - smiling -
First I shrank the partitons and copied every partiton to a new smaller disk - each with dd. Then I tock dd over the whole disk and created one file of that. The Vbox-Tool created the vdi-file. All in 3 or 4 hours.
Lilo had some trouble and refused to boot. I booted with a dvd (kernel) and switched then to the disk. I had no luck with Lilo and so I changed to Grub. This workes fine.
My old Linux runs now in a box - the same way it did before. That's what I wanted.
Thank you all guys.
Re: Existing harddisk to .vdi file
Posted: 24. Oct 2010, 04:10
by Winipulator
This is an interesting thread. I've dealt with a similar issue but took a slightly different approach.
Remember the old PowerQuest software called Drive Image? I converted the DOS rescue floppies to a bootable ISO, burned it to CD, used it to copy my C: drive to PQI files onto a different partition (using maximum compression, the files were altogether much smaller than the partition being copied). Then I went back into Windows, put those PQI files inside the same ISO with an ISO editor. I then used the ISO in a VirtualBox DOS VM to load up Drive Image, and extracted the PQI files to the VirtualBox VDI. Then I created a new Windows XP VM and used the VDI created in the DOS VM with it. Its bootable on its own and ran perfectly. You can download my ISO from my blog and read more details on it. IDK if I'm allowed to post links here so I won't risk it, so just google my name to find my blog. All you need is my ISO, an ISO editor, your own Drive Image floppies, as its a commercial program and I can't provide them with the ISO.
My solution does involve a few steps. But the results are great. Hopefully one day, VirtualBox will provide native PQI support.