TigerVNC/ja

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page TigerVNC and the translation is 4% complete.
Outdated translations are marked like this.
Other languages:
Resources

TigerVNCは、グラフィカル デスクトップへのリモート ネットワーク アクセスを可能にするクライアント/サーバー ソフトウェア パッケージです。

USE flags

USE flags for net-misc/tigervnc Remote desktop viewer display system

+drm Build with DRM support
+opengl Add support for OpenGL (3D graphics)
+server Build TigerVNC server
+viewer Build TigerVNC viewer
dri3 Build with DRI3 support
gnutls Prefer net-libs/gnutls as SSL/TLS provider (ineffective with USE=-ssl)
java Build TigerVNC Java viewer
nls Add Native Language Support (using gettext - GNU locale utilities)
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API

Emerge

root #emerge --ask net-misc/tigervnc

Additional Software

The following package can be installed to integrate the VNC server into Xorg:

root #emerge --ask net-misc/tigervnc-xorg-module

User Session Configuration

The easiest way to use TigerVNC as a server is to run the x0vncserver component with the user's X session:

ファイル ~/.xinitrc
...
x0vncserver -PasswordFile ~/.vnc/passwd
...

The password file can be defined with:

user $mkdir .vnc
user $vncpasswd .vnc/passwd
user $chmod 600 .vnc/passwd

Localhost Session

A VNC server can be started on localhost instead of on the network, allowing it to be forwarded over SSH, this can be accomplished with:

ファイル ~/.xinitrc
...
x0vncserver -PasswordFile ~/.vnc/passwd -localhost
...

A SSH connection can be made, forwarding 127.0.0.1:5900 on the destination machine to port 5900 on the client:

user $ssh -L 5900:127.0.0.1:5900 larry@remoteMachine
重要
This ssh session must remain open for the VNC session to function.

Single Server Configuration

この構成により、 全体 Xorg X11 サーバー のリモート制御が可能になります。

Xorg X11 の TigerVNC 構成ファイルを作成します。:

root #mkdir -p /etc/X11/xorg.conf.d
ファイル /etc/X11/xorg.conf.d/40-vnc.conf
Section "Module"
	Load "vnc"
EndSection
Section "Screen"
	Identifier "Default Screen"
	Option "PasswordFile" "/etc/X11/vncpasswd"
EndSection

/etc/X11/vncpasswd を作成します

root #vncpasswd /etc/X11/vncpasswd

Multiple Server Configuration

重要
Starting with version 1.12, tigervnc no longer supports starting servers as 'normal' user. A global configuration with sessions is now required. The following can still be used to test configuration.

Login as 'normal' user. The following steps can be taken for any user who wishes to configure the VNC server for remote connection.

Set a password:

user $vncpasswd

Start the server giving it an unused display number (for example :1 or :2):

user $vncserver :N

If desired, use a VNC client on either a local or remote machine to test the connection.

Once finished, kill the running vncserver by pressing C-c.

Displays

メモ
Starting with 1.13.1-r3, the TigerVNC service for OpenRC got migrated to a one session per service model, similar to what systemd does. Otherwise, starting all TigerVNC sessions in the same OpenRC service had a major drawback: if one session crashed, it could not be restarted without killing all the others.

Setup the displays in the TigerVNC configuration file:

ファイル /etc/tigervnc/vncserver.users
:1=user
:2=user2

Typically the value of :0 will be used for the server's own X display. This is why the example above starts by using the :1 display handle.

重要
The conf.d steps below were only needed for OpenRC with <net-misc/tigervnc-1.13.1-r3. The DISPLAYS variable is no longer used in newer versions.

Setup the displays for OpenRC. This step is not required for systemd. Substitute each 'user' value below with the name of a user who will be running the VNC server on the machine:

ファイル /etc/conf.d/tigervnc
DISPLAYS="user:1 user2:2"

Desktop environments

To setup the default desktop environment, add it to session= (or uncomment one from below):

ファイル /etc/tigervnc/vncserver-config-defaults
# session=gnome
# securitytypes=vncauth,tlsvnc
# geometry=2000x1200
# localhost
# alwaysshared
 
# Other possible working sessions:
#session=e16-session
#session=enlightenment
#session=fvwm
#session=gnome-classic
#session=gnome-custom-session
#session=gnome
#session=gnome-xorg
#session=LXDE
#session=lxqt
#session=openbox
#session=plasma
#session=xfce
#session=Xsession

Each user who will be running a VNC server can override this configuration by adding it to ~/.vnc/config. There is a file /etc/tigervnc/vncserver-config-mandatory where the system administrator can override user's config. ~/.vnc/xstartup is no longer supported and the current server ignores it.

重要
If the session configuration doesn't get applied or the VNC server simply exits right away, see Gentoo bug #936475 -- you may need to install a Display manager, set TIGERVNC_XSESSION_FILE, or hack /etc/X11/Sessions/Xsession

Configuration

Service

OpenRC

This example assumes 2 displays, :1 and :2

Create one link for every display:

root #ln -s tigervnc /etc/init.d/tigervnc.1
root #ln -s tigervnc /etc/init.d/tigervnc.2

Start the server(s):

root #rc-service tigervnc.1 start
root #rc-service tigervnc.2 start

Start the server(s) at startup:

root #rc-update add tigervnc.1 default
root #rc-update add tigervnc.2 default

Even having only one display requires creating a symlink.

systemd

Start the server:

root #systemctl enable vncserver@:<display>.service

for each :display in /etc/tigervnc/vncserver.users

Usage

Connecting

user $vncviewer server:1

Connect over ssh with high resolution

user $vncviewer -Fullcolor -QualityLevel 9 -via user@remotehost localhost:1
user $vncviewer -Fullcolor -QualityLevel 9 -via user2@remotehost localhost:2

See also

  • SSH — リモートマシンに安全にログインし、作業を行うためのユビキタスなツールです。