Failed to parse arguments: Cannot open display:

Hello Experts,

Getting following error while execute cmd from ssh :-

[root@200 ~]# separateBod
ENTER SERVER IP LAST 1 QUADRANT WHICH YOU WANT TO BOD:
119
Option "-t" is deprecated and might be removed in a later version of gnome-terminal.
Option "-t" is deprecated and might be removed in a later version of gnome-terminal.
Failed to parse arguments: Cannot open display:

separateBod Code:-
#!/bin/bash
printf "ENTER SERVER IP LAST 1 QUADRANT WHICH YOU WANT TO BOD"
 read IPNAME
 for i in $IPNAME
 do
  ssh user@192.168.1.$i BOD & pid=$!
 done

BOD Code:-
#!/bin/bash
gnome-terminal \
        --tab -t "Exchange" -e " sh -c 'sleep 1s; ./startapp Exchange' "\
        --tab -t "Dragon" -e " sh -c 'sleep 10s; ./startapp Dragon' "\

startapp code:-
ulimit -c unlimited
export LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH}
./$1 $2 $3 $4 $5

After giving execution cmd from server (ssh) it should be displayed on other server vnc (user@192.168.1.119), it was working properly till last week suddenly i got this error, we have following versions of CentOS 64bit (6.7, 6.8, 6.9, 7.4), getting issue only with 7.4 64bit.

please suggest.
LVL 1
Rajat SehgalFounder Enhance TechnologyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dfkeCommented:
Hi,

it seems you have an issue with your display setting.

What output do you get if you issue 'echo $DISPLAY'?

The output should be something like - :0 or 0:0

Cheers
0
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
Output :-
[root@119 ~]# echo $DISPLAY

[root@119 ~]#

There is nothing output
0
dfkeCommented:
Hi,

Okay can you check if the particular user has an ~/.Xauthority file? This file is needed as it contains the MIT-MAGIC-COOKIE.

If not then probably xorg-x11-xauth is not installed or not correctly installed with the minimal package set.

When using MIT-MAGIC-COOKIE-1, the client sends a 128 bit “cookie” along with the connection setup information. If the cookie presented by the client matches one that the X server has, the connection is allowed access.

If ~/.Xauthority is not present then try to install xorg-x11-xauth
yum -y install xorg-x11-xauth

Open in new window


Then close the ssh connection to your remote server and give it another try.

Cheers
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Rajat SehgalFounder Enhance TechnologyAuthor Commented:
Xauthority file already available in system

[root@119 ~]# yum -y install xorg-x11-xauth
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package 1:xorg-x11-xauth-1.0.9-1.el7.x86_64 already installed and latest version
Nothing to do
[root@119 ~]#
0
dfkeCommented:
Hi,

now that's interesting!

Another thing that just crossed my mind is that when IPV6 is disabled , then any ssh client that connects to it and tries to use X11 forwarding will fail to set the DISPLAY variable and thus X11 forwarding will not work. Unless the server is explicitly configured to listen only to IPV4.

The reason is because the default setting is to listen to both IPV4 and IPV6 at the same time.

So did you by any means disable IPV6?

Cheers
0
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
no i didn't, there is configured only IPV4.
0
dfkeCommented:
Hi,

sad to say that I'm out of options at this point. I will give it some more thought when I'm not too busy working.

You forgot to mention if you had a ~/.Xauthority file by the way. Is it even there?

Cheers
1
serialbandCommented:
Option "-t" is deprecated and might be removed in a later version of gnome-terminal.
Failed to parse arguments: Cannot open display:
Maybe change your script and replace the -t with --title
0
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
No improvement after implementation --title

Option "--title" is deprecated and might be removed in a later version of gnome-terminal.
Option "--title" is deprecated and might be removed in a later version of gnome-terminal.
Failed to parse arguments: Cannot open display:
0
serialbandCommented:
The error is that it failed to pars arguments, and the suspect argument is identified in the messages above.  Then try removing the --title section to see if that fixes it.
0
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
nope, after removing we get following:-

[root@200]# separateBod
ENTER SERVER IP LAST 1 QUADRANT WHICH YOU WANT TO BOD:
119
Failed to parse arguments: Cannot open display:
0
serialbandCommented:
Ok, then one of your other lines of code is bad.  I'd put back the gnome lines and take out one of the other lines to see which one it  might be.
0
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
Hi,
It's working after reinstall CentOS 7.4

Cool Thanks Everyone
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rajat SehgalFounder Enhance TechnologyAuthor Commented:
I didn't get solution after a long discussion, after that i'd to reinstall OS. Now its working fine.
0
dfkeCommented:
Hi,

good that things worked out :)  The issue however must have been the fact that the display variable at some point wasn't set for some reason. Sometimes it's better to reinstall like you did. it saves alot of time.

Cheers
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.