刚刚在这里安装了 Ubuntu 22.04,当我尝试为不是登录 X 的用户运行 Firefox 实例时出现此错误。以下是在会话中输入的重现错误的完整命令跟踪gnome-terminal
:
me@mypc:~$ sudo adduser www
[sudo] password for me:
Adding user `www' ...
Adding new group `www' (1002) ...
Adding new user `www' (1002) with group `www' ...
Creating home directory `/home/www' ...
Copying files from `/etc/skel' ...
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: password updated successfully
Changing the user information for www
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
me@mypc:~$ xhost +
access control disabled, clients can connect from any host
me@mypc su - www
Password:
www@mypc:~$ export DISPLAY=:1
www@mypc:~$ firefox
/user.slice/user-1000.slice/[email protected]/app.slice/app-org.gnome.Terminal.slice/vte-spawn-00e5cd03-e354-4ba8-aca7-2245c0e8b1cb.scope is not a snap cgroup
www@mypc:~$
注意这1000
是用户的uid me
。
请注意,如果使用 切换到控制台ctrl+f3
,以用户身份登录www
并运行DISPLAY=:1 firefox
,则浏览器将在显示 1 中正确打开。因此一定有一些与终端相关的东西。