Installing & running VLC as root on RHEL/CentOS

VLC player is free & open source cross platform multimedia player that is available for Windows, Linux, Mac , Android, IOS etc & plays almost all the available audio & video formats available. It can also be used as a streaming media server & also boasts compression feature for many audio and video formats. It is by far the most popular & most powerful media player. In this tutorial, we are going to install VLC on RHEL/CentOS servers & will run it under root user, which by default is not permitted (& not advised as well).

Pre-requisites

Since VLC player is not available with the default RHEL or CentOS repositories, we will need to install & activate the 3rd party repositories. We can install & enable either of the,  nux-desktop or Epel repository using the links below,

EPEL-repository

RHEL/CentOS 7

$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm

RHEL/CentOS 6 (64 Bit)

$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

RHEL/CentOS 6 (32 Bit)

$ rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

 

Nux-desktop Repository

RHEL/CentOS 7

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

RHEL/CentOS 6 (64 Bit)

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

RHEL/CentOS 6 (32 Bit)

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-3.el6.nux.noarch.rpm

 

Installing VLC-Player

Now that the repository has been installed & enabled on our system, we can simply install VLC player by running,

$ yum install vlc

After installation, we can run VLC by typing,

$ vlc

In bash terminal or double click on the audio/video you want to play & select VLC when asked to default player.

Note:- VLC-player can’t be used with root as a user, you have to run it as a normal user.

 

Running VLC-player as root

Though it is not advisable to run any application with root privileges but there is a way to run VLC-player as root. This process has tested for CentOS 6 & same process should work on RHEL/CentOS 7 as well.

Firstly, create a backup of /usr/bin/vlc file for the reason if we want to revert back,

$ cp /usr/bin/vlc /usr/bin/vlc.bkp

Next, we will install hexedit utility , which we will use to edit the file

$ yum install hexedit

after its installed, open /usr/bin/vlc with hexedit

$ hexedit /usr/bin/vlc

Next press “TAB” & then “Ctrl + s” to search ASCII string. A search box will open, where we will type “geteuid” & replace it with “getppid”. Press “Ctrl + x” to save the file. Now try to run VLC-player while logged in as root, it will work fine.

Shujat Husain

A continuous learner with several years of experience in linux environment. I love to read, learn & write about Linux & new technologies. And I also write at linuxtechlab.com

What is in your mind, about this post ? Leave a Reply

Close
  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us