This was hard for me, until it was easy. There were a couple critical things when you're installing:
1. set your password (easy)
2. NON-INTERACTIVELY agree to the license (this took me a while to figure out. Teamviewer will produce a pop-up with a button to accept the license under normal circumstances--that is you being able to see the screen, which is what Teamviewer is all about--seeing the screen. But you have to disable the x windows thing, accept on the command line, then restart the x windows thing.
3. Here's something I found at http://endofline.ws/2017/02/install-and-launch-teamviewer-remotely-throu...
(pasted here as follows)
//sudo apt-get install gdebi-core // don't need this because i'm on Ubuntu Mint
//sudo gdebi teamviewer_i386.deb // don't need this because i'm on Ubuntu Mint
// Get Teamviewer ID
// Interactively agree or show/agree to End User License Agreement. (aka EULA)
sudo service lightdm status
sudo service lightdm stop
sudo teamviewer license accept
sudo service lightdm start
teamviewer daemon start
// showing infos
sudo netstat -ntap | grep teamviewer