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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
12  
Out of curiosity, what would be the reason to do this ? – kursus Apr 19 '14 at 14:09
1  
So use vlc-wrapper like it says? – Kevin Apr 19 '14 at 20:41
2  
Pro-tip: Do not do this. – HalosGhost Jun 30 '14 at 22:14
1  
Hope this helps you out. hackingzones.com/run-vlc-as-root-in-linux-ubuntu-pear-os Chirag Singh – chirag Hz Feb 12 '15 at 21:08
1  
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 '15 at 22:51

One 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
2  
recompiling is not the only way, just change the call to geteuid to deliver 1. I describe this at linuxintro.org/wiki/Run_vlc_as_root – 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
    
@ThorstenStaerk : dead link... – Alexandre Bourlier Dec 16 '15 at 15:23
1  
@Alexandre Bourlier: works (again) – Thorsten Staerk Dec 16 '15 at 15:33

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
1  
Worked like a charm. :) – Krishnadas PC Jul 13 '15 at 1:29
    
Yeah This Is Hell :) +1 – onalbi Dec 26 '15 at 21:12

See http://www.linuxintro.org/wiki/Run_vlc_as_root:

  • 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
sed -i 's/geteuid/getppid/' /usr/bin/vlc

It works.

share|improve this answer
1  
It would be good if you could explain why this particular answer solves the problem. – Jeff Schaller Dec 29 '15 at 11:55

You will be able to run VLC as root by modifying the VLC binary, located in /usr/bin

First, you'll need a hex-editor, like Bless :

sudo apt-get install bless Then, you'll open the VLC binary with the hex-editor :

sudo bless /usr/bin/vlc Search and change the geteuid string by getppid, save and exit.

You can now launch VLC as root.

share|improve this answer

Your Answer

 
discard

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.