Visão geral
Meu objetivo é configurar o acesso VNC a um guest Debian 9.5 VM construído com o virt-manager no Ubuntu 16.04 LTS (com ambiente de desktop).
Eu configurei / etc / vnc / xstartup para usar gnome-session (detalhes abaixo), e configurei um serviço systemd definido dentro de /lib/systemd/system/{service-name}.service, onde ele utiliza um script dentro de / usr / local / bin / {service-script} que chama diretamente / usr / bin / vncserver para executar operações de parada e início.
O comportamento atual é que uma tela em branco aparece quando eu faço login na instância do servidor VNC de outro dispositivo na LAN, e gostaria de saber porque essa configuração não funciona e um pouco mais sobre o Ubuntu / Hierarquia do pacote do ambiente de desktop da Debian.
Notas do casal:
- Essa configuração exata funciona usando um host do Windows executando a caixa virtual.
- Tudo configurado aqui é uma mistura de coisas que encontrei on-line (que funcionou) para o meu host do Windows, por isso, aponte para configurações redundantes ou inúteis que talvez não compreendam totalmente
- O {user} em questão NÃO está na lista de sudoers, mas foi o primeiro usuário criado durante a instalação gráfica
- Os erros do gnome-settings na saída do status parecem suspeitos para mim, mas eu não sei o suficiente sobre essas coisas para dar sentido a isso. (talvez outra pessoa possa?)
Lista de arquivos & Depurar
systemd
<user>@VPS:~$ ls -l /lib/systemd/system/<srvc-name>.service
-rw-r--r-- 1 root root 268 Aug 14 08:46 /lib/systemd/system/<srvc-name>.service
[Unit]
Description=Manage VNC Server
[Service]
Type=forking
ExecStart=/usr/local/bin/<srvc-script> start
ExecStop=/usr/local/bin/<srvc-script> stop
ExecReload=/usr/local/bin/<srvc-script> restart
User=<user>
[Install]
WantedBy=multi-user.target
service-script
<user>@VPS:~$ ls -l /usr/local/bin/<srvc-script>
-rwxr-xr-x 1 root staff 297 Aug 14 09:01 /usr/local/bin/<srvc-script>
#!/bin/bash
PATH="$PATH:/usr/bin/"
DISPLAY="2"
DEPTH="24"
GEOMETRY="1280x1024"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost no"
case "$1" in
start)
/usr/bin/vncserver ${OPTIONS}
;;
stop)
/usr/bin/vncserver -kill :${DISPLAY}
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
xstartup
<user>@VPS:~$ ls -l /etc/vnc/xstartup
-rwxr-xr-x 1 root root 155 Aug 14 13:52 /etc/vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xrdb $HOME/.Xresources
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
gnome-session &
serviço sudo {srvc-name} status
● <srvc-name>.service - Manage VNC Server
Loaded: loaded (/lib/systemd/system/<srvc-name>.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-08-14 14:01:22 PDT; 1min 9s ago
Process: 419 ExecStart=/usr/local/bin/<srvc-script> start (code=exited, status=0/SUCCESS)
Tasks: 151 (limit: 4915)
CGroup: /system.slice/<srvc-name>.service
├─487 /usr/bin/Xtigervnc :2 -desktop VPS:2 (<user>) -auth /home/<user>/.Xauthority -geometry 1280x1024 -depth 24 -rfbwait 30000 -rfbauth /home/<user>/.vnc/passwd -rfbport 5902 -pn -SecurityTypes VncAuth,TLSVnc
├─498 /usr/bin/perl /usr/bin/vncserver -depth 24 -geometry 1280x1024 :2 -localhost no
├─499 /bin/sh /etc/X11/Xvnc-session
├─501 vncconfig -iconic
├─502 /usr/lib/gnome-session/gnome-session-binary
├─540 dbus-launch --autolaunch 5e4be6148690420bb12518bb1b2bf070 --binary-syntax --close-stderr
├─554 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
├─612 /usr/bin/dbus-launch --exit-with-session --sh-syntax
├─615 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
├─658 /usr/bin/ssh-agent x-session-manager
├─674 /usr/lib/at-spi2-core/at-spi-bus-launcher
├─679 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
├─681 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
├─689 /usr/lib/gvfs/gvfsd
├─694 /usr/lib/gvfs/gvfsd-fuse /home/<user>/.gvfs -f -o big_writes
├─718 /usr/bin/gnome-keyring-daemon --start --components=secrets
├─736 /usr/lib/gnome-settings-daemon/gnome-settings-daemon
├─757 /usr/bin/pulseaudio --start --log-target=syslog
├─780 /usr/lib/gnome-settings-daemon/gsd-printer
├─793 /usr/lib/evolution/evolution-alarm-notify
├─798 /usr/lib/tracker/tracker-store
├─799 /usr/lib/tracker/tracker-miner-user-guides
├─800 /usr/lib/tracker/tracker-miner-apps
├─802 /usr/lib/tracker/tracker-miner-fs
├─803 /usr/lib/tracker/tracker-extract
├─830 /usr/lib/evolution/evolution-source-registry
├─836 /usr/lib/gnome-online-accounts/goa-daemon
├─845 /usr/lib/telepathy/mission-control-5
├─846 /usr/lib/gnome-online-accounts/goa-identity-service
├─855 /usr/lib/evolution/evolution-calendar-factory
├─867 /usr/lib/evolution/evolution-calendar-factory-subprocess --factory contacts --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.Calendarx855x2 --own-path /org/gnome/evolution/dataserver/Subprocess/Backend/Calendar/855/2
├─869 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
├─886 /usr/lib/dconf/dconf-service
├─891 /usr/lib/evolution/evolution-addressbook-factory
├─892 /usr/lib/evolution/evolution-calendar-factory-subprocess --factory local --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.Calendarx855x3 --own-path /org/gnome/evolution/dataserver/Subprocess/Backend/Calendar/855/3
├─917 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
├─923 /usr/lib/evolution/evolution-addressbook-factory-subprocess --factory local --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.AddressBookx891x2 --own-path /org/gnome/evolution/dataserver/Subprocess/Backend/AddressBook/891/2
├─932 /usr/lib/gvfs/gvfs-afc-volume-monitor
├─944 /usr/lib/gvfs/gvfs-goa-volume-monitor
└─949 /usr/lib/gvfs/gvfs-mtp-volume-monitor
Aug 14 14:01:21 VPS pulseaudio[776]: [pulseaudio] pid.c: Daemon already running.
Aug 14 14:01:21 VPS gnome-settings-[736]: Failed to StopUnit service: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
Aug 14 14:01:21 VPS gnome-settings-[736]: Failed to StopUnit service: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
Aug 14 14:01:21 VPS gnome-settings-[736]: Failed to StopUnit service: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
Aug 14 14:01:21 VPS gnome-settings-[736]: g_task_return_error: assertion 'error != NULL' failed
Aug 14 14:01:21 VPS gnome-session-binary[502]: Entering running state
Aug 14 14:01:21 VPS goa-daemon[836]: goa-daemon version 3.22.5 starting
Aug 14 14:01:22 VPS org.gtk.vfs.AfcVolumeMonitor[615]: Volume monitor alive
Aug 14 14:01:22 VPS systemd[1]: Started Manage VNC Server.
Aug 14 14:01:45 VPS pulseaudio[757]: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.