Tell us about yourself!
To answer one of my own questions, the script will run every time the VM is stopped & then restarted. I did that and still couldn't get a certificate. Had several chats with Petri. He said he thought it might be because your command line stuff calls to install Ubuntu while his script has only been tested with Debian. He suggested creating a new VM following his instructions which creates a Debian VM. Indeed, doing that, the certificate is installed and works. Hope this helps you & any other readers here.
I made the changes to the new & old controller so that seems fine now. Can you tell me if I admin other Unifi APs not on my LAN should the VM controller see those APs at the site they are on, or only when I am on the LAN where those APs reside?I also was going to try CertBot on my own but wasn't sure of the values to give it for "I'm using" (see screenshot). I chose Ubuntu other since I'm using the 16.04 you recommended.