Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No protocol specified" when running a sudo/su app on Ubuntu Linux

Tags:

ubuntu

ireport

I try to run the iReport 5.6 on Ubuntu and Java 7, using the command:

$ sudo iReport-5.6.0/bin/ireport
No protocol specified.

I get an error. When I try run it without sudo, I get a permission denied error and an alert that the file Preferences on Default System are read only.

like image 261
essejoje Avatar asked Dec 10 '22 07:12

essejoje


2 Answers

Newer systems by design don't allow graphical applications as root (it's a Wayland thing). Workaround:

xhost si:localuser:root

sudo   your-graphical-app

Restore the default permissions:

xhost -si:localuser:root
like image 162
kubanczyk Avatar answered Dec 12 '22 20:12

kubanczyk


It looks like either the display port is not opened in your system or it is disabled.
Try running this command as non-root user:

xhost +

and then run the app with root.

like image 33
Rishiraj Anand Avatar answered Dec 12 '22 20:12

Rishiraj Anand