TeamViewer on Linux Crashes After Use

Options
John_Terry
John_Terry Posts: 2 ✭✭

The first computer uses Ubuntu 22.04 operating system and I have installed TeamViewer latest version from the homepage on 23 Aug 2023 on it.

My second computer uses Windows 10 operating system and I also installed the latest version of Teamviewer from the homepage on 23 Aug 2023 on it.

I use TeamViewer on windows 10 to control into TeamViewer on Ubuntu 22.04. (in other words I access the Ubuntu 22.04 machine from windows 10 via TeamViewer).

As a result, after completing TeamViewer control on Ubuntu 22.04 (Teamviewer on windows exited), 

TeamViewer application on Ubuntu 22.04 crashed and saved the error log file.

I'm really annoyed with this error and hope this issue will be resolved as soon as possible so as not to affect users,  as well as increase the quality of TeamViewer to be known to more people.

Hopefully this issue will be resolved as soon as possible

Thanks.

Tagged:

Best Answer

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Answer ✓
    Options

    As of right now, I think executing a script like below is the only way to overcome this issue. Basically, the code works by terminating the processes after you exit a TeamViewer session. When you log back into TeamViewer, it should not disconnect. This script basically resets the TeamViewer environment after each exit. However, others may need to change the directory locations depending on the installation/application directory.


    # Script for Terminating TeamViewer Desktop Client upon exit.

    # TeamViewer Version: 15.45.3

    #!/bin/bash

    # User

    user=$(whoami)

    # Log File Location

    logfile='TeamViewer15_Logfile.log'

    logpath="/opt/teamviewer/logfiles/$user"

    # Executables

    tvpath='/opt/teamviewer/tv_bin'

    tvdesktop='TeamViewer_Desktop'

    tvclient='TeamViewer'

    # Logging times for when session terminates

    i=0

    while [ "$i" -lt 1000000 ]

    do

    i=$((i + 1))

    echo "This is the ${i}th session."

    echo "-------------------------------------------------------------------------------------------------------------------"

    ps aux | grep "teamviewer"

    echo "-------------------------------------------------------------------------------------------------------------------"

    echo ""

    logout=$(date -d"$(cat $logpath/$logfile | grep "SessionTerminate" | tail -n 1 | awk '{print $1,$2}')" +%s)

    echo "Previous Logout time is: $logout"

    echo ""

    logout_check=$logout

    while [ "$logout_check" = "$logout" ]

    do

    logout_check=$(date -d"$(cat $logpath/$logfile | grep "SessionTerminate" | tail -n 1 | awk '{print $1,$2}')" +%s)

    done

    kill -9 $(ps aux | grep "$tvpath/$tvclient" | awk '{print $2}')

    done

Answers

  • eggzabyte
    eggzabyte Posts: 4 ✭✭
    Options

    Not only ubuntu. Any Linux distro. It's been like this for months, no one here seems to care.

    Does anyone know what version didn't had this bug? At least to downgrade

  • .Carol.fg.
    .Carol.fg. Posts: 1,099 Moderator
    Options

    Hello @eggzabyte and @John_Terry ,

    Thanks for reaching out to our Community!

    We could not reproduce the issue on our side. Therefore, we advise you to primarily double-check if your Linux is compatible with your TeamViewer.

    It's also recommended that you use TeamViewer's newest version. You can download it from our website.

    Another important point to mention is that TeamViewer compatibility with Wayland is still in an experimental state, so if you're using Wayland, please consider using Xorg instead and see if it fixes the issue.

    Let us know how it goes, and if we can help you any further. 🙋‍♀️

    Best, Carol


    Portuguese Community Moderator

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    I am using Xorg on Ubuntu 20.04 and can confirm that the issue still persists. I noticed that this issue appeared after I had upgraded my TeamViewer from 15.25.0 to current versions. Unfortunately, version 15.25.0 is not available anymore. Even when I downgrade to earlier versions such as 15.20.6 and 15.10.5, the issue still persists. Only 15.25.0 strangely seemed to work.

    What happens is that when I log into TeamViewer from Windows to a Linux server, TeamViewer receives a crash "CORE" message and either (1) freezes to the point I have to close TeamViewer and reopen to reconnect or (2) kicks me out of TeamViewer completely, which was discussed in this thread: https://community.teamviewer.com/English/discussion/130107/teamviewer-crashed-with-sigsegv-in-qmetatype-create

    After it crashes, I am still able to reconnect without any issues. I think the primary issue is that the processes are not being killed correctly when I monitor the "teamviewer ps" command. Perhaps, the only solution is to create a script that terminates these processes after every exit from the TeamViewer client. Everything seems to work when I kill the processes for TeamViewer_Desktop and TeamViewer in the tv_bin folder remotely through SSH after exiting TeamViewer.

    The output from "teamviewer ps" is as follows:

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    root   2068009 1.9 0.1 3752068 442496 ?   Sl  Aug23 56:00 /opt/teamviewer/tv_bin/teamviewerd -d

    user-+ 2417519 6.0 0.0 5046768 182772 ?   Sl  10:23  0:54 /opt/teamviewer/tv_bin/TeamViewer

    user-+ 2417580 0.0 0.0 315656 8264 ?    tl  10:23  0:00 /opt/teamviewer/tv_bin/TeamViewer_Desktop --watch 2417471 --readfd 17

    user-+ 2419601 65.0 0.0 315656 8264 ?    R  10:38  0:00 /opt/teamviewer/tv_bin/TeamViewer_Desktop --watch 2417471 --readfd 17

    user-+ 2419603 0.0 0.0 10440 4204 pts/10  S+  10:38  0:00 /bin/bash /usr/bin/teamviewer ps

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Killing the bolded processes using "kill -9" seems to be the only way to avoid the crash.

  • John_Terry
    John_Terry Posts: 2 ✭✭
    edited August 2023
    Options

    Hi @.Carol.fg. ,

    This is a pretty serious issue that greatly affects the end users, and especially this issue has been raised many times, created many tickets in the community teamviewer but currently this issue has not been resolved. I am really sad about this.

    Regarding the issue you mentioned which version of Ubuntu I am using. I am using Ubuntu 22.04.3 LTS, and the latest version of teamviewer was downloaded from the homepage on 23 Aug 2023.

    I have checked Ubuntu version 22.04.3 LTS fully compatible with latest teamviewer version. This is a rather serious bug of the teamviewer app, not a compatibility issue.

    I have said quite detailed, step by step the specific problem I encountered in the ticket I created above, it is quite easy to reproduce , then fix bugs.

    I think this issue has been raised for a long time and by many people, but it is still unresolved.

    I want to say that I really love teamviewer and hope this issue will be resolved as soon as possible for a great experience for uses.

    Thanks.

  • .Carol.fg.
    .Carol.fg. Posts: 1,099 Moderator
    Options

    Hi @misterm3140 and @John_Terry ,

    Thanks for your feedback and for the additional detail provided.

    @John_Terry are you also using Xorg?

    Also, I would like to ask both of you if on the device that has the crash you have any firewall, anti-virus, or baking app running when the crash happens.

    I'm looking forward to your reply.

    Best, Carol


    Portuguese Community Moderator

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    I do not have any firewall or anti-virus software. The only app that I have running is a Linux Terminal open most of the time.

    Thank you.

  • .Carol.fg.
    .Carol.fg. Posts: 1,099 Moderator
    Options

    Hi @misterm3140,

    Thanks for all the information provided!

    It seems you have the correct packages for your distro... So my suggestion at the moment is to try to uninstall TeamViewer, update the repositories and the device, and try to install TeamViewer again.

    sudo apt update
    sudo apt upgrade 
    wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
    sudo apt install ./package name
    sudo teamviewer setup ( for account assignment) 
    

    Also, after the installation please don't run TeamViewer as root.

    Let us know how it goes, and if it fixes the issue.

    Best, Carol


    Portuguese Community Moderator

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    Hello Carol,

    I tried your instructions, but I still experience the same issue.

    Thank you.

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Answer ✓
    Options

    As of right now, I think executing a script like below is the only way to overcome this issue. Basically, the code works by terminating the processes after you exit a TeamViewer session. When you log back into TeamViewer, it should not disconnect. This script basically resets the TeamViewer environment after each exit. However, others may need to change the directory locations depending on the installation/application directory.


    # Script for Terminating TeamViewer Desktop Client upon exit.

    # TeamViewer Version: 15.45.3

    #!/bin/bash

    # User

    user=$(whoami)

    # Log File Location

    logfile='TeamViewer15_Logfile.log'

    logpath="/opt/teamviewer/logfiles/$user"

    # Executables

    tvpath='/opt/teamviewer/tv_bin'

    tvdesktop='TeamViewer_Desktop'

    tvclient='TeamViewer'

    # Logging times for when session terminates

    i=0

    while [ "$i" -lt 1000000 ]

    do

    i=$((i + 1))

    echo "This is the ${i}th session."

    echo "-------------------------------------------------------------------------------------------------------------------"

    ps aux | grep "teamviewer"

    echo "-------------------------------------------------------------------------------------------------------------------"

    echo ""

    logout=$(date -d"$(cat $logpath/$logfile | grep "SessionTerminate" | tail -n 1 | awk '{print $1,$2}')" +%s)

    echo "Previous Logout time is: $logout"

    echo ""

    logout_check=$logout

    while [ "$logout_check" = "$logout" ]

    do

    logout_check=$(date -d"$(cat $logpath/$logfile | grep "SessionTerminate" | tail -n 1 | awk '{print $1,$2}')" +%s)

    done

    kill -9 $(ps aux | grep "$tvpath/$tvclient" | awk '{print $2}')

    done

  • eggzabyte
    eggzabyte Posts: 4 ✭✭
    Options

    OMG!

    Thanks so much for your script!!!! So far working good!

    cheers!

  • mack_wang
    mack_wang Posts: 1
    Options

    Hi @.Carol.fg.

    Can reproduce the problem here. A fresh install of Ubuntu 22.04 and TeamViewer, so definitely not a configuration problem or file corruption problem. Sad to see that the problem is lingering here for weeks.

  • .Carol.fg.
    .Carol.fg. Posts: 1,099 Moderator
    edited September 2023
    Options

    Hi mack_wang

    Welcome to our Community and I'm sorry to hear you're also having issues when installing TeamViewer.

    Are you also using Xorg with your Ubuntu 22.04?

    Our teams could not reproduce the issue, but we appreciate and value your feedback.

    It seems @misterm3140 found a workaround; Have you tested it too? Does it also work for you?

    We're looking forward to your feedback!

    Best, Carol


    Portuguese Community Moderator

  • MintPi
    MintPi Posts: 4 ✭✭
    Options

    Is this a script you have to execute manually when you wish to end the session, or do you place it somewhere where it will do it automatically upon closing connection?

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    @MintPi You can place the script in a screen and have it run in the background:

    https://www.geeksforgeeks.org/screen-command-in-linux-with-examples/

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    The only disadvantage to this script is that it does not support multiple login users. I am working on a workaround, and hopefully I can modify the script.


    Many thanks for the feedback!

  • tmiland
    tmiland Posts: 1
    Options

    Hello,

    I've been having this issue for a while and looked up something i found in the logfiles, and ended up here -LINK-


    Basically you just need to open port 5298 in your firewall.


    My TeamViewer app isn't freezing anymore after exiting a session.

    Regards.

  • Paul_DL
    Paul_DL Posts: 12 ✭✭
    Options

    Carol.fg,

    The problem is real. Crashes reliably on Ubuntu 22.04. I guess I shouldn't use the word reliably for something not reliable :-)

    Anyway, once I close a session of TeamViewer on Linux from my Windows 11 computer (no matter how I close it), I must ALWAYS attempt to connect three times before I really connect:

    1) First connect brings up the TeamViewer session as if it's working - BUT - it has the popup for closing the session that I should (and always do) see on my Windows computer when I close the remote session. But to be clear, the popup is on the remote Linux computer session. This also causes an Ubuntu error. The remote session shows the Ubuntu screen, but NOTHING works. I must close the window on my Windows 11 computer and try again. No other choice.

    2) My second connection attempt never opens a remote session window on my Windows computer. The TeamViewer app says connecting, but never does. Sometimes, it says ready to connect after a certain wait.

    3) Third attempt, TeamViewer App says connecting, then authenticating, then it finally connects. Hooray!

    SO - I can always get onto my remote Linux computer, but only after three annoying but overcome-able steps.

    ALSO - I have the ability to remotely power cycle the remote computer. When I do that, TeamViewer connects the first time every time.

    I'm attaching my Ubuntu crash files - if not too large. - OK This website does not allow text files attached. Really?

    If TeamViewer really wants more detailed information on this crash, you need to provide a possible way for the users to provide it.

  • chucknorris
    chucknorris Posts: 2 ✭✭
    Options

    i also have this EXACT same issues on literally 10 different brand new ubuntu boxes. Imagine paying for the most expensive remote software out there and it doesn't even work on ubuntu right. It's been months with no fix. I can replicate this all day long with new boxes

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    I think I finally figured out a final solution to the issue, but this is going to be very weird solution... Let me start by explaining what the problem is:


    So the first thing I noticed was when executing "sudo systemctl status teamviewerd.service", I get the following output:

    ● teamviewerd.service - TeamViewer remote control daemon

    .

    .

    .

    Dec 05 15:03:49 Computer systemd[1]: Starting TeamViewer remote control daemon...

    Dec 05 15:03:49 Computer systemd[1]: teamviewerd.service: Can't open PID file /run/teamviewerd.pid (yet?) after start: Operation not permitted

    Dec 05 15:03:49 Computer systemd[1]: Started TeamViewer remote control daemon.


    I bolded the error message where it says that TeamViewer cannot open the PID file due to permission issues. For some reason, TeamViewer cannot access this file because this file is created with root permissions. This teamviewer.pid file is needed to kill and reset the TeamViewer client after each exit. This file needs to be updated and rewritten with each login/logout so if TeamViewer cannot access this file, then TeamViewer will not reset. Then, when you remote login again, the application will crash.

    It also appears that the community has raised this issue before, but received no response from the TeamViewer support team.

    https://community.teamviewer.com/English/discussion/100804/teamviewerd-service-cant-open-pid-file-var-run-teamviewerd-pid


    This is most definitely a TeamViewer issue that needs to be addressed, because the teamviewer.pid file needs to have access to enable this reset.

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    So now to another solution that is less CPU expensive as my previous solution, and sort of a weird solution that I do not have an explanation for that deals with modifying the teamviewerd.service file in /etc/systemd/system. This is overall risky because using "sudo chmod" and "sudo chown" is notoriously risky in the root directories, so proceed with caution when executing.

    (1) sudo chmod 755 /var/run/teamviewer.pid

    (2) Every time you update TeamViewer or restart the TeamViewer daemon using "teamviewer --daemon restart" or "systemctl restart teamviewerd.service", you MUST issue sudo chmod 755 /var/run/teamviewer.pid.

  • misterm3140
    misterm3140 Posts: 21 ✭✭
    Options

    Correction: I meant to say to use "sudo chown <user>:<group> /var/run/teamviewer.pid

  • Paul_DL
    Paul_DL Posts: 12 ✭✭
    Options

    This issue is real and repeatable. It occurs on three Ubuntu 22.04 boxes I have. All the time. And it's quite the nuisance.

    Teamviewer, Please take this problem more seriously.


    Please!

  • xuyuanhan
    xuyuanhan Posts: 1
    Options

    I confirm that this issue is persistent and reproducible which significantly impacts the usability of Teamviewer on Ubuntu 22.04 systems. This bug occurs when a computer running Ubuntu 22.04 (let's call it Computer A) uses Teamviewer to remotely access another Ubuntu 22.04 system (Computer B). Every time I terminate the connection from Computer A, Teamviewer on Computer A freezes and becomes unresponsive (no response). However, Teamviewer on Computer B does not exhibit any problems.

    This issue is not just a minor inconvenience but a major disruption for users relying on Teamviewer for critical remote access tasks. The fact that it is reproducible on Ubuntu 22.04 highlights a compatibility or functionality flaw that needs urgent attention.

    I hope this problem is taken seriously and addressed promptly. A timely fix would not only improve the user experience but also reinforce trust in Teamviewer's reliability for remote access needs, especially in environments running Ubuntu 22.04.

    Thank you for your attention to this matter. I am looking forward to your response and a resolution to this bug.

  • verpejas
    verpejas Posts: 1
    Options

    i have finally found a "solution"


    If your system uses systemd/systemctl, edit the file /etc/systemd/system/teamviewerd.service

    After ExecStart, add a line

    ExecStartPost=/bin/bash -c "sleep 1 && chown verpejas:verpejas /run/teamviewerd.pid && chmod 664 /run/teamviewerd.pid"


    Of course replace my data with your data (verpejas:verpejas with your user:group)

    After reloading:

    sudo systemctl daemon-reload && sudo systemctl restart teamviewerd.service

    Teamviewer no longer hangs after finished remote session and continues to work normally. The systemd service had to be modified just once - no need to do it after a restart or an update (at least thats what i think, not really sure if an update will mess it up, but it is possible to rename the daemon to be persistent with updates)



    Here is my full teamviewerd.service file. After doing my modifications it works perfectly now



  • frotas
    frotas Posts: 1
    Options

    It seems the latest update (version 15.52.3, release date 2024-03-26) finally fixed the issue on my machine (Ubuntu 22.04).