LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2016, 07:05 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,081

Rep: Reputation: 165Reputation: 165
Cannot run sudo gnome-disks over vnc


I have a couple of servers running CentOS 7 minimal + X Window system + mate-desktop-environment. I normally administer them over ssh. If I need a GUI I have tigervnc running on the servers and I can launch my desktop on the server by issuing
Code:
vncserver :1 -geometry 1600x900 -depth 16
in my ssh session. I connect to the desktop using vinagre on my CentOS 6 machine. Works great. Except...

If I need to run a program with administrative privileges and I try to run the program from a terminal ON THE SERVER for example
Code:
sudo gnome-disks
I receive an error
Code:
** (gnome-disks:2333): WARNING **: Could not open X display
No protocol specified
(gnome-disks:2333): Gtk-WARNING **: cannot open display: :1.0
This error does not occur if I am accessing the server from the console (monitor and keyboard attached to the server machine). It seems there is something I need to tweak in the tigervnc configuration but I am not having any luck finding it. Or perhaps I need to change the way I invoke the program to tell it to use display :1? Any ideas?

TIA,

Ken
 
Old 10-12-2016, 07:35 PM   #2
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
Not a permanent solution, but can you try:

xhost +
 
1 members found this post helpful.
Old 10-12-2016, 08:12 PM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,081

Original Poster
Rep: Reputation: 165Reputation: 165
Thanks c0wb0y. A brilliant workaround. I opened the terminal on the server over vnc, typed xhost +, ran my program with the required admin privileges and then reestablished access control with xhost -. For those infrequent occasions when I need admin access - in this case to run SMART tests without having to re-authenticate for each disk - I am in business.

Thanks again,

Ken
 
Old 10-12-2016, 08:14 PM   #4
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
No worries, glad to help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "sudo: Can't mkdir /var/run/sudo/%user%: File exists" CNBarnes Linux - Server 7 01-10-2011 04:11 PM
(Sudo) command can't run by sudo rahilmaknojia Linux - Server 8 06-25-2010 09:30 AM
gnome launcher won't run a sudo command directly or via a script gnreeke Linux - Desktop 1 06-23-2009 10:44 AM
need VNC to allow 'logout/login' from Gnome (gnome & VNC runs fine) spudler Linux - Networking 3 11-14-2004 10:02 AM
Getting VNC to run with Gnome Dark_Helmet Linux - Software 2 07-02-2003 12:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration