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.
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