How to set vino's password through terminal?
I haven't specifically tried on 18.04, but I have successfully used gsettings to do this in the past:
gsettings set org.gnome.Vino vnc-password $(echo -n 'mypasswd'|base64)
The Arch Wiki for Vino describes some other useful options you can modify using gsettings. My standard set is:
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino vnc-password $(echo -n 'mypasswd'|base64)
gsettings set org.gnome.settings-daemon.plugins.sharing active true
eths=$(nmcli -t -f uuid,type c s --active | grep 802 | awk -F ":" '{ print "'\''" $1 "'\''" }' | paste -s -d, -)
gsettings set org.gnome.settings-daemon.plugins.sharing.service:/org/gnome/settings-daemon/plugins/sharing/vino-server/ enabled-connections "[ $eths ]"
Again, the above is not tested on 18.04, so your mileage may vary.