Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have created a Virtual Machine in VirtualBox to test Ubuntu and I really like it. Since I've already made a great deal of customization on that virtual machine, it would be a pity to have to re-create it from scratch if one day I wanted to use my old PC as a Linux workstation.

Is there a way to transform the virtual machine (copying the hard drive content, settings, etc..) into a real PC?

share|improve this question

migrated from stackoverflow.com Nov 30 '11 at 14:04

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 2 down vote accepted

Not sure if this would work.... But this is what I would try... Edit: Tried it and it WORKS !

Add an extra harddrive to the VBox host that is at least as big as size of the virtual disk. Add this to the VM as a RAW disk. (Vmdk creation must be done from command line: See VBox docs.) Boot the VM from a GNU Parted or CloneZilla ISO and copy the virtual disk to the RAW disk. Shut down the VM. (I used GPartEd.)

Stick the RAW disk in another machine and boot. (You may have to edit the Grub config a bit to get it to boot.) Let Linux sort out the hardware differences and you should be good to go.

Nice thing is that it doesn't touch the VM so you can do some experimenting without risk of loosing the VM content.

share|improve this answer
    
I followed the process and reached the part where, using GParted, you copy the data to the new hdd. It has now been fully copied (12.98 GiB out of 12.98 GiB) but the progresss bar is still wiggling around, and it's been doing so for about 20 minutes already. Is this normal? May I shut it down? –  Gabriele Cirulli Nov 10 '11 at 17:31

As far as I know, is not posible... but!!!! you can try this.

  • In the virtual machine: boot with a linux livecd or and ISO image.
  • Using the console try the dd command (HardDisk Backup)
  • Save in an external drive or pipe with ssh
  • Restore in the new harddisk using dd to.

Or if the virtual machine is a Linux distro, you can rsync the files, and at the end re-run grub-install.

rsync -avz --progress [where] [to]

share|improve this answer
    
My solution does essentially the same thing without the need to make an intermediate copy. Don't thing rsync is going to work like you propose. No way in hell you get /dev and /proc copied correctly that way. –  Tonny Nov 1 '11 at 9:39
    
rsync is the only way to copy correctly the files (/proc/* /dev/*), with permissions, links, etc, etc.... cp will never do the job.... –  alsotoes Nov 1 '11 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.