使用图形化界面时startxfce4,出现的cannot open /dev/tty0: Permission denied问题,解决方法

startxfce4
在使用xserver时往往会报:
cannot open /dev/tty0 (permission denied)

添加所在用户到tty组中

gpasswd -a 用户名 tty

还不行的话试一下下面的方法:

vim /etc/X11/Xwrapper.config

里面原来内容如下:

allowed_users=anybody
needs_root_rights=yes

改为(在=前后加上空格):

allowed_users = anybody
needs_root_rights = yes

关于出现:
xf86OpenConsole: Cannot open virtual console 2 (Permission denied)

尝试:

sudo chown 用户名 /dev/tty2

xf86OpenConsole: Cannot open virtual console 2 (Permission denied)

关于出现:
xf86EnableIOPorts: failed to set IOPL for I/O (Function not implemented)
Fatal server error:
no screens found

提示找不到显示器,可能是~/.bashrc(如果安装了zsh则为~/.zshrc)下的DISPLAY参数配置错了,
wsl1应该为:

export DISPLAY=localhost:自定义端口

wsl2应该为:

export DISPLAY=`cat /etc/resolv.conf | grep nameserver | awk '{print $2}'`:自定义端口
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值