fedora 34 开启 vncserver 服务

最近重新用回了fedora, 现在已经是34版本了。启用vncserver 时,提示已经变成了一个服务;之前一直使用 vncserver :1 的形式启动;

现在直接使用 systemctl 进行管理,我想这样可能更具兼容性吧。肯定开发人员,对这种原生支持的方式进行进一步优化的。

所以我建议使用systemd的形式进行启动vncserver。

使用方式:

# Quick HowTo:
# 1. Add a user mapping to /etc/tigervnc/vncserver.users.
# 2. Adjust the global or user configuration. See the
#    vncsession(8) manpage for details. (OPTIONAL)
# 3. Run `systemctl enable vncserver@:<display>.service`
# 4. Run `systemctl start vncserver@:<display>.service`
#  ~ cat /etc/tigervnc/vncserver.users 
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:1=root
vncpasswd # 设置用户密码

开启服务:

systemctl start vncserver@:1.service
#  ~ systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/[email protected]; disabled; vendor preset: disabled)
     Active: active (running) since Mon 2021-10-11 00:07:40 CST; 8min ago
    Process: 1288147 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
   Main PID: 1288154 (vncsession)
      Tasks: 0 (limit: 19017)
     Memory: 1.0M
        CPU: 7ms
     CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
             ‣ 1288154 /usr/sbin/vncsession root :1

Oct 11 00:07:40 zetong403 systemd[1]: Starting Remote desktop service (VNC)...
Oct 11 00:07:40 zetong403 systemd[1]: Started Remote desktop service (VNC).

之后使用客户端进行连接就好;

参考链接:

How to configure VNC server in Red Hat Enterprise Linux 8

保持更新;

相关文章

LinuxSystemd服务(2021.07.09)目录LinuxSystemd服务(2021.07...
opidrvabortingprocessM002ospid(3561)asaresultofORA-600OR...
安装好haproxy后,配置正确无法启动,看日志:Feb1309:32:50clu...
Linux 系统与服务管理工具Systemd被曝存在3大漏洞,影响几乎...
一、systemd查看日志文件有隐藏 systemctlstatusSERVICE-l-...
不要在mp目录下保存文件,该目录会定期清理文件mp默认保存10...