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.
Asked
Active
Viewed 1,811 times
7
-
Which virtualization solution are you using? VMWare has a physical-to-virtual converter: http://www.vmware.com/products/converter/ (and I hear that you can later convert VMWare images to other VM formats). – Piskvor left the building Jan 09 '11 at 15:05
-
1The relevant terms are P2V and V2V (p=physical, v=virtual). The VMWare tools work great for doing this for VMWare. – Scott Pack Jan 09 '11 at 15:52
1 Answers
10
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.

Chris S
- 77,945
- 11
- 124
- 216
-
1Take 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 left the building Jan 09 '11 at 15:20
-
1There 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 09 '11 at 18:06