I wrote same question to teamviewer support and got such reply:
When installing TeamViewer through SSH please keep in mind there is an EULA agreement which must be accepted before the GUI is able to launch to receive an ID.
There will be a parameter for this coming out in a later release, however, for now please stop the TeamViewer daemon with the following command:
teamviewer --daemon stop
and then just add the following lines in the /opt/teamviewer9/config/global.config file:
[int32] EulaAccepted = 1
[int32] EulaAcceptedRevision = 6
After this please start the TeamViewer daemon with the following command:
teamviewer --daemon start
Also, please run the command (in debian based distros)
export DISPLAY=:0; nohup iceweasel &>/dev/null &
to allow the GUI to be opened and retrieve the TeamViewer ID.
You can then run TeamViewer with the command sudo teamviewer & disown
as it removes the process from the shell's job control, but it still leaves it connected to the terminal.
Thank you in advance and please let me know if you have any further questions...
Fedora 20
Here are the steps:
1.) SSH into the machine to install TeamViewer (Follow installation instructions. If help is needed for shell commands then teamviewer --help
)
2.) After installing TeamViewer please setup the unattended password teamviewer --passwd [PASSWD]
3.) After please stop the daemon with sudo teamviewer --daemon stop
4.) Write into the global.conf file located in /opt/teamviewer/config/global.conf the following lines:
[int32] Always_Online = 1
[int32] EulaAccepted = 1
[int32] EulaAcceptedRevision = 6
5.) Then start the daemon with sudo teamviewer --daemon --start
or restart if needed sudo teamviewer --daemon restart
6.) Then restart GDM with the command systemctl restart gdm.service
Then you should be good to go!