TigerVNC
TigerVNC to oprogramowanie klient/serwer pozwalające na zdalny dostęp po sieci do pulpitu graficznego.
Instalacja
Flagi USE
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.
Konfiguracja Pojedynczego Serwera
Ta konfiguracja pozwala na zdalny dostęp do całego serwera Xorg X11
Stwórz plik konfiguracyjny TigerVNC dla Xorg X11:
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
Stwórz /etc/X11/vncpasswd
root #
vncpasswd /etc/X11/vncpasswd
Wiele konfiguracji serwera
Od wersji 1.12, tigetvnc nie wspiera uruchamiania serwera jako "zwykły" użytkownik. Wymagana jest globalna konfiguracja z sesjami. Ten akapit nadal może być używany do przetestowania konfiguracji.
Zaloguj się jako "zwykły" użytkownik. Następujące kroki są przeznaczone dla każdego użytkownika, który chce skonfigurować serwer VNC dla zdalnego dostępu.
Ustaw hasło:
user $
vncpasswd
Uruchom serwer podając nieużywany numer wyświetlacza (na przykład :1 lub :2):
user $
vncserver :N
Jeśli chcesz, użyj klienta VNC na innej lokalnej lub zdalnej maszynie by przetestować połączenie.
Kiedy skończysz, zabij uruchomiony vncserver używając skrótu C-c.
Wyświetlacze
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.
Ustaw wyświetlacze w pliku konfiguracyjnym TigerVNC:
/etc/tigervnc/vncserver.users
:1=user
:2=user2
Zazwyczaj wartość :0
będzie użyty przez serwer wyświetlania X. Dlatego przykład poniżej zaczyna się od użycia wyświetlacza :1
.
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.
Ustaw wyświetlacze dla OpenRC. Zastąp wszystkie wartości 'user
' poniżej nazwą użytkownika, który będzie uruchamiał serwer VNC na maszynie:
/etc/conf.d/tigervnc
DISPLAYS="user:1 user2:2"
Środowiska pulpitu
By ustawić domyślny pulpit, dodaj session=
do (lub usuń komentarz z poniższego):
/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
Każdy użytkownik, który chce uruchomić serwer VNC może nadpisać tę konfigurację dodając wymagane opcje do ~/.vnc/config
. Istnieje plik /etc/tigervnc/vncserver-config-mandatory
gdzie administrator systemu może nadpisać konfigurację użytkownika. Plik ~/.vnc/xstartup
nie jest już wspierany i serwer go ignoruje.
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
Serwisy
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
Uruchom serwer:
root #
systemctl enable vncserver@:<display>.service
dla każdego :display
w /etc/tigervnc/vncserver.users
Użycie
Łączenie
user $
vncviewer server:1
Połączenie poprzez ssh z wysoką rozdzielczością
user $
vncviewer -Fullcolor -QualityLevel 9 -via user@remotehost localhost:1
Zobacz również
- SSH — the ubiquitous tool for logging into and working on remote machines securely.