Summary: Need to upgrade to 18.04 first, then to 20.04.
Launch tmux before ssh into the vm, in case local network or vpn has issue, the vm continues to run your commands.
tmux new -s vm
ssh username@vm
Inside vm:
sudo apt update
sudo apt install update-manager-core
sudo apt upgrade
Make sure the Prompt line in /etc/update-manager/release-upgrades is set to 'normal' if you want non-LTS upgrades, or 'lts' if you only want LTS upgrades.
sudo do-release-upgrade
Say yes to many prompts. At the end say Yes to reboot.
ssh into vm again. It should say Ubuntu 18.04.
sudo do-release-upgrade -d
Say yes to many prompts. At the end say Yes to reboot.
ssh into vm again. It should say Ubuntu 20.04.
Source: Upgrading ubuntu 16.04 to 18.04. https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes
Source: Upgrading ubuntu 18.04 to 20.04. https://wiki.ubuntu.com/FocalFossa/ReleaseNotes
Tnx