So the problem with a default install of Ubuntu is the Wayland GNOME requires a user at the desktop to accept the TeamViewer connection. Of course that doesn't work for Unmanned Kiosks or IOT machines.
To change to the X11 GNOME, you need to make a simple change to config file. Navigate to /etc/gdm3/custom.conf
In that config file look for this line:
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false
All you have to do is delete the # to uncomment the WaylandEnable=false. Then restart the computer and connect with TeamViewer.
That sounds simple, but if you have just installed the default Ubuntu, you don't have permission to make changes to this file.
If you are familiar with a terminal file editor, such as vim, simply open this file using the editor with sudo:
sudo vim /etc/gdm3/custom.conf
Otherwise, first you must give yourself sudo permission for this folder. To give yourself permission, open the terminal and type this:
sudo chmod a+rwx /etc/gdm3
When you run that line it will ask for your password. Once complete, you should be able to save the change to the custom.conf file mentioned above.