-
Solution
X server provides graphics display services, and receive user input for the graphics applications (like Windows manager) to process. xhost is used to control the access permission of X server.
For example, when you want to use host A to log in host B, for applications, host A is the client; but for graphics, since they’re shown on host A, host A is the server, and X server on it needs to be used. To do this, you need to run xhost + on host A to have other users get permission to visit its X server.
However, when running xhost in Linux environment, there might be some users facing this unexpected issue: unable to open display. How to fix it?
Solution
Step 1: paste the following commands
[root@localhost ~]# vncserver
New 'localhost:1 (root)' desktop is localhost:1
Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost:1.log
[root@localhost ~]# export DISPLAY=localhost:1
[root@localhost ~]# xhost +
access control disabled, clients can connect from any host
Step 2: Login as root user
Type xdpyinfo command, record all strings behind name of display:
Execute xhost+ to get access control disabled, clients can connect from any host
If cannot get the corresponding result, type export DISPLAY=0 to redo it.
Execute xhost+ ip (the server which you want it to use the service)
Login as oracle user
If the string after name of display: under root login is 127.0.0.1:1.0
Then execute export DISPLAY=:1.0 as oracle user
Step 3: install Xshell 5
Step 4: Select the Linux system you want to connect, enter user name and password.
Step 5: Connection succeeds. startx command information appears.
Besides physical servers, X server can also be used on virtual machines. You can use Vinchin Backup & Recovery to backup VM data for complete data protection. 60-Day full-featured free trial available to download.
Share on: