Howto: Running TeamViewer 5/6 as root on Linux | Fedora | Ubuntu | RHEL | CentOS

Hello,

First of all Let me tell you that this HOWTO is performed on Fedora Ubuntu Red Hat Enterprise Linux and CentOS. This post is applied for TeamViewer Version 5 and 6.

Here is the post on TeamViewer on Linux Again. Hoping that you guys enjoyed previous post regarding TeamViewer Installing on Linux.

Now Here I am going to post 1 trick and tips for TeamViewer. Many Users who likes to work as root and but in TeamViewer 5 there is restriction for Running as root.

Whenever you are trying to run TeamViewer as root from Terminal, You will get message like below :-

TeamViewer must not be executed as root!

By Following very few steps you will be able to run TeamViewer as root.

Perform Following Steps to run TeamViewer As root.

  1. Of Course you have to be root to perform these all steps.
  2. Please Open Terminal on Fedora, Red Hat, CentOS ( Applications -> System Tools -> Terminal )
    Please Open Terminal on Ubuntu ( Applications -> Accessories -> Terminal )
  3. Now Lets find where exactly teamviewer command is. Execute Following command to Find it out.
    [root@tejasbarot.com]# which teamviewer
    /usr/bin/teamviewer
    <– You will get this kind of output on your terminal
  4. Be safe So First Lets take a backup of Original TeamViewer Command. Execute Following Command
    cp /usr/bin/teamviewer /usr/bin/teamviewer-orig 
  5. Let’s Open teamviewer file. Here in /usr/bin/teamviewer they have put the restriction for root user. So Lets Remove it. Open File By Executing vim /usr/bin/teamviewer and You will able to see following lines into /usr/bin/teamviewer :-

    userid=$(id -u)if [ $userid = 0 ]
    then
    echo TeamViewer must not be executed as root!
    exit 1
    fi

    CHANGE those line to

    ##userid=$(id -u)

    ##if [ $userid = 0 ]
    ##then
    ##        echo TeamViewer must not be executed as root!
    ##        exit 1
    ##fi

    Save and Exit this file ( Press “ESCthen Press :wq! )

     

  6. To Open TeamViewer from GUI. Click on Applications –> Internet -> TeamViewer
  7. To Open TeamViewer from Terminal in Fedora, Red Hat and CentOS. Click on Applications -> System Tools -> Terminal. On Terminal Execute Command teamviewerTo Open TeamViewer from Terminal in Ubuntu. Click on Applications -> Accessories -> Terminal. On Terminal Execute Command teamviewer
  8. That’s It Guys

Hope you all like this tip about Running TeamViewer as root on Fedora, Ubuntu, CentOS and RHEL. Please let me know if you face any difficulties while performing above steps. I have not tested it on Ubuntu but it should work with same way.

If you have not installed TeamViewer then please install it by visiting my previos post on TeamViewer :- http://www.tejasbarot.com/2010/12/02/installing-team-viewer-5-on-linux-teamviewer-fedora-rhel-centos-linux/

Let me have your feedback guys. Thanks for reading Article.

Enjoy TeamViewer on Linux 🙂 Enjoy TeamViewer as root 🙂 Enjoy Linux 🙂 Enjoy Open Source 🙂

TeamViewer must not be executed as root!

44 thoughts on “Howto: Running TeamViewer 5/6 as root on Linux | Fedora | Ubuntu | RHEL | CentOS”

  1. Do you have a step-by-step process to run teamviewer portable on RedHat/CentOS with restricted access (office computer)

  2. hey iam having the following issue when i type teamviewer in terminal
    [root@localhost ~]# teamviewer

    Init…
    Checking setup…
    Launching TeamViewer…
    fixme:service:scmdatabase_autostart_services Auto-start service L”MountMgr” failed to start: 2
    fixme:service:scmdatabase_autostart_services Auto-start service L”PlugPlay” failed to start: 2
    fixme:actctx:parse_depend_manifests Could not find dependent assembly L”Microsoft.Windows.Common-Controls” (6.0.0.0)
    fixme:heap:HeapSetInformation (nil) 1 (nil) 0
    fixme:ole:CoInitializeSecurity ((nil),-1,(nil),(nil),0,3,(nil),0,(nil)) – stub!
    fixme:heap:HeapSetInformation (nil) 1 (nil) 0
    fixme:process:SetProcessShutdownParameters (00000100, 00000000): partial stub.
    fixme:resource:GetGuiResources (0xffffffff,0): stub
    fixme:win:EnumDisplayDevicesW ((null),0,0x33dc60,0x00000000), stub!
    fixme:win:EnumDisplayDevicesW (L”\\\\.\\DISPLAY1″,0,0x33d918,0x00000000), stub!
    fixme:win:EnumDisplayDevicesW ((null),1,0x33dc60,0x00000000), stub!
    fixme:console:CONSOLE_DefaultHandler Terminating process 8 on event 0
    [root@localhost ~]#

  3. Great tip! Sorry for the obvious question by: what are the risks of running Teamviewer as root? Anything that should make a casual user think twice before taking this step?

  4. I don’t know if this was solved but when i try to run it i get
    TeamViewer: 6.0.9258
    Profile: /root (root)
    Desktop:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 10.04.2 LTS
    Release: 10.04
    Codename: lucid

    Error: TeamViewer must not be executed as root!

    Whats the fix?
    also when i run vim /usr/bin/teamviewer i do not see
    userid=$(id -u)

    if [ $userid = 0 ]
    then
    echo TeamViewer must not be executed as root!
    exit 1
    fi

    i get

    #!/bin/bash

    TV_script_dir=$(dirname $(readlink -f “$0”))
    “$TV_script_dir/wrapper” wine “c:\Program Files (x86)\TeamViewer\Version6\TeamViewer.exe” “$@”

    true

    ~
    ~
    ~
    ~

  5. I have the same problem as Martin.

    I’d appreciate it if you find a solution for this as soon as possible.
    Thanks!

  6. Hi Martin,

    Thanks for your output. Hmmm Actually in New Teamviewer they have changed the script, I am working on the same. So Right now I am extremely sorry that will not able to provide you the solution but in few days whenever i finish with it will provide you the solution so Requesting you to subscribe for the post so whenever i post about it you will get the solution for the same.

  7. Hi Tejas,

    This is what I get when executing Teamviewer as root

    TeamViewer: 6.0.9258
    Profile: /root (root)
    Desktop:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 10.04.2 LTS
    Release: 10.04
    Codename: lucid

    Error: TeamViewer must not be executed as root!

    This is the conent of the Teamviewer symlink in /usr/bin:

    #!/bin/bash

    TV_script_dir=$(dirname $(readlink -f “$0”))
    “$TV_script_dir/wrapper” wine “c:\Program Files\TeamViewer\Version6\TeamViewer.e
    xe” “$@”

    true

  8. Hello Martin,

    Execute #teamviewer command as root and provide me the output which you are getting so i will look into this and will try to help you out.

  9. The /usr/bin/teamviewer file is different as of version 6.0.9258. Anyone any ideas on how to allow that version to run as root?

    Martin

  10. Hi,

    For the same you have to enter teamviewer command with full path into /etc/bashrc and then login as a user and teamviewer will open automatically. Is this your requirement or something else?

    Let me know the exact requirement.

  11. Hey Buddy,

    Thanks for posting this such useful tricks.

    I tried on CentOS machine it’s working fine 🙂

    thanks again !!

  12. Hello sir,

    I have install teamviewer in Cent OS as a root. But it cant open. I have click on it or rum command but cant open it.

  13. It works great. I really missed not being able to use Team Viewer in root so I really appreciate the fix.

  14. Hey Bro,
    I really like ur website & the contents, which u have provided for the starters as well as experienced people.
    Great Going Bro.
    Best of Luck!….
    k@r@n

Leave a Reply

Your email address will not be published. Required fields are marked *