Fedora Documentation - TigerVNC - Fedora24
TigerVNC
(Tiger Virtual Network Computing) is a system for graphical desktop sharing which allows you to remotely control other computers.TigerVNC
works on the client-server network: a
server shares its output (vncserver
) and a
client (vncviewer
) connects to the server.Note
Unlike in Fedora 15 and Red Hat Enterprise Linux 6,
TigerVNC
in Fedora uses the systemd
system management daemon for its configuration. The
/etc/sysconfig/vncserver
configuration file has been replaced by
/etc/systemd/system/vncserver@.service
.9.1. VNC Server
vncserver
is a utility which starts a VNC (Virtual Network Computing) desktop. It runs
Xvnc with appropriate options and starts a window manager on the VNC desktop.
vncserver
allows users to run separate sessions in parallel on a machine which can then be accessed by any number of clients from anywhere.9.1.1. Installing VNC Server
To install the TigerVNC server, issue the following command as
root
:
~]# dnf install tigervnc-server
~]#
dnf install tigervnc-server
9.1.2. Configuring VNC Server
Procedure 9.1. Configuring the first VNC connection
-
A configuration file named
/etc/systemd/system/vncserver@.service
is required. To create this file, copy the/lib/systemd/system/vncserver@.service
file asroot
:~]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
There is no need to include the display number in the file name becausesystemd
automatically creates the appropriately named instance in memory on demand, replacing'%i'
in the service file by the display number. For a single user it is not necessary to rename the file. For multiple users, a uniquely named service file for each user is required, for example, by adding the user name to the file name in some way. See Section 9.1.2.1, “Configuring VNC Server for Two Users” for details. -
Edit
/etc/systemd/system/vncserver@.service
, replacingUSER
with the actual user name. Leave the remaining lines of the file unmodified. The-geometry
argument specifies the size of the VNC desktop to be created; by default, it is set to1024x768
.USER USER
-
Save the changes.
-
To make the changes take effect immediately, issue the following command:
~]# systemctl daemon-reload
-
Set the password for the user or users defined in the configuration file. Note that you need to switch from
root
toUSER
first.~]# USER ~]$ vncpasswd
Important
The stored password is not encrypted; anyone who has access to the password file can find the plain-text password.
Proceed to
Section 9.1.3, “Starting VNC Server”.
9.1.2.1. Configuring VNC Server for Two Users
If you want to configure more than one user on the same machine, create different template-type service files, one for each user.
-
Create two service files, for example
vncserver-
andUSER_1
@.servicevncserver-
. In both these files substituteUSER_2
@.serviceUSER
with the correct user name. -
Set passwords for both users:
~]$ su - USER_1 ~]$ su - USER_1 USER_1 ~]$ vncpasswd ~]$ su - USER_2 ~]$ su - USER_2 USER_2 ~]$ vncpasswd
9.1.3. Starting VNC Server
To start or enable the service, specify the display number directly in the command. The file configured above in
Procedure 9.1, “Configuring the first VNC connection” works as a template, in which
%i
is substituted with the display number by
systemd
. With a valid display number, execute the following command:~]# systemctl start vncserver@:display_number.service
~]#
display_number
You can also enable the service to start automatically at system start. Then, when you log in,
vncserver
is automatically started. As
root
, issue a command as follows:~]# systemctl enable vncserver@:display_number.service
~]#
display_number
At this point, other users are able to use a VNC viewer program to connect to the VNC server using the display number and password defined. Provided a graphical desktop is installed, an instance of that desktop will be displayed. It will not
be the same instance as that currently displayed on the target machine.
9.1.3.1. Configuring VNC Server for Two Users and Two Different Displays
For the two configured VNC servers, vncserver-USER_1@.service and vncserver-USER_2@.service, you can enable different display numbers. For example, the following commands will cause a VNC server for USER_1 to start on display 3, and a VNC
server for USER_2 to start on display 5:
~]# systemctl start vncserver-USER_1@:3.service
~]#
~]# systemctl start vncserver-USER_2@:5.service
~]#
9.1.4. Terminating a VNC Session
Similarly to enabling the
vncserver
service, you can disable the automatic start of the service at system start:~]# systemctl disable vncserver@:display_number.service
~]#
systemctl disable vncserver@:display_number.service
display_number
Or, when your system is running, you can stop the service by issuing the following command as
root
:~]# systemctl stop vncserver@:display_number.service
~]#
systemctl stop vncserver@:display_number.service
display_number
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通