Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is is possible to take a snapshot of a non virtual server (Ubuntu) and restore it in a virtual machine? I'm asking because I'd like to have an exact copy of my production server to use as a dev server. Note that I don't have physical access to the production server.

share|improve this question
    
Which virtualization solution are you using? VMWare has a physical-to-virtual converter: vmware.com/products/converter (and I hear that you can later convert VMWare images to other VM formats). –  Piskvor Jan 9 '11 at 15:05
1  
The relevant terms are P2V and V2V (p=physical, v=virtual). The VMWare tools work great for doing this for VMWare. –  Scott Pack Jan 9 '11 at 15:52

1 Answer 1

up vote 10 down vote accepted

You can use something like dd if=/dev/hda of=/tmp/path/server.img then use QEmu's qemu-img convert -f raw -O vmdk server.img server.vmdk (replace vmdk with vpc and the file extension with vhd for Xen or Hyper-V)

Otherwise most virtualization environments have tools to do what you want, this is just one way.

share|improve this answer
1  
Take care that the destination is not mounted on the source drive though - in this example, /tmp/path should be somewhere else than /dev/hda . –  Piskvor Jan 9 '11 at 15:20
1  
There is some warning here to consider about the drivers! If you have a physical server working fine and you image it and turn it virtual, beware things like drive controllers, NICs, etc. that are now the virtual hardware and may in some cases kill a server. Ubuntu shouldn't be quite so bad, but with Windows on special hardware it can easily cause blue screens. –  Bart Silverstrim Jan 9 '11 at 18:06

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.