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.

The situation is; I am running a web server (Ubuntu 10.10 server) on virtualbox v.4 inside Ubuntu 10.10 Desktop and now I want to clone entire web server on my brand new PC. Please help me with this, how do I do it?

Thanks!


I found a possible solution here: http://www.turnkeylinux.org/blog/convert-vm-iso

share|improve this question

migrated from stackoverflow.com Apr 20 '11 at 10:22

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

    
You mean virtual to physical (V2P)? –  Matt H Apr 20 '11 at 10:38
    
Yes, something like that but even easer way like creating bootable DVD of Virtual OS, something like recovery DVD.. –  Himalay Apr 20 '11 at 11:41

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
thanks for the reply. Yes, v2p may work if I copy raw into a attached HDD. But what if I need to clone into a new laptop which has no OS installed? Do you think will it work if I copy raw into a USB pendrive then attach with new laptop and boot from Live-CD then do dd?? –  Himalay Apr 20 '11 at 11:36
    
@Himalay, Not sure about that. –  Matt H Apr 20 '11 at 22:17

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.

share|improve this answer

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.