Table of Contents
Introduction
When attempting to install software binaries, create a database, or perform any task that involves a Graphical User Interface (GUI), we encounter the "X11 variable not set" error.
ERROR: Unable to verify the graphical display setup. This application requires an X display. Make sure that xdpyinfo exists under the PATH variable.
No X11 DISPLAY variable was set, but this program performed an operation that required it.
What is the X11 variable not set error?
In every organization, we often face tasks like installing software binaries or using GUI tools like Netmgr and DBCA for database creation. That's when the "Display not set" issue can arise, preventing the GUI from loading and disrupting our work.
In common terms, I will say if there is an issue with the display variable due to which we get this X11 variable not set error.
So, the key question is how do we fix the "X11 variable not set" error? Don’t worry—I’ve got you covered. I'll walk you through the steps to resolve this issue using Putty and MobaXterm.
How to resolve the X11 variable not set error?
1) Resolve X11 Display variable not set error if Using Mobaxterm
Step 1) We need to start our investigation from the root user by getting the Display set information.
[root@practice ~]# echo $DISPLAY
localhost:13.0
Step 2) Now we have the display information the next step is to find out the authentication list for the above variable set i.e. localhost:13.0
root user
xauth list
Output
We can see from the above output second one (practice/unix:13) is what we are looking and the same needs to be set for the Oracle user as well.
Step 3) Login from Oracle user, run the same command and match from the above output.
su – oracle
xauth list
Output
We can see from the above output that the required authentication list is not present due to which we are getting the Display not set error.
Step 4) Now we need to add the authentication list for the Oracle user as well.
xauth add practice/unix:13 MIT-MAGIC-COOKIE-1 4343ac9b1a9c5b2d9518d070e7740a2e
Output
Step 5) Now at last we need to check the DISPLAY variable and if not set as per the root user we need to set it accordingly
Oracle user
echo $DISPLAY
Output before setting the DISPLAY variable from the Oracle user
Output after setting the DISPLAY variable from the Oracle user
export DISPLAY=localhost:13.0
Step 6) Now again re-run the runInstaller script and check this time you will not face the display error issue.
cd $ORACLE_HOME
./runInstaller
Output
2) Resolve X11 Display variable not set error if Using Putty
Note:- In this case, you need to install the Xming software on your machine.
Step 1) I’m assuming you’ve already completed the essential steps, such as creating groups, setting up users, copying the zip files, and extracting them. If you haven't completed these steps, please refer to this article on how to install Oracle 19c binaries on Linux.
Step 2) Log in to the putty console and save the connection by enabling the X11 Forwarding option.
Step 3) Next, expand the SSH tab under the connection settings, click on the X11 tab, and enable the X11 forwarding option to launch the GUI interface using Xming.
Note: – Usually, we forget to enable this setting, which leads to the "Display not set" issue.
Path: Connection—>SSH—>X11—> Enable X11 Forwarding option
Output
Step 4) Now, open the connection, set the DISPLAY variable as the Oracle user, and run the runInstaller command. If all settings are configured correctly shown in the above steps, you shouldn't encounter the "Display not set" issue.
Note: – Make sure your Xming software is running in the background.
Output
Run as an Oracle User
a) export DISPLAY=:0
b) xhost +
access control disabled, clients can connect from any host
c) ./runInstaller
Conclusion
We can resolve the Display issue with the help of the above 2 ways. If none of them will work then you can also log in directly with the Oracle user instead of the root user.
If you enjoyed the article, please leave a comment and share it with your friends. Also, let me know which Oracle and MySQL topics you'd like to see covered in future articles.