No X11 DISPLAY variable was set putty

If youre on the main display, then

export DISPLAY=:0.0

or if youre using csh or tcsh

setenv DISPLAY :0.0

before running your app.

Actually, Im surprised it isnt set automatically. Are you trying to start this application from a non-graphic terminal? If not, have you modified the default .profile, .login, .bashrc or .cshrc?

Note that setting the DISPLAY to :0.0 pre-supposes that youre sitting at the main display, as I said, or at least that the main display is logged on to your user id. If its not logged on, or its a different userid, this will fail.

If youre coming in from another machine, and youre at the main display of that machine and its running X, then you can use ssh -X hostname to connect to that host, and ssh will forward the X display back. ssh will also make sure that the DISPLAY environment variable is set correctly (providing it isnt being messed with in the various dot files I mentioned above). In a ssh -X session, the DISPLAY environment variable will have a value like localhost:11.0, which will point to the socket that ssh is tunnelling to your local box.

Are you running this from within an X11 environment? You can use a terminal window, but it has to be within X (either after a graphical login, or by running startx).

If youre already within a graphical environment, try export DISPLAY=:0 for bash like shells (bash, sh, etc) or setenv DISPLAY :0 for C shell based shells (csh, tcsh, etc)

If youve connected from another machine via SSH, you use the -X option to display the graphical interface on the machine youre sitting at (provided theres an X server running there (such as xming for windows, and your standard Linux X server).

you must enable X11 forwarding in you PuTTy

to do so open PuTTy, go to Connection => SSH => Tunnels and check mark the Enable X11 forwarding

Also sudo to server and export the below variable here IP is your local machines IP

export DISPLAY=10.75.75.75:0.0

No X11 DISPLAY variable was set putty


Running the launcheradmin.sh script generates a "No X11 DISPLAY variable was set, but this program performed an operation which requires it" error.

The launcheradmin.sh utility does not start and generates an error of:
Exception in thread "main" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless (GraphicsEnvironment.java:174) at java.awt.Window.<init>(Window.java:445) at java.awt.Frame.<init>(Frame.java:414) at java.awt.Frame.<init>(Frame.java:379) at javax.swing.SwingUtilities.getSharedOwnerFrame (SwingUtilities.java:1830) at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1684) at com.ibm.websphere.dtx.launcher.gui.EventServerAdmin.<init> (Unknown Source) at com.ibm.websphere.dtx.launcher.gui.EventServerAdmin.main (Unknown Source)

at com.ibm.websphere.dtx.launcher.gui.EventServerAdminConsole. main(Unknown Source)

The UNIX DISPLAY environment variable has not been set properly.

If the value returned is blank or not the correct hostname, correct the DISPLAY value by exporting the DISPLAY environment variable. The syntax for this command is:

export DISPLAY=<hostname_to_display_X11_graphics_to>:0.0

Similar errors occur for the resourceregistry.sh and mgmtconsole.sh utilities and can also be corrected by exporting the DISPLAY environment variable.

[{"Product":{"code":"SSVSD8","label":"IBM Transformation Extender"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Launcher Administration","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"8.3;8.4;8.4.1","Edition":"","Line of Business":{"code":"LOB02","label":"AI Applications"}}]

Mercator Ascential DataStageTX

I was encountering a similar issue, this evening. Similarly, I'm running Virtualbox on a Microsoft Windows Host OS. The Guest OS I'm using is Kubuntu, but of course the configuration between each of XMing, PuTTY, and Virtualbox would be similar. Though my reply is a little belated, maybe it'll be of help.

This solution was made with a VirtualBox virtual appliance publishing a NAT type network interface adapter to the host OS. For other network interface adapaters, the configuration might differ.

Using the NAT adapter, this configuration requires the IP address of that adapter, on the Microsoft Windows side. That address may be determined in the Windows Explorer shell, via the *Network and Sharing Center" window, in which one would 'click' on the _Virtualbox Host-Only Network adapter_. In the resulting 'Status' window, then after selecting the 'Details' button, the IPv4 address for the Virtualbox host-only network interface -- on the Microsoft windows side of the interface -- will be displayed in that status window. On my PC, the address is 192.168.50.1.

If should the IP address collide with other network devices, the IP address can be changed, via the 'Properties' window -- as available from the same 'Status' window -- then selecting the IPv4 item, and the 'Properties' button, then entering a different IP address. Of course, the Virtualbox virtual appliance should not be running when the address is changed, or Windows might not correctly propagate the address change for that interface.

So, having determined the IP address on the Windows side of the adapter, then one may run the VirtualBox Qt GUI, to add a port forwarding rule for the same virtual appliance in Virtualbox. I'm sure that there's a convenient shell command that could be used for adding the port forwarding rule with VBoxManage, alternately. Of course, the GUI configuration is rather straightforward, too.

The port forwarding change, in the respective Virtualbox virtual appliance, can be made via the 'Networking' page under the virtual appliance's Settings dialogue window. The button, 'Port Forwarding' displays a simple configuration window for the port forwarding rules, in the respective virtual appliance.

Adding a new port forwarding rule for the SSH config, the IP address that was determined from the adapter, in the Microsoft Windows guest OS, that address would be entered as the 'Host IP' address. An arbitrary port number above 1024 would be entered as the 'host port' for the port forwarding rule. Then, then the SSH server's port within the virtual appliance --- typically, 22 -- that would be added as the 'Guest port' for the port forwarding rule. Personally, I've left the 'Guest IP' field blank, and it works out just as well.

So, that would have served to configure Virtualbox to allow an SSH connection from the host PC to the guest OS. (Of course, one might wish to assume that that should not be necessary, when the NAT host-only adapter is selected. Apparently, the port forwarding rule is needed even with the NAT network adapter type) The configuration can be tested out using a regular Putty session, e.g to 192.168.50.1:2222

I've used Xlaunch in my own configuration. Evidently, the configuration as created with Xlaunch would serve to ensure that XMing would manage the X11 part of the port forwarding, as when Xming would thus be configured to use PuTTY or SSH. I've not interacted directly with PuTTY, in this much of the configuration.

Simply, when using Xlaunch for the Xming configuration: Then, in the last page of of the configuration dialogue window, in Xlaunch, one must enter the "host port" from the port forwarding rule, along with the appropriate command line argument for PuTTY or SSH, e.g. "-P 2222" without the quotes, of course. That would go into the "Additional parameters for PuTTY or SSH" field in the Xlaunch configuration window. In the resulting dot-xlaunch XML file, it shows up as ExtraSSH="-P 2222"

Then, "It just works," LoL. Of course, if a network interface adapter other than NAT would be selected in the virtual appliance's settings, then the successful configuration might differ widely from that denoted here.

If you are using Windows Desktop / Laptop and wanted to run a GUI application on LINUX or UNIX System then you need to use X11. The X11 allows taking GUI access over SSH to any of the LINUX or UNIX systems to run any application/program in GUI.

There are few things that needs to be taken care of:

1. Make sure the X11Forwarding is enabled in the ssh_config file. In Linux, the SSH terminal supports X forwarding by default however for MAC or UNIX (HPUX, AIX, etc..) OS you need to enable by making changes in the config file.

The ssh_config file typically located at /etc/ssh/ssh_config or ~/.ssh/config). Check If ssh_config includes #X11Forwarding no OR X11Forwarding no. Make sure it should be X11Forwarding yes in your ssh_config file.

Steps:  #Vi /etc/ssh/ssh_config  or Vi /etc/ssh/sshd_config

Make sure X11forwarding is yes

2. You must have X Server running on your Laptop/Computer, the X Server manages the interaction between the remote server ( X Client ) and your laptop/computer. You can download and install Xming on your system. Then, start the Xming before connecting to the remote system with your SSH client (for example, PuTTY).

Steps: Open XLaunch and do the below settings highlighted as YELLOW in all below screenshots:

No X11 DISPLAY variable was set putty

Next >>

No X11 DISPLAY variable was set putty

Next >>

No X11 DISPLAY variable was set putty

Next >>

No X11 DISPLAY variable was set putty

3. In PuTTY.exe for Windows, you can enable X11 forwarding in new or saved SSH sessions by selecting Enable X11 forwarding in the “PuTTY Configuration” window.

Steps :: Open PuTTY.ext  >> Go to Connection >>  SSH  >> X11 >> Select Enable X11 forwarding

No X11 DISPLAY variable was set putty

4. log in to the server by mentioning IP, Username & Password.

It will auto-set the DISPLAY Variable for this session, which you can check by using the #echo $DISPLAY command.

5. Once you are logged in to the server then execute xclock command, it will open-up xclock in pop-up.

No X11 DISPLAY variable was set putty

You are done 🙂

Known Issues in Setting-up DISPLAY or its environment variable.

Error: Can’t open display  OR Error: Can’t open display: localhost:0.0 ==> This issue occurs when DISPLAY is not or not correctly configured. You can crosscheck using the below command:

#echo $DISPLAY

No X11 DISPLAY variable was set putty

No X11 DISPLAY variable was set putty

If it shows “DISPLAY: Undefined variable.” That means the DISPLAY Variable is not set.

No X11 DISPLAY variable was set putty

Solution:: Either configure/set it manually using the below command or simply follow all the above 5 steps to configure the DISPLAY.

Export DISPLAY=localhost:0.0    OR   setenv DISPLAY localhost:0.0

  • DISPLAY is properly configured xclock is also opening however when trying to open any X-based Application then shows below error è It’s an X11Forwarding issue while authentication.

Xlib: connection to “localhost:14.0” refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted

OR

X11 connection was rejected because of wrong authentication.
X connection to localhost:14.0 broken (explicit kill or server shutdown).

No X11 DISPLAY variable was set putty

Solution: Edit /etc/opt/ssh/ssh_config OR /etc/opt/ssh/sshd_config, add/modify X11UseLocalhost no.

No X11 DISPLAY variable was set putty

Re-run your application, It will work J.

Don’t forget to comment if it solves your issue and if it doesn’t then mention the error will try to assist further.