Question: I'm trying to use the script check\_vmware\_api to get informations of my esxi but I get the following error: 

```
[root@centreon plugins]# ./check_vmware_api.pl 
Can't locate Monitoring/Plugin/Functions.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_vmware_api.pl line 39.
BEGIN failed--compilation aborted at ./check_vmware_api.pl line 39.

```

Answer: 
The reason is that `gnome-terminal` forks itself into the background. If you run it in your interactive `ssh` session, you will notice that you get a new command prompt even though the terminal is still open. In the non-interactive case, as soon as this happens, `ssh` will think the command has terminated and closes the session, including closing the listening X11 socket on the server. Since there are still active X11 connections, `ssh` doesn't exit immediately, which is why it *looks* as if the session is still active, however no new X11 connections can be opened.

You used to be able to do this by using `gnome-terminal --disable-factory`, however this has unfortunately been removed from `gnome-terminal` at some point. You have two options now:

* Use another terminal program that doesn't fork into the background, for example `xterm`
* Directly after starting `gnome-terminal`, in the same `ssh` session run a command that doesn't terminate, for example `ssh -Y server 'gnome-terminal; echo Press enter to exit; read'`
Configuration:

* CentOS Linux release 7.6.1810 (Core)
* `/etc/ssh/sshd_config` contains:

```
X11Forwarding yes

```

The following commnand works for me:

```sh
ssh -Y HOST bash -l -c gnome-terminal --display=${DISPLAY} < /dev/null > /dev/null  2>&1 &

```

The `gnome-terminal --disable-factory` informed me `--disable-factory` was no longer supported.