Linux解决xhost: unable to open display ""

简介: 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/catoop/article/details/23717071 实用技巧:在...
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/catoop/article/details/23717071

实用技巧:在Linux下设置xhost方法步骤

第一步:用root登陆linux,启动vnc服务;

第二步:根据vnc起来的端口,设置exportDISPLAY=localhost:1(1表示vnc在第一个tty上启动的),vnc的启动信息见附件1;

第三步:执行xhost +,并且提示“access controldisabled, clients can connect from any host”才正确。

linux下的操作日志如下:

[root@localhost ~]# vncserver

New'localhost:1 (root)' desktop is localhost:1

Startingapplications specified in /root/.vnc/xstartupLog file is/root/.vnc/localhost:1.log

[root@localhost ~]# exportDISPLAY=localhost:1

[root@localhost ~]# xhost +

accesscontrol disabled, clients can connect from anyhost 

在设置xhost时,出现了unable的问题。使用上诉方法就可以搞定。

目录
相关文章
|
15天前
|
存储 网络协议 Linux
【Linux】进程IO|系统调用|open|write|文件描述符fd|封装|理解一切皆文件
本文详细介绍了Linux中的进程IO与系统调用,包括 `open`、`write`、`read`和 `close`函数及其用法,解释了文件描述符(fd)的概念,并深入探讨了Linux中的“一切皆文件”思想。这种设计极大地简化了系统编程,使得处理不同类型的IO设备变得更加一致和简单。通过本文的学习,您应该能够更好地理解和应用Linux中的进程IO操作,提高系统编程的效率和能力。
66 34
|
8月前
|
Linux 开发工具
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
457 3
|
Linux 开发工具
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
获取 GPG 密钥失败:[Errno 14] curl#37 - “Couldn’t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7” 这个就是安装的时候会检查key这个可以再repo文件中关闭即可
1863 0
|
5月前
|
Docker 容器
14 response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file speci
14 response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file speci
104 1
|
6月前
|
Linux
Linux0.11 文件打开open函数(五)
Linux0.11 文件打开open函数(五)
79 0
|
8月前
|
Ubuntu Linux 数据安全/隐私保护
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
229 3
|
8月前
|
Linux 开发工具
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
Linux yum 使用时提示 获取 GPG 密钥失败Couldn‘t open file RPM-GPG-KEY-EPEL-7
193 2
|
9月前
|
存储 Linux
linux上SVN出现 "Unable to connect to a repository at URL 'svn://xx.xx.xx.xx/xxx' 和 No repository ...
centos上安装了svn, 有时候会不知道什么原因出现客户端小乌龟无法连接或无法提交等情况
314 5
|
9月前
|
Linux 开发者
Linux文件编程(open read write close函数)
通过这些函数,开发者可以在Linux环境下进行文件的读取、写入和管理。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
193 4
|
9月前
|
存储 Linux
Linux文件编程(open read write close函数)
Linux文件编程(open read write close函数)
286 0