Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Problems running some commands with sudo

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Ashde
Posts: 2
Joined: 2020-04-06 14:22

Problems running some commands with sudo

#1 Post by Ashde »

Hi, I've tried everything I can find and I don't know where to go from here.

Running Debian 10

Running 'sudo virt-manager' results in the following:

Code: Select all

No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Could not connect: Connection refused

(virt-manager:11107): Gtk-WARNING **: 11:22:57.950: cannot open display: :0
Something similar also happens with 'sudo nautilus'

Code: Select all

** (nautilus:11210): WARNING **: 11:25:23.016: Error on getting connection: Failed to load SPARQL backend: Error spawning command line ?dbus-launch --autolaunch=b96e71e6e1714e77a7498f75a0399479 --binary-syntax --close-stderr?: Child process exited with code 1

(nautilus:11210): GLib-GIO-CRITICAL **: 11:25:23.017: g_dbus_connection_signal_unsubscribe: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(nautilus:11210): GLib-GObject-CRITICAL **: 11:25:23.017: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(nautilus:11210): GLib-GObject-CRITICAL **: 11:25:23.017: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
No protocol specified
Unable to init server: Could not connect: Connection refused

(nautilus:11210): Gtk-WARNING **: 11:25:23.021: cannot open display: :0
...and finally running 'sudo seahorse'

Code: Select all

No protocol specified
Unable to init server: Could not connect: Connection refused
seahorse: Cannot open display: 
These are the only three I've found that have this problem. Included them together because they seem like they may be caused by the same problem.
Running without sudo works normally.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Problems running some commands with sudo

#2 Post by Head_on_a_Stick »

Ashde wrote:this problem
It's not a "problem", those applications are forbidden from running as root by design. I presume this is the GNOME desktop?

They can be made to work under sudo:

Image

But I'm not telling you how I did that :P

Why do you want to run those programs as root anyway? What is it you are trying to do with them?
deadbang

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: Problems running some commands with sudo

#3 Post by CwF »

virt-manager will run fine on a root desktop. Never does it need sudo. The regular user doesn't need root or sudo, just be in the right group.

Ashde
Posts: 2
Joined: 2020-04-06 14:22

Re: Problems running some commands with sudo

#4 Post by Ashde »

Head_on_a_Stick wrote:Why do you want to run those programs as root anyway? What is it you are trying to do with them?
When selecting my ISO for a new VM (which is on a different drive) I get "The emulator may not have search permissions for the path '/pathto/.iso/'" and asks to correct that. It can't actually change the permissions though, and I was told to try running virt-manager with sudo and then doing the same thing.

And yes, GNOME desktop.

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: Problems running some commands with sudo

#5 Post by CwF »

Ashde wrote:'/pathto/.iso/'"
from wherver the iso is link it to the standard directory
Example of a thunar custom action

Code: Select all

sudo ln -s --target-directory=/var/lib/libvirt/images %f
Then select the iso from the default storage pool.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Problems running some commands with sudo

#6 Post by Head_on_a_Stick »

Ashde wrote:I was told to try running virt-manager with sudo
Whoever told you that is an idiot, don't listen to them.
deadbang

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1404
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 46 times
Been thanked: 68 times

Re: Problems running some commands with sudo

#7 Post by None1975 »

Ashde wrote:Running 'sudo virt-manager'
But why? Why do you need sudo privileges? Bad habit, or you came from Windows land? Anyway, don't do that! I'd facepalm, but we're not supposed to touch our faces any more.
I was told to try running virt-manager with sudo and then doing the same thing.
Maybe this guy is an idiot, or maybe he’s a cyber criminal ...who knows...
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Problems running some commands with sudo

#8 Post by stevepusser »

Head_on_a_Stick wrote:
Ashde wrote:I was told to try running virt-manager with sudo
Whoever told you that is an idiot, don't listen to them.
Some morons think sudo is like bacon--it makes everything better.
MX Linux packager and developer

Post Reply