Documentation for a newer release is available. View Latest


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.

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.

VNC 서버

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.

VNC 서버 설치

TigerVNC 서버를 설치 할 때에, `root`로 다음 명령을 실행합니다 :

# dnf install tigervnc-server

VNC 서버 구성

처음 VNC 연결 구성하기
  1. A configuration file named /etc/systemd/system/vncserver@.service is required. To create this file, copy the /lib/systemd/system/vncserver@.service file as root:

    # cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service

    There is no need to include the display number in the file name because systemd 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 Configuring VNC Server for Two Users for details.

  2. Edit /etc/systemd/system/vncserver@.service, replacing USER 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 to 1024x768.

    ExecStart=/sbin/runuser -l USER -c "/usr/bin/vncserver %i -geometry 1280x1024"
  3. 변경을 저장합니다.

  4. 변경 사항을 즉시 적용하려면, 다음 명령을 실행하세요:

    # systemctl daemon-reload
  5. Set the password for the user or users defined in the configuration file. Note that you need to switch from root to USER first.

    # su - USER
    $ vncpasswd

    The stored password is not encrypted; anyone who has access to the password file can find the plain-text password.

두 명의 사용자를 위한 VNC 서버 구성하기

If you want to configure more than one user on the same machine, create different template-type service files, one for each user.

  1. Create two service files, for example vncserver-USER_1@.service and vncserver-USER_2@.service. In both these files substitute USER with the correct user name.

  2. 사용자를 위한 비밀번호 설정:

    $ su - USER_1
    $ vncpasswd
    $ su - USER_2
    $ vncpasswd

VNC 서버 시작

To start or enable the service, specify the display number directly in the command. The file configured above in 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

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

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.

두 명의 사용자와 두 명의 다른 표시를 위한 VNC 서버 구성하기

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

VNC 세션 종료

Similarly to enabling the vncserver service, you can disable the automatic start of the service at system start:

# systemctl disable vncserver@:display_number.service

Or, when your system is running, you can stop the service by issuing the following command as root:

# systemctl stop vncserver@:display_number.service

VNC 표시기

vncviewer is the program which shows the shared graphical user interfaces and controls the server.

For operating the vncviewer, there is a pop-up menu containing entries which perform various actions such as switching in and out of full-screen mode or quitting the viewer. Alternatively, you can operate vncviewer through the terminal. Enter vncviewer -h on the command line to list vncviewer's parameters.

VNC 표시기 설치하기

To install the TigerVNC client, vncviewer>, issue the following command as root:

# dnf install tigervnc

VNC 서버로 연결 중

Once the VNC server is configured, you can connect to it from any VNC viewer. In order to do so, issue the vncviewer command in the following format:

vncviewer address:port_number

Where address is an IP or host name.

Example 1. VNC 서버에 하나의 클라이언트 연결하기

With the IP address and display number 3 the command looks as follows:

$ vncviewer

VNC를 위한 방화벽 구성하기

When using a non-encrypted connection, firewalld might block the connection. To allow firewalld to pass the VNC packets, you can open specific ports to TCP traffic. When using the -via option, traffic is redirected over SSH which is enabled by default in firewalld.

The default port of VNC server is 5900. To reach the port through which a remote desktop will be accessible, sum the default port and the user’s assigned display number. For example, for the second port: 2 + 5900 = 5902.

For displays 0 to 3, make use of firewalld's support for the VNC service by means of the service option as described below. Note that for display numbers greater than 3, the corresponding ports will have to be opened specifically as explained in Opening Ports in firewalld.

방화벽에서 VNC 서비스 활성화하기
  1. 방화벽 설정과 관련한 정보를 보려면 다음 명령을 실행하세요:

    $ firewall-cmd --list-all
  2. To allow all VNC connections from a specific address, use a command as follows:

    # firewall-cmd --add-rich-rule='rule family="ipv4" source address="" service name=vnc-server accept'

    See the Red Hat Enterprise Linux 7 Security Guide for more information on the use of firewall rich language commands.

  3. 위의 설정을 확인하려면, 다음과 같은 명령을 사용하세요:

    # firewall-cmd --list-all
    public (default, active)
     interfaces: bond0 bond0.192
     services: dhcpv6-client ssh
     masquerade: no
     rich rules:
    	rule family="ipv4" source address="" service name="vnc-server" accept

To open a specific port or range of ports make use of the --add-port option to the firewall-cmd command Line tool. For example, VNC display 4 requires port 5904 to be opened for TCP traffic.

방화벽에서 포트 열기
  1. To open a port for TCP traffic in the public zone, issue a command as root as follows:

    # firewall-cmd --zone=public --add-port=5904/tcp
  2. To view the ports that are currently open for the public zone, issue a command as follows:

    # firewall-cmd --zone=public --list-ports

A port can be removed using the firewall-cmd --zone=zone --remove-port=number/protocol command.

For more information on opening and closing ports in firewalld, see the Red Hat Enterprise Linux 7 Security Guide.

SSH를 사용하여 VNC 서버로 연결하기

VNC is a clear text network protocol with no security against possible attacks on the communication. To make the communication secure, you can encrypt your server-client connection by using the -via option. This will create an SSH tunnel between the VNC server and the client.

The format of the command to encrypt a VNC server-client connection is as follows:

$ vncviewer -via user@host:display_number
Example 2. -via 선택 사용
  1. `SSH`를 사용하여 VNC 서버에 연결하려면, 다음과 같은 명령을 입력하세요:

    $ vncviewer -via USER_2@
  2. When you are prompted to, type the password, and confirm by pressing Enter.

  3. A window with a remote desktop appears on your screen.

VNC 접근 제한하기

If you prefer only encrypted connections, you can prevent unencrypted connections altogether by using the -localhost option in the systemd.service file, the ExecStart line:

ExecStart=/sbin/runuser -l user -c "/usr/bin/vncserver -localhost %i"

This will stop vncserver from accepting connections from anything but the local host and port-forwarded connections sent using SSH as a result of the -via option.

`SSH`를 사용하는데 더 자세한 정보를 위해 OpenSSH를 참고하세요.

추가 자원

TigerVNC에 대하여 더 자세한 정보를 위하여, 아래 나열된 자원을 참조하세요.

설치된 문서
  • vncserver(1) — The VNC server manual pages.

  • vncviewer(1) — The VNC viewer manual pages.

  • vncpasswd(1) — The VNC password manual pages.