-   Linux - Software (
-   -   Installing xhost on RH (

gvanto 05-09-2011 12:20 PM

Installing xhost on RH
I have been following tutorial:

in order to try and get gvim working with SSH forwarding.

When I run 'gvim', I get:

[02:53:12][root@host:/home]# gvim
E233: cannot open display
According to the above tutorial, I need to run 'xhost +', but to my disappointment, 'xhost' command does not exist.
So I search for 'xhost rpm package' and come to this link:

After I download and try to install the package, I get dependencies errors:


[03:10:04][root@host:/home]# rpm -ivh xorg-x11-server-utils-7.1-5.el5_6.1.i386.rpm
warning: xorg-x11-server-utils-7.1-5.el5_6.1.i386.rpm: V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
filesystem >= 2.3.7-1 is needed by xorg-x11-server-utils-7.1-5.el5_6.1.i386 is needed by xorg-x11-server-utils-7.1-5.el5_6.1.i386 is needed by xorg-x11-server-utils-7.1-5.el5_6.1.i386 is needed by xorg-x11-server-utils-7.1-5.el5_6.1.i386
rtld(GNU_HASH) is needed by xorg-x11-server-utils-7.1-5.el5_6.1.i386
I normally use Ubuntu and find that dependencies are taken care of themselves mostly, is there a way to perhaps update my repositories or something to include 'newer' packages like 'xhost'? (so that dependencies can take care of themselves)?


[03:10:11][root@host:/home]# yum search xhost
Searching Packages:
Setting up repositories
update 100% |=========================| 951 B 00:00
rpmforge 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:03
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Excluding Packages in global exclude list
No Matches found

ANy help would be much appreciated!


AlucardZero 05-09-2011 12:43 PM

What version of RHEL are you using? I hope it's 5, since you downloaded a CentOS 5 package, but if that was true then the base dependencies would have worked. It looks like you're on RHEL 4 - iirc - from the lack of rtld(GNU_HASH). But then you use yum, which isn't available on RHEL 4. Is this really CentOS 4?


I normally use Ubuntu and find that dependencies are taken care of themselves mostly
Part of the problem is that you tried to use rpm instead of yum. That's like using dpkg instead of apt-get. rpm doesn't take care of dependencies for you.

In any case you can find what package provides xhost with the following command:

yum whatprovides "*/xhost"
It's probably called xorg-x11-server-utils.
Then do:

yum install xorg-x11-server-utils

gvanto 05-09-2011 01:25 PM

Thanks much Alucard! I had no idea about this whatprovides feature, seems like a v useful one ...

Making progress - got xhost installed, installed xclock in the same fashion

Still getting error with display 'Cant open display' error when trying to open gvim


Error: Can't open display:
My putty event log shows that I X11 forwarding has been 'refused' ...
There must be a way to configure the host to be in the 'allowed to X-forward' list on the server somewhere, will try to find it ...

I've been following this: and it says to run 'xhost +' in case of display errors, only running that gives me another display problem:

xhost: unable to open display ""

gvanto 05-09-2011 01:50 PM

oh yes and I've checked the version:


Linux version 2.6.18-028stab064.8-ent (root@rh5-build-x64) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SM P Sat Oct 31 08:34:51 MSK 2009
So it's RedHat but I'm not entirely sure which version (rh5 appears in there, so does 4.1.2, etc) - how to know?

gvanto 05-09-2011 01:56 PM

Got it working! Had to restart the sshd service:

Thanks much guys!

OK, now where to find default vimrc location.

Probably need to get zshenv going ... :-)

AlucardZero 05-09-2011 02:30 PM

RHEL5 has 2.6.18, but that's not a stock kernel - all of -028stab064.8-ent is weird. 4.1.2 refers to the version of gcc used to build the kernel.

evo2 05-09-2011 11:02 PM

You shouldn't need to use xhost. Are you sure you enabled X11 forwarding in the server config file? And did you use the "-Y" flag when you ran the ssh client?

It may also be a good idea to run the ssh client with the "-v" flag to see what is going on.



gvanto 05-10-2011 01:11 AM

Thanks evo2, got it sorted.

evo2 05-10-2011 02:42 AM


Originally Posted by gvanto (Post 4351719)
Thanks evo2, got it sorted.

Ok great. I see you said you restarted sshd, but did you have to do anything else? Are you actually using xhost or is it working without it?



PS. Please use the "thread tools" to mark the thread as "solved".

gvanto 05-10-2011 05:41 PM

Was just using 'xhost +' command (not sure it helped) because the above tutorial said to do that in case of Display problems (see my prev post).

ok, will mark as solved, thanks !

All times are GMT -5. The time now is 12:13 AM.