How to resize/grow a VMware or Virtualbox disk

So you created a virtual machine… And after a month you notice that you run low on disk space…

If you have disk space left on your host machine you can grow the disk and then let the running guest OS resize it to the new given size.
This action requires VirtualBox to be installed.

Next is to grow the disk to the new disk size. This can be done in almost every operating system.
These are the tools I recommend (the commands are examples, use with care!):

Windows 10
http://www.partition-tool.com/personal.htm

Linux on Ext4
https://linux.die.net/man/8/resize2fs

Linux on XFS
https://linux.die.net/man/8/xfs_growfs

FreeBSD on UFS
https://www.freebsd.org/doc/handbook/disks-growing.html

FreeBSD on ZFS
https://www.freebsd.org/doc/handbook/zfs-zpool.html (19.3.9. Growing a Pool)

Optionally you can use autoexpand:

http://docs.oracle.com/cd/E19253-01/819-5461/githb/index.html