Starting VLC as Root

*nix specific usage questions
johndoe32102002
New Cone
New Cone
Posts: 7
Joined: 18 Feb 2008 08:10

Starting VLC as Root

Postby johndoe32102002 » 22 Feb 2011 18:20

I am trying to start VLC as root. I am finding it impossible to do so. Is there a flag to allow root, such as:
vlc --as-root

vlc --as-root
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).

As a temporary workaround, I am using totem. I want to use VLC as root, no workarounds to that, Sorry.

Thank you.
My PGP Public Encryption Key:
http://johndoe32102002.blogspot.com

Rémi Denis-Courmont
Developer
Developer
Posts: 14998
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Starting VLC as Root

Postby Rémi Denis-Courmont » 22 Feb 2011 21:31

sudo vlc-wrapper
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

johndoe32102002
New Cone
New Cone
Posts: 7
Joined: 18 Feb 2008 08:10

Re: Starting VLC as Root

Postby johndoe32102002 » 22 Feb 2011 23:32

sudo vlc-wrapper
Cannot determine unprivileged user for VLC!

Can you specify how to modify vlc-wrapper to run VLC as root or specify another method to run VLC as root?
My PGP Public Encryption Key:
http://johndoe32102002.blogspot.com

Rémi Denis-Courmont
Developer
Developer
Posts: 14998
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Starting VLC as Root

Postby Rémi Denis-Courmont » 23 Feb 2011 17:05

It automatically uses the user that invoked sudo (which cannot be root itself)
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

magik
New Cone
New Cone
Posts: 2
Joined: 23 Feb 2011 18:08

Re: Starting VLC as Root

Postby magik » 23 Feb 2011 18:19

hello

i use :

su - YOURUSER_NOT_ROOT -c 'vlc'

johndoe32102002
New Cone
New Cone
Posts: 7
Joined: 18 Feb 2008 08:10

Re: Starting VLC as Root

Postby johndoe32102002 » 23 Feb 2011 23:08

I have and want no other users on the system except for root. Isn't there a flag I can enable to allow root?
My PGP Public Encryption Key:
http://johndoe32102002.blogspot.com

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Starting VLC as Root

Postby Sébastien Escudier » 24 Feb 2011 08:13

no you can't and this is discouraged.

If you still want to do that you would need to recompile vlc.

Rémi Denis-Courmont
Developer
Developer
Posts: 14998
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Starting VLC as Root

Postby Rémi Denis-Courmont » 24 Feb 2011 17:51

Sure, there is compilation flag for user-less Linux installation (--enable-run-as-root if I recall correctly).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

johndoe32102002
New Cone
New Cone
Posts: 7
Joined: 18 Feb 2008 08:10

Re: Starting VLC as Root

Postby johndoe32102002 » 24 Feb 2011 23:05

For future reference, that flag seemed to configure, also found in the ./configure --help:
./configure --enable-run-as-root && make && make install

VLC Developers, Thank You for adding that flag!
My PGP Public Encryption Key:
http://johndoe32102002.blogspot.com

navneet_6
New Cone
New Cone
Posts: 1
Joined: 03 May 2012 17:05

Re: [SOLVED] Starting VLC as Root

Postby navneet_6 » 03 May 2012 17:15

I did the following and VLC is now running in root mode.
I downloaded the latest version (2.0.1), copied to /Applications.
Opened the following file in a hex editor: /Applications/VLC/Contents/MacOS/VLC (for this right click VLC app and "Show Package Contents").
Searched for the string "geteuid" (without the quotes).
It was found at two places, changed it to "getppid" (without the quotes) at both the places.
Saved the file and VLC now runs perfectly when logged in as root on my Mac.

Wishes,
Navneet

misoxxx
New Cone
New Cone
Posts: 1
Joined: 05 May 2012 12:15

Re: Starting VLC as Root

Postby misoxxx » 05 May 2012 12:26

If someone can't use hexedit, there is a C patch for vlc 1.0.6. After patch you can run it as root. Just compile, move to folder with vlc and run. Works on my Ubuntu 10.04. Hope I helped!

Code: Select all

#include <stdio.h> #include <stdlib.h> int main(void) { char new[] ="getppid"; FILE * fp = fopen("vlc", "rb+"); if(fp == NULL) { fprintf(stderr,"Cant open file vlc.(It must be named vlc.)\n"); exit(EXIT_FAILURE); } fseek(fp,1571,SEEK_SET); fwrite(new,1,7,fp); fclose(fp); return 0; }

Rémi Denis-Courmont
Developer
Developer
Posts: 14998
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Starting VLC as Root

Postby Rémi Denis-Courmont » 16 May 2012 08:18

There is a configure-time option to run it as root, IIRC.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

bhumish
New Cone
New Cone
Posts: 1
Joined: 08 Nov 2012 07:40

Re: Starting VLC as Root

Postby bhumish » 08 Nov 2012 07:46

Exactly! Change the 'geteuid' to 'getppid' in the vlc file, location: /bin/usr/vlc and you can open vlc as root.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 5 guests