How to clone entire VirtualBox OS to a new PC (real-hardware)?

Using converttoraw feature of virtual box and DD.

See: http://techokarma.blogspot.com/2008/10/v2p-virtual-to-physical-for-virtualbox.html

This assumes you have a reasonable knowledge of linux.


Quick trick to copy over a network: use linux netcat (nc). Using this method you do not have to convert to a raw image as dd will copy literally everything from the source drive.

Use your choice of linux live discs to boot both the physical machine and virtual machine, make sure both have network access and write down the IP addresses of both. Switch to root (sudo su). Find out what your drive paths are using fdisk -l

On the destination machine:

nc -l 10000 | dd of=/dev/sda bs=64

Command syntax:

nc -l <port#> | dd of=<destination drive> bs=<size in bytes>

Block size (bs) can be whatever you want, I try to keep it fairly small.

On the source virtual machine:

dd if=/dev/sda bs=64 | nc 192.168.0.100 10000

Command Syntax:

dd if=<source drive> bs=<size in bytes> | nc <destination ip> <destination port#>

Block size (bs) at the source and destination must match. I always set the destination machine up to reduce sending errors. There is no progress bar, just wait for the bash prompt to return and you are good to go. Remove the live discs and reboot.