Hacking VLC To Run As Root On Linux


If you try to run VLC under root user on Linux, you will be blocked with message : “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).“. While it is a good security practice to not run non-system executables under root privileges, but at times you might need the exception. Here’s a solution to allow VLC and cvlc (command-line version of vlc) run under the root user-account.
VLC no root allowed error
To get VLC working under root user we must hack the executable using the following method:
  1. If you are not a vi ninja, install the graphical editor using sudo apt-get install vim-gnome and start it.
  2. Open the vlc executable in vi from /usr/bin/vlc and search for string geteuid, replacing it with getppid as shown below. Make sure you make a backup of vlc app before doing this and no other changes are made to the file.
VLC set uid
vlc user id hacked
  • Save this modified vlc file and execute it again, it should now work fine under root user as shown below.
VLC working under root

Popular Posts