配置ubuntu的VNC时遇到报错_XSERVTransmkdir: Mode of /tmp/.X11-unix should be set to 1777

现在win11内嵌了ubuntu系统,我在根据打造基于 VNC 的 Ubuntu 20.04 的远程桌面 配置VNC server时,到了 vncserver :1 这一步,遇到报错:

vncserver: /usr/bin/Xtigervnc did not start up, please look into '/root/.vnc/xxxxx.:1.log' to determine the reason! -1
Killing Xtigervnc process ID 4921... success!

通过查看日志的命令:

cat /root/.vnc/xxxxx.:1.log

定位到报错信息:

_XSERVTransmkdir: Mode of /tmp/.X11-unix should be set to 1777
_XSERVTransSocketCreateListener: failed to bind listener
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for unix

找到相关博客 vnc issue after reboot,试图手动给 /tmp/.X11-unix 文件开权限:

mkdir /tmp/.X11-unix /tmp/.X11-pipe 2>/dev/null
chmod 1777 /tmp/.X11-unix /tmp/.X11-pipe

但是又遇到了报错:

chmod: changing permissions of '/tmp/.X11-unix': Read-only file system

再找到解决方案 How to make read-only file system writable?

sudo mount -o remount,rw '/tmp/.X11-unix'

然后执行(一定要切到 root 用户下)

mkdir /tmp/.X11-unix /tmp/.X11-pipe 2>/dev/null
chmod 1777 /tmp/.X11-unix /tmp/.X11-pipe

没有报错了

最后再执行

vncserver :1

终于没有报错信息了

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

iteapoy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值