0

I want to take my physical drive to a virtual drive. I think the only partition with data on it is sda3 from my df output below.

How can I create a file or .vdi from this drive to use with VMWare??

jmakes@testserver:~$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev             1948592       0   1948592   0% /dev
tmpfs             393940   16464    377476   5% /run
/dev/sda3       53419132 6518520  44164024  13% /
tmpfs            1969692     280   1969412   1% /dev/shm
tmpfs               5120       4      5116   1% /run/lock
tmpfs            1969692       0   1969692   0% /sys/fs/cgroup
tmpfs             393940      20    393920   1% /run/user/1000

1 Answers1

1

1. If you have Windows installed:

You can try VMware vCenter Converter Standalone, as suggested here: http://www.howtogeek.com/213145/how-to%C2%A0convert-a-physical-windows-or-linux-pc-to-a-virtual-machine/.

However the tool can only be used on a Windows machine, and you have to register an account on vmware in order to download it.

2. If you only have Ubuntu installed:

Install Virtualbox, either from the official repository or from Virtualbox's website. Then shut down your Ubuntu and use a live CD or live USB to perform the next step, as it's better to unmount the partition you are about to convert.

After your live system is booted, you should resize your installed Ubuntu partition if it's too big for your virtual machine, using GParted.

Open a terminal, and use this command to determine the partition of your installed Ubuntu system:

sudo blkid

Your Ubuntu partition would be in the form of /dev/sdXx (e.g. /dev/sdb1).

Then use this command in a terminal to create a raw image of sdXx:

sudo dd if=/dev/sdXx of={PATH_TO_FILE}/ubuntu.bin

{PATH_TO_FILE} should be somewhere with sufficient space to store your raw image.

Shut down live system and boot back into your installed Ubuntu system.

Open a terminal, and use this command to finally convert the ubuntu.bin file to virtual hard disk. As you need to use it with VMware, you should convert it to VMDK:

vboxmanage convertfromraw {PATH_TO_FILE}/ubuntu.bin ubuntu.vmdk --format VMDK

As a note, as far as I know, VMware cannot use .vdi file, .vdi is for Virtualbox.

PyGeek03
  • 168
  • @PyGeek03 - I am needing to convert a Linux (Ubuntu) drive. Is there a way to do this with Linux? – user2676140 Jun 19 '16 at 14:56
  • OK sorry, after some research, I've found an answer previously posted, it's the first and accepted one: https://askubuntu.com/questions/34802/convert-my-physical-operating-system-to-a-virtualbox-disk

    However because you need it to run in VMware so you need to save it as VHD or VMDK instead of VDI. Btw, the option in vboxmanage has changed, so I'll update the answer according to this link.

    – PyGeek03 Jun 19 '16 at 15:05
  • If I follow the tut here https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2010196 when I try to power on the VM I get an error message of the operation was cancelled by the user. – user2676140 Jun 20 '16 at 01:30
  • Well I'm not accustomed to VMware so I'm afraid I cannot help you with that error... What about converting the raw image to .vhd (just change ubuntu.vmdk --format VMDK to ubuntu.vhd --format VHD) and try again? And have you tried searching for that error message? – PyGeek03 Jun 20 '16 at 05:12