Reputation: 11
I am installing intellij in the development machine, linux system, but when i run the bin/idea.sh, then installing program shows
"X11 connection rejected because of wrong authentication. Failed to initialize graphics environment"
what's wrong with it
Upvotes: 1
Views: 6990
Reputation: 97
If you want to run as root, then you can do this(below is for clion but should work for intellij as well) -
This error occurs because the default configuration of the X server permissions does not allow the root to connect to it. To verify this, we used xhost X server access control program to check the permissions. Executing xhost with no command line arguments gave us a message indicating whether or not access control was currently enabled, followed by the list of those users allowed to connect. For example in our case the output was as follows:
[george@bytefreaks bin]$ xhost
access control enabled, only authorized clients can connect SI:localuser:george To add root to the list of users that was allowed to start an X application we executed the following command:
[george@bytefreaks bin]$ xhost +si:localuser:root
localuser:root being added to access control list
Executing xhost again, we got the updated list which included the root
[george@bytefreaks bin]$ xhost
access control enabled, only authorized clients can connect SI:localuser:root SI:localuser:george After this, we were able to start CLion using sudo with no problems.
[george@bytefreaks bin]$ sudo ./clion.sh
Note: This patch is not permanent, we actually execute it once at every restart of the machine.
Source - https://bytefreaks.net/gnulinux/start-clion-as-root-on-fedora
Upvotes: 0
Reputation: 3837
main_user
, but root
or something else. Just run:
sudo su main_user
./idea.sh
Also, you may want to be able to run IDEA for different users like:
main_user
, root
, dummy_user1
, dummy_user2
, etc.
In this case, you must provide access to a display as the main_user
:
sudo su main_user
- switch to the main_user
xhost +
- add access for a display to all userssudo su root
- switch to the root
./idea.sh
- as you see now you can run apps using different users [1, 2] - work for Ubuntu 17.10
Update:
The next day I couldn't run ./idea
because some errors appeared. So I did this:
export DISPLAY=:1
to the /etc/environment
filemain_user
root
(this login switch is required in order to apply changes in /etc/environment
)Upvotes: 0
Reputation: 39
Problem is you are running the idea.sh as root. Try running it again as a user it will start.
Upvotes: 3