xhost + is not working with Oracle installation
Solution 1
If I understand correctly you are using a windows PC with a running X server. You are trying to use putty to connect to an ubuntu server and run commands on that host that need to access your local X server.
After connecting to the server echo $DISPLAY
should give a meaningful value and something like xdpyinfo
should work. (That should be the magic putty/ssh is doing.)
Your command is able to connect to your local display server, because $DISPLAY
points to the correct display and ~/.Xauthority
provides the correct credentials to access that display.
For another user to access that display, that user needs both pieces of information.
The easiest way is to simply ssh directly to the oracle user.
One other way to do so would be:
chmod a+r ~/.Xauthority
XAUTHORITY=$HOME/.Xauthority sudo -u oracle runInstaller
The first command allows the oracle user to read your credentials. The second command explicitly points to that file and runs the installer as the oracle user.
Solution 2
There are many ways to do this. I did something below convenient to me and always works fine.
- On your remote server, make sure to install xorg-x11-xauth, xorg-x11-font-utils, xorg-x11-fonts.
- Run the Xming Server on you local desktop
- On putty, before ssh to the server, enable the X11 forwarding and set the display location to localhost:0.0
- On the server, .Xauthority file is generated and notice that the DISPLAY variable is already set.
$ xauth list
$ xauth add
To test it, type xclock or xeyes
Note: To switch user, copy the .Xauthority file to the home directory of the respective user and also export the DISPLAY variable from that user.
Related videos on Youtube
Comments
-
iso_9001_ over 1 year
I am trying to install
Oracle
onUbuntu 14.04
. I have followed instructions and now I am trying to start the installation. However, I am facing problems.If I run
./runInstaller
command withoracle
user, I am facingStarting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 19088 MB Passed Checking swap space: must be greater than 150 MB. Actual 8191 MB Passed Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
problem. If I enter yes, I face
NoClassDefFoundError
.If I switch to
root
user and enterexport DISPLAY=:0.0 xhost +
I am facing
xhost: unable to open display ":0.0"
error.xdpyinfo
command also returnsxdpyinfo: unable to open display ":0.0".
error message.My
/etc/hosts
file contains these lines:127.0.0.1 localhost 10.0.1.23 bnet-test
I have tried various advices but none worked for me so far. I am connecting to a remote
Linux Ubuntu
machine throughVPN
and am usingPutty
asSSH
client withX11-Forwarding
enabled.What might be my problem?
-
michas over 8 yearsDo you try to install locally or remotely via ssh or something? how exactly do you run the installer as oracle user? (Are you aware of
sudo -u oracle
?) -
iso_9001_ over 8 years@michas I connect to vpn first. Then I start putty and connect to server with x11 enabled. Then I switch to user oracle and cd to database directory and run ./runInstaller
-
-
iso_9001_ over 8 yearsI am using a Windows machine and connecting to a remote Linux server with putty but there is no X server running on my Windows if there is such thing other than X11 forwarding on putty. I will try your suggestions now. Thank you.
-
michas over 8 yearsIf there is no X server running, any attempt to connect to the X server will fail. There is also no point in forwarding your X server, if there is no X server. - Maybe you should install an X server first.
-
iso_9001_ over 8 yearsWell I googled it and saw Xming X Server and I will install this. Will installing Xming suffice?
-
iso_9001_ over 8 yearsOK, I managed to use
Xming
withPutty
. Nowxhost +
command gives meaccess control disabled, clients can connect from any host
warning. -
michas over 8 yearsDo not use
xhost
. This would allow anyone from anywhere to access your display without any authorization. Use x-forwarding instead as described above. -
iso_9001_ over 8 yearsThis is magic. You can't imagine how happy I am. Thank you very much :)