unable to init server could not connect connection refused
Solved: Can't launch graphical apps from terminal (unable to init server could not connect connection refused)
Problem: when we launch graphical apps from terminal as a root user,This
Steps for resolving the error:
First open terminal on Desktop ( click Any Where on Desktop and click on open terminal ).
Then type "nano gedit.sh" (Without Quotes) To create new .sh file and open in nano editor.
Then paste following lines in Terminal, "xhost +"(without Quotes) now press ctrl + O ( to save content )and ctrl + x ( to exit from nano editor )
now check file type command "ls" and hit "enter" key, mow give execution permission to file "gedit.sh" for that type following command "sudo chmod +x ./gedit.sh" ( without Quotes ).
now goto Control Center, and find Startup Application and open it,
now click on add option,
- and give name whatever you want i am giving name "gedit_start"
- now in command field click on browse and select the file which we created "gedit.sh" and click on add .
now restart your machine, and try to open graphical apps from terminal as a root, your problem definitely solved
for further query comment below we try to resolve your query.