Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have installed a vlc in centos 6.5. I want to run it as root. But I get the following error,

"VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first)."

share|improve this question
Out of curiosity, what would be the reason to do this ? – kursus Apr 19 '14 at 14:09
So use vlc-wrapper like it says? – Kevin Apr 19 '14 at 20:41
Pro-tip: Do not do this. – HalosGhost Jun 30 '14 at 22:14
Hope this helps you out. Chirag Singh – chirag Hz Feb 12 at 21:08
On some levels the link referenced is an interesting hack (use a hex editor to replace the getuid call with getpid) since source code is available, a cleaner approach would be to edit the source to remove the test completely, and recompile. In both cases I would recommend against doing so, but if you want to shoot your foot off . . . – hildred Feb 12 at 22:51

3 Answers 3

The only way around this is recompiling. Pass the --enable-run-as-root flag to ./configure and vlc should be able to run as root. The above answer is from here.

share|improve this answer
recompiling is not the only way, just change the call to geteuid to deliver 1. I describe this at – Thorsten Staerk Oct 29 '14 at 6:56
@ThorstenStaerk, thanks for providing me the information. – Ramesh Oct 29 '14 at 16:42
Could you please mark the question as answered? – Thorsten Staerk Oct 31 '14 at 8:49

This is what worked for me. No compilation required.

sed -i 's/geteuid/getppid/' /usr/bin/vlc

Using VLC media player 2.0.3 Twoflower on a Raspberry Pi.

share|improve this answer
Worked like a charm. :) – Krishnadas PC Jul 13 at 1:29


  • backup the VLC binary:

    # cp /usr/bin/vlc /usr/bin/vlc-backup
  • find the call to geteuid inside the VLC binary:

    # needle=$(objdump -d /usr/bin/vlc | grep euid | tail -1 | awk '{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6;}')
  • replace the call to just deliver 01:

    # sed -ir "s/$needle/\xb8\x01\x00\x00\x00/" /usr/bin/vlc
  • test it

VLC should now run under the root user!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.