0

I need to take an image of my Ubuntu 12.04 physical machine and keep it in a hard drive. I downloaded VMWare Converter Standalone, the only version I found as tar.gz is version 4. All the newer versions come as .exe only. Anyways, I followed instructions but then at this step:

Specify Source dialog

The This local machine option is disabled. I moved on with the second option writing the IP address of my local machine then at the next step, I couldn't specify a hard drive as a destination:

Specify Destination dialog

Even though I can do it on Windows normally:

Specify Source dialog on Windows

Specify Destination dialog on Windows

Any idea?

UPDATE

I want to take an image of Ubuntu Desktop and store in into external hard drive (1 TB) which is mounted on /media/hdd Later I want to install this image using VMplayer or any similar tool.

lsblk

screenshot of terminal

df -h | frep /dev/

screenshot of terminal

To dump: is this the right way to write the command?

sudo dd if=/dev/sda of=/media/hdd bs=1M

and what's the output file? Does it run on VMplayer? I'd appreciate more details on the steps.

  • 1
    What is the reason behind using a VM to only just take an image of your physical machine? Couldn't this be done through a live system, or a backup tool? – Takkat Mar 27 '15 at 11:31
  • Any suggestions? I'm looking for a safe option cuz I'm in a place where I cannot risk trying anything isn't safe and the machine must be up and running. For example, clonezilla looks a good option but I haven't tried it before and I cannot risk booting from a live CD on the same machine. – Shadin Mar 27 '15 at 11:41
  • 1
    You should then edit your question giving as many details as possible as to what exactly you need from your physical machine, why it should always be running (is it a server?), what safety concerns there are, do you have physical access, is LVM available, etc... – Takkat Mar 27 '15 at 11:58
  • 1
    no of=/media/hdd is wrong. did you mount your second drive to /media/hdd? then you have to write of=/media/hdd/disk.img. Afterwards you have to convert the image using qemu-img as written below. – JPT Mar 27 '15 at 17:04
  • 1
    Your disk is quite large. This will take a while. are you sure your /media/hdd has got 1 TB of space left? – JPT Mar 27 '15 at 17:09
2

I don't expect the exe version to work like you expect since they run in wine.

You absolutely should have a second disk in your PC and you should boot a live or backup system in order to create an image from your system. Booting a live system should never be dangerous to your current OS.

The most straight forward approach is this. It won't give you any software related problems:

Use dd (disk dump) to create an image from your disk, something like:

sudo dd if=/dev/sda of=/media/hdd/disk.img bs=1M

(if is input file, of is output file, bs is block size and 1M will speed up the transfer.)

After that convert the image using qemu-img:

qemu-img convert -f raw -O vmdk /media/hdd/disk.img /media/hdd/disk.vmdk

That's it.

You may delete /media/hdd/disk.img as soon as your VMWare works.

Be aware that you temporarily need up to twice the disk space of the size of your source disk, which means you cannot dump the system without a second hard drive.

Be careful with dd, if you output to disk (of=/dev/...) instead of a file, you will destroy your data on that disk. Apart from this it's totally safe. I did this a thousand times without backup ;)

Afterwards you can simply create a new virtual machine with similar specs as your real system. Then instead of creating a new disk choose the one we created using qemu-img.

Another idea: probably you can convert directly from disk

sudo qemu-img convert -f raw -O vmdk /dev/sda /media/hdd/disk.vmdk

but I haven't tried this yet. Would speed up the process by 90%

Note: you should boot a live CD for execution of DD else some data on the disk.img might be corrupt. This should not be a problem since most data that is modified (logs, temp) is not vital to a system. But eg. databases will be broken (in theory).

If you cannot boot a live CD, please run your system with as few processes as possible. Usually you can achieve this in Linux by calling sudo init 1. This will shutdown your GUI session and bring you to a text mode login.

| improve this answer | |
  • Thank you JPT. You made the process seems easy. Please bear with me I'd like to review the steps with you. I've updated my post. I'd be thankful if you could take a look. – Shadin Mar 27 '15 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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