link icon
Ask The Community

Unable to connect to TeamViewer headless after xsession started

Hi all,

I've successfully installed TeamViewer Host 12 on Debian Jessie. The service is running in headless mode, starts on boot and I can connect without problems to the console. Although TeamViewer runs in headless mode, there's actually a monitor connected as the PC is functioning as a kiosk and also needs to start a fullscreen Chrome session using nodm and xinit.

Now the issue is: without an X session I can connect just fine. I can also start nodm and switch between the virtual console and the X session. However, once I disconnect TeamViewer, I can no longer (re)connect as long as the X session is running. Sometimes the client also disappears from my list of available clients, sometimes it doesn't.

So, is it even possible to run TeamViewer in headless mode _and_ run an X session _and_ still accept incoming connections? Or do I have to start TeamViewer from X and run it in GUI mode (I'd rather not). And if it is possible, what am I doing wrong?

Thank you,

Best Answer


  • ChristianCay
    ChristianCay Posts: 184 Staff

    Dear rogierkoppejan,

    Thank you for your post.

    When TeamViewer starts grabs the current running physical terminal.

    Then starts the network connection. 

    If it's not possible to grab a GUI or Console at startup it won't show as online.

    That's the reason why it's not able to receive incoming connections.

    To be able to connect again you need to restart the TeamViewer service by running the following command.

    sudo teamviewer daemon restart

    What we recommend if you want to switch between GUI and terminal to start with GUI and use a terminal inside a GUI; but that only applies to your system needs.


    I will forward your suggestion to switch between GUI and Console our product management team.

    Such ideas are always welcome, although we can not promise when or if this Feature will be implemented.

    Decisions for new features are mainly based on customer's suggestions.

    Nevertheless, your feedback is crucial to us, as we want to continue to develop TeamViewer-based on our user's need.

    We will be happy to inform you about the realization of this feature.

    If you have any further questions regarding our product, feel free to contact us.


    Best regards,


    Did my reply answer your question? Accept it as a solution to help others, Thanks.
  • hela
    hela Posts: 1

    Dear Christian,

    as a Debian newbie I set up a Raspberry Pi with Raspbian Stretch Light to run as a kiosk system. I installed Teamviewer to have remote access.

    Everything works fine witrh Teamviewer as long as I don't start the X server with

    [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

    in the pi users .bash_profile.

    I. e. if I stop the X server with ctrl+alt+bspc my Teamviewer console sees the Raspberry again an I can connect.

    If I start again with startx -- -nocursor in the Teamviewer session I loose connection.

    So I installed LightDM as rogierkoppejan recommended it (Openbox is already installed on my system) ... no access!

    I inserted 

    sudo teamviewer daemon restart

    as first line in my  /etc/xdg/openbox/autostart ... no access!

    Any ideas?

    Best regards 

  • Codeo
    Codeo Posts: 1

    @hela - I am having the exact same issue. Did you ever manage to get it working?

Sign In or Register to comment.