How-to convert Ubuntu PC to VMWare virtual machine
Source
Install OpenSSH to enable SSH host.
sudo apt install openssh-server
Allow SSH through firewall.
sudo ufw allow ssh
Install and run
gparted
. (Or, in Ubuntu, just use disk utility. Xubuntu and Kubuntu don’t have it.)sudo apt install gparted sudo gparted
Start it and note the size and name of the disk in the top right corner. It should be something like «/dev/sdS (128.00 GiB)». The items in the list are partitions, we don’t want them.
So note the size - 128, and name — /dev/sdS
.
Target
Install VMWare workstation.
Download the Ubuntu image. Not the server one, the usual one, it has Live CD boot by default.
Create new Linux VM. Make disk size the same as in the computer. Use it in the VM.
Boot into live CD. When asked «try» or «install», select «try». You’ll get the user interface.
Go to Settings / Disks. Note the name of the disk, it should be something like
/dev/sdT
.Open terminal. Run the following:
sudo su ssh user@hostmachine "sudo -S dd if=/dev/sdS bs=4M" | dd of=/dev/sdT status=progress
Enter password twice and wait till completion.