Fedora Documentation - TigerVNC - Fedora24
2016-07-29 12:19
357 查看
https://docs.fedoraproject.org/en-US/Fedora/24/html/System_Administrators_Guide/ch-TigerVNC.html#s3-configuring-vnc-server
server shares its output (
client (
Xvnc with appropriate options and starts a window manager on the VNC desktop.
A configuration file named
[/code]
There is no need to include the display number in the file name because
name in some way. See
Section 9.1.2.1, “Configuring VNC Server for Two Users” for details.
Edit
PIDFile=/home/
[/code]
Save the changes.
To make the changes take effect immediately, issue the following command:
Set the password for the user or users defined in the configuration file. Note that you need to switch from
Password:
Verify:
[/code]
Proceed to
Section 9.1.3, “Starting VNC Server”.
Create two service files, for example
Set passwords for both users:
Password:
Verify:
Password:
Verify:
[/code]
Procedure 9.1, “Configuring the first VNC connection” works as a template, in which
You can also enable the service to start automatically at system start. Then, when you log in,
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.
server for USER_2 to start on display 5:
Or, when your system is running, you can stop the service by issuing the following command as
TigerVNC(Tiger Virtual Network Computing) is a system for graphical desktop sharing which allows you to remotely control other computers.
TigerVNCworks 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,TigerVNCin Fedora uses the
systemdsystem management daemon for its configuration. The
/etc/sysconfig/vncserverconfiguration file has been replaced by
/etc/systemd/system/vncserver@.service.
9.1. VNC Server
vncserveris 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.
vncserverallows 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 asroot:
~]#
dnf install tigervnc-server[/code]
9.1.2. Configuring VNC Server
Procedure 9.1. Configuring the first VNC connectionA configuration file named
/etc/systemd/system/vncserver@.serviceis required. To create this file, copy the
/lib/systemd/system/vncserver@.servicefile as
root:
~]#
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
[/code]
There is no need to include the display number in the file name because
systemdautomatically 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, replacing
USERwith the actual user name. Leave the remaining lines of the file unmodified. The
-geometryargument specifies the size of the VNC desktop to be created; by default, it is set to
1024x768.
ExecStart=/sbin/runuser -l [code]USER-c "/usr/bin/vncserver %i -geometry 1280x1024"
PIDFile=/home/
USER/.vnc/%H%i.pid
[/code]
Save the changes.
To make the changes take effect immediately, issue the following command:
~]#
systemctl daemon-reload[/code]
Set the password for the user or users defined in the configuration file. Note that you need to switch from
rootto
USERfirst.
~]#su -
USER
~]$
vncpasswd
Password:
Verify:
[/code]
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@.service
vncserver-. In both these files substituteUSER_2@.service
USERwith the correct user name.
Set passwords for both users:
~]$
su -[/code]USER_1
~]$
vncpasswd
Password:
Verify:
~]$
su -[/code]USER_2
~]$
vncpasswd
Password:
Verify:
[/code]
9.1.3. Starting VNC Server
To start or enable the service, specify the display number directly in the command. The file configured above inProcedure 9.1, “Configuring the first VNC connection” works as a template, in which
%iis substituted with the display number by
systemd. With a valid display number, execute the following command:
~]#systemctl start vncserver@:
display_number.service[/code]
You can also enable the service to start automatically at system start. Then, when you log in,
vncserveris automatically started. As
root, issue a command as follows:
~]#systemctl enable vncserver@:
display_number.service[/code]
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 VNCserver for USER_2 to start on display 5:
~]#systemctl start vncserver-USER_1@:3.service[/code]
~]#systemctl start vncserver-USER_2@:5.service[/code]
9.1.4. Terminating a VNC Session
Similarly to enabling thevncserverservice, you can disable the automatic start of the service at system start:
~]#
systemctl disable vncserver@:[/code]display_number.service
Or, when your system is running, you can stop the service by issuing the following command as
root:
~]#
systemctl stop vncserver@:[/code]display_number.service
相关文章推荐
- css 导航栏
- angular 跳转页面时传参
- 前端学习Html篇(一)
- 理解Node模块(module)
- 一个简单的JS日期挂历脚本
- django遇到css加载不成功的问题
- jquery判断页面滚动条(scroll)是上滚还是下滚,且是否滚动到头部或者底部
- js入门简单代码
- CSS-- 实用CSS样式
- js怎么判断浏览器类型
- JQuery中的轮播图demo
- js中如何输出空格
- javascript将table的td变为可编辑的input,实现表格动态编辑
- 超高速前端开发工具——Emmet
- js基础
- 安卓Jsoup解析的一个小Demo
- 打造简单实用的Thinkphp分页样式(Bootstrap版本)
- alibaba fastjson List<Map<String, String>>2Str
- jquery、js 金额小写转成大写
- ServletJsp之自定义标签