====== VNC ======
===== Server (FreeBSD 10) =====
==== net/tightvnc ====
den VNC-Server installieren:
> pkg install net/tightvnc
ohne X kann man den aber nicht benutzen:
> pkg install x11/xterm x11-wm/icewm x11/xorg x11/xorg-apps x11/xorg-cf-files x11-servers/xorg-dmx x11-drivers/xorg-drivers x11-fonts/xorg-fonts x11-fonts/xorg-fonts-100dpi x11-fonts/xorg-fonts-75dpi x11-fonts/xorg-fonts-miscbitmaps x11-fonts/xorg-fonts-truetype x11-fonts/xorg-fonts-type1 x11/xorg-libraries x11/xorg-minimal x11-servers/xorg-nestserver x11-servers/xorg-server
> echo "/usr/local/bin/icewm-session" > .xinitrc
X konfigurieren:
> Xorg -configure
die X-CFG nach den eigenen Vorstellungen bearbeiten:
> vi xorg.conf.new
X testweise starten:
> X -config xorg.conf.new
wenn es geht, dann ordentlich ablegen:
> cp xorg.conf.new /usr/local/etc/X11/xorg.conf
Das Passwort für den VNC-Server setzen, das Passwort darf nicht länger als 8 Zeichen sein:
> vncpasswd
Password:
Verify:
==== net/vnc ====
=== Installation ===
erstmal installieren:
# portupgrade -NROD x11-servers/xorg-server x11/xterm net/vnc
=== Vorbereitung ===
auf dem Rechner einloggen:
# ssh -X fritz@rechner
vorbereiten:
# echo "/usr/bin/icewm-session" > .xinitrc
Das Passwort für den VNC-Server setzen, das Passwort darf nicht länger als 8 Zeichen sein:
# vncpasswd
Password:
Verify:
VNC-Start-Script konfigurieren:
# vi .vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
icewm &
Hier kann man einen WindowManager seiner Wahl eintragen.
Ich bin minimalistisch eingestellt und habe den WindowManager "twm" einfach deaktiviert, so startet dann nur der "xterm" mit dem bereits lokal laufenden WindowManager übers Netz. (Ausserdem haben wir den "twm" ja noch garnicht installiert, ich würde dann sowieso den ICEwm vorziehen.)
== Start ==
VNC-Server starten:
> vncserver -geometry 1024x768 -depth 16 -nolisten tcp :1
== Stop ==
VNC-Server stoppen:
# vncserver -kill :1
Killing Xvnc process ID 55429
===== Server (Ubuntu-Linux) =====
In diesem Beispiel wird das OS //Linux Ubuntu 10.04// verwendet.
Der Rechner und der Beispielbenutzer heißen beide //fritz//.
==== vino (Gnome2) ====
Installation (als //root//):
# aptitude install vino
Der //VINO// wird zusammen mit GNOME gestartet.
Passwort setzen:
# vino-passwd
Einstellungen vornehmen:
# vino-preferences
==== Kommandozeile ====
=== Server (Ubuntu 16.04) ===
Installation
> apt install tightvncserver icewm menu xterm firefox mc emelfm2 nemo
mögliche Dateimanager
libc : mc
GTK : emelfm2
GNOME : nautilus
MATE : caja
Cinnamon: nemo
KDE : dolphin
Plasma : dolphin4
Das Passwort für den VNC-Server setzen, das Passwort darf nicht länger als 8 Zeichen sein:
> vncpasswd
Password:
Verify:
#!/bin/bash
ps lx | fgrep -v grep | fgrep -i vnc | fgrep -v ${0}
#!/bin/bash
BILDFORMAT="1280x1024"
vncserver -geometry ${BILDFORMAT} -depth 24 2>&1 | fgrep "New 'X' desktop is" | awk '{print "vncviewer -AutoSelect=0 -FullColour",$NF}'
#!/bin/bash
kill $(ps lx | fgrep -v grep | fgrep vnc | awk '{print $3}')
> mkdir -p .vnc
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+650+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
#/etc/X11/Xsession
xterm -geometry 80x24+650+10 -ls -title "$VNCDESKTOP Desktop" &
icewm-session &
emelfm2 &
nemo --no-desktop &
> mkdir -p .icewm
prog XTerm xterm xterm
prog emelfm2 /usr/share/pixmaps/emelfm2/emelfm2.xpm emelfm2
prog nemo folder nemo
prog Firefox firefox firefox
prog Firefox firefox firefox
prog nemo folder nemo
prog emelfm2 /usr/share/pixmaps/emelfm2/emelfm2.xpm emelfm2
prog xterm xterm xterm -ls
separator
menu "Dateiverwaltung" folder {
prog "Baobab" "/usr/share/pixmaps/baobab.xpm" /bin/sh -c "/usr/bin/baobab"
prog "Brasero" - /bin/sh -c "/usr/bin/brasero"
prog "File-Roller" "/usr/share/pixmaps/file-roller.xpm" /bin/sh -c "/usr/bin/file-roller"
prog "mc" "/usr/share/pixmaps/mc.xpm" /bin/sh -c "xterm -T \"mc\" -e sh -c \"/usr/bin/mc\" ~/ ~/"
prog "Nautilus" "/usr/share/pixmaps/nautilus.xpm" /bin/sh -c "/usr/bin/nautilus --no-desktop"
prog "Nemo" "/usr/share/pixmaps/nemo.xpm" /bin/sh -c "/usr/bin/nemo --no-desktop"
}
=== Server (Ubuntu "alt") ===
Installation (als //root//):
# aptitude install vnc4server icewm nemo menu
**Die folgenden Schritte werden als User //fritz// ausgeführt!**
VNC-Konfiguration anpassen:
# mkdir -p .vnc
# vi .vnc/xstartup
#!/bin/sh
#
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
#
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
icewm-session &
nemo --no-desktop &
icewm konfigurieren:
# mkdir -p .icewm
# cp /etc/X11/icewm/* .icewm/
Standardmenü erstellen:
# update-menus
Menüleiste konfigurieren:
# vi .icewm/toolbar
prog XTerm xterm xterm
prog Firefox firefox firefox
Menü konfigurieren:
# vi .icewm/menu
prog xterm xterm xterm -ls
prog Firefox firefox firefox
separator
menu "Büro" folder {
prog "LibreOffice Calc" "/usr/share/icons/hicolor/32x32/apps/libreoffice-calc.xpm" /bin/sh -c "/usr/bin/libreoffice --calc"
prog "LibreOffice Writer" "/usr/share/icons/hicolor/32x32/apps/libreoffice-writer.xpm" /bin/sh -c "/usr/bin/libreoffice --writer"
}
menu "Dateiverwaltung" folder {
prog "Baobab" "/usr/share/pixmaps/baobab.xpm" /bin/sh -c "/usr/bin/baobab"
prog "Brasero" - /bin/sh -c "/usr/bin/brasero"
prog "File-Roller" "/usr/share/pixmaps/file-roller.xpm" /bin/sh -c "/usr/bin/file-roller"
prog "mc" "/usr/share/pixmaps/mc.xpm" /bin/sh -c "xterm -T \"mc\" -e sh -c \"/usr/bin/mc\" ~/ ~/"
prog "Nautilus" "/usr/share/pixmaps/nautilus.xpm" /bin/sh -c "/usr/bin/nautilus --no-desktop"
prog "Nemo" "/usr/share/pixmaps/nemo.xpm" /bin/sh -c "/usr/bin/nemo --no-desktop"
}
menu "Betrachter" folder {
prog "Evince" "/usr/share/pixmaps/evince.xpm" /bin/sh -c "/usr/bin/evince"
prog "Eye of GNOME" "/usr/share/pixmaps/gnome-eog.xpm" /bin/sh -c "/usr/bin/eog"
}
Das Passwort für den VNC-Server setzen, das Passwort darf nicht länger als 8 Zeichen sein:
# vncpasswd
Password:
Verify:
einmal zum testen starten, dabei wird auch gleich die Konfigurationsdatei angelegt:
# vncserver -geometry 1280x1024 -depth 24
New 'fritz:1 (fritz)' desktop is fritz:1
Starting applications specified in /home/fritz/.vnc/xstartup
Log file is /home/fritz/.vnc/fritz:1.log
wieder beenden:
# vncserver -kill :1
oder
# killall Xvnc4 &>/dev/null
=== Start ===
Jetzt starten:
# vncserver -geometry 1280x1024 -depth 24
New 'fritz:1 (fritz)' desktop is fritz:1
Starting applications specified in /home/fritz/.vnc/xstartup
Log file is /home/fritz/.vnc/fritz:1.log
===== Client (Ubuntu-Linux) =====
=== Installation ===
Der //xvnc4viewer// wird hier nur Beispielhaft verwendet, es funktioniert aber auch jeder andere VNC-Client.
Installation (als //root//):
# aptitude install xvnc4viewer
=== Start ===
== vnc4server ==
# vncviewer fritz:1
VNC Viewer Free Edition 4.1.1 for X - built Apr 9 2010 15:52:37
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Sat May 22 13:26:16 2010
CConn: connected to host fritz port 5901
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
Password:
Sat May 22 13:26:19 2010
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 6 (8bpp) rgb222
CConn: Using ZRLE encoding
== vino (GNOME2) ==
# vncviewer fritz:0
VNC Viewer Free Edition 4.1.1 for X - built Apr 9 2010 15:52:37
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Sat May 22 15:51:02 2010
CConn: connected to host fritz port 5900
CConnection: Server supports RFB protocol version 3.7
CConnection: Using RFB protocol version 3.7
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 6 (8bpp) rgb222
CConn: Using ZRLE encoding
Sat May 22 15:51:05 2010
CConn: Throughput 20000 kbit/s - changing to hextile encoding
CConn: Throughput 20000 kbit/s - changing to full colour
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using hextile encoding
An Stelle des Rechnernamens (fritz) kann natürlich auch die entsprechende IP (z.B.: 192.168.1.10) verwendet werden.
volle Farbpalette auch bei zu geringer Bandbreite erzwingen:
# vncviewer -AutoSelect=0 -FullColour fritz:0
===== mit Skripten ein- und ausschalten =====
==== Ubuntu 18.04 LTS ====
> apt install vnc4server xvnc4viewer gvncviewer
> ~/bin/vncserver_start.sh
> ~/bin/vncserver_show.sh
> ~/bin/vncserver_stop.sh
BILDFORMAT="1280x1024"
VNC_OPTIONEN="-geometry ${BILDFORMAT} -depth 24"
#!/bin/bash
#
# startet meinen VNC-Server
#
. $(dirname ${0})/vncserver.cfg
vncserver ${VNC_OPTIONEN} 2>&1
# Xvnc4 :2 -desktop mtiq853:2 (fritz) -auth /home/fritz/.Xauthority -geometry 1280x1024 -depth 24
VNC_PORT="$(ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc | awk '{print $6}')"
VNC_IP="$(ip a | fgrep -v 127.0.0.1 | fgrep 'inet ' | awk '{print $2}' | awk -F'/' '{print $1}')"
echo "#
# Start mit:
# vncviewer -AutoSelect=0 -FullColour ${VNC_IP}${VNC_PORT}
# oder
# gvncviewer ${VNC_IP}${VNC_PORT}
#"
#!/bin/bash
#
# zeigt meinen VNC-Server
#
. $(dirname ${0})/vncserver.cfg
# Xvnc4 :2 -desktop mtiq853:2 (fritz) -auth /home/fritz/.Xauthority -geometry 1280x1024 -depth 24
# ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc
VNC_PID="$(ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc | awk '{print $1}')"
VNC_PORT="$(ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc | awk '{print $6}')"
VNC_IP="$(ip a | fgrep -v 127.0.0.1 | fgrep 'inet ' | awk '{print $2}' | awk -F'/' '{print $1}')"
if [ "x${VNC_PID}" != x ] ; then
echo "#
# ${VNC_PID} - ${VNC_IP}${VNC_PORT}
#"
fi
#!/bin/bash
#
# beendet meinen VNC-Server
#
. $(dirname ${0})/vncserver.cfg
# Xvnc4 :2 -desktop mtiq853:2 (fritz) -auth /home/fritz/.Xauthority -geometry 1280x1024 -depth 24
# ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc
VNC_PID="$(ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc | awk '{print $1}')"
VNC_PORT="$(ps x | fgrep -v grep | fgrep " ${VNC_OPTIONEN} " | fgrep -i vnc | awk '{print $6}')"
VNC_IP="$(ip a | fgrep -v 127.0.0.1 | fgrep 'inet ' | awk '{print $2}' | awk -F'/' '{print $1}')"
if [ "x${VNC_PID}" != x ] ; then
echo "#
# ${VNC_PID} - ${VNC_IP}${VNC_PORT}
#"
vncserver -kill ${VNC_PORT}
fi