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.
- Of Course you have to be root to perform these all steps.
- Please Open Terminal on Fedora, Red Hat, CentOS ( Applications -> System Tools -> Terminal )
Please Open Terminal on Ubuntu ( Applications -> Accessories -> Terminal ) - Now Lets find where exactly teamviewer command is. Execute Following command to Find it out.
[root@ask4itsolutions.com]# which teamviewer
/usr/bin/teamviewer <– You will get this kind of output on your terminal - Be safe So First Lets take a backup of Original TeamViewer Command. Execute Following Command
cp /usr/bin/teamviewer /usr/bin/teamviewer-orig - 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 “ESC” then Press :wq! ) - To Open TeamViewer from GUI. Click on Applications -> Internet -> TeamViewer
- 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
- 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 ![]()
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.












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?
[...] 7. To Run TeamViewer as root Follow howto from this link :- http://www.tejasbarot.com/2011/01/01/how-to-running-teamviewer-5-6-as-root-on-linux-fedora-ubuntu-rh… [...]
I will look into this and update you on the same.
Hi!!
I want ask how to install Teamviewer on Suse
Hellom
For the same i have written script, Please go through following url may it helps you
http://www.tejasbarot.com/2011/09/10/howto-running-teamviewer-6-0-9258-as-root-on-fedora-15-rhel-6-centos-6-ubuntu-linux/
Let me know if you still have any issues.
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
~
~
~
~
[...] more: Howto: Running TeamViewer 5/6 as root on Linux | Fedora | Ubuntu … This entry was posted in os, ubuntu, Uncategorized and tagged rhel, running, running-team, [...]
Hi Martin,
I have already published script.
You can search old posts.
Hi Tejas,
Any news with the script?
on my ubuntu 10.10 installation the file needed to be edited for that.
thx for your tipp
Hi,
Writing A Script For the same Shortly update you. Keep Visiting blog for the same.
I have the same problem as Martin.
I’d appreciate it if you find a solution for this as soon as possible.
Thanks!
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.
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
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.
HI Tejas,
Thanks, I am using Ubuntu 10.04.
Hello,
Are you using Fedora 15 ? Ubuntu ?
I will try to help you out.
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
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.
Hello,
Great… Thanks for your comment.
Hey Buddy,
Thanks for posting this such useful tricks.
I tried on CentOS machine it’s working fine
thanks again !!
I can not get the auto-run every time you reboot teamviewer ubuntu
Hello,
Can you please tell me what is the error you are getting and try to open from terminal and let me know you are getting error or not.
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.
Thankq very much it is working Fine.
Hi,
Yes, There is a trick about it but for the same you have to compile vlc from source.
I will share on blog for sure.
thanks mate…
do u have a trick to open vlc as a root user aswell..if yes then plz share
wow tats a wonderful tip, tx mate
its work
It works great. I really missed not being able to use Team Viewer in root so I really appreciate the fix.
Thanks Barot
Though I was knowing this, But thanks for sharing it.
just change this line:
if [ $userid = 0 ]
for this line:
if [ $userid = 1 ]
and done!!
just change this line
if [ $userid = 0 ]
for this line
if [ $userid = 1 ]
and done!
Thank’s a lot. It saved my time
thanks for the post
Thanks Karan
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
[...] you want to run TeamViewer as root click here, I have already found the way to run as root. Running/Open Team Viewer 5 as a root from [...]
[...] article and let me have some feedback or whatever comments you feel. Please read this article :- http://blog.ask4itsolutions.com/2011…tu-rhel-cento/ This practical performed on Red Hat Enterprise Linux 5.x, Ubuntu Desktop Edition, Fedora and [...]
[...] Running TeamViewer 5/6 as root on Linux | Fedora | Ubuntu | RHEL … [...]