我想获得对tigervnc 服务器的VNC 访问权限。两台笔记本电脑都运行 ArchLinux sddm KDE xorg(不是 wayland),我花了一天的时间才让服务器运行起来,而且 Dolphin 正在打开——仅此而已。我的 xstartup 文件包含以下内容:
#!/bin/sh
# Run a generic session
if [ -z "$MODE" ]
then
xsetroot -solid grey & #has impact on the background
export XKB_DEFAULT_RULES=base #no impact
export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb #no impact
kstart5 plasmashell & #no impact
konsole & #is opening
firefox & #is opening
xrandr --dpi 144 & #see no difference
dbus-launch startplasma-x11 #this is what moves the needle rn :)
fi
我启动服务器vncserver :1 -depth 24 -geometry 1920x1080
并使用 remmina 客户端、google vnc 查看器和带有 ip:port 的 KRDC 访问服务器,并且 vnc 传输的外观非常漂亮,反应时间也很好。只是我无法右键单击桌面并且没有任务栏/等离子面板丢失。
我可以使用诸如Firefox之类的终端启动应用程序,例如,不能以某种方式使用等离子面板。注销屏幕也可以正常工作,我可以使用完美的图形和动画注销和登录。
所以我的问题是:如何在 vnc 服务器上显示等离子面板 + 桌面,或者如何连接到 tty1 上的原始桌面?
(如果我直接访问服务器笔记本电脑,它可以正常工作,面板会显示并且运行流畅。我还在几秒钟内启动并运行了一个 gnome vnc 服务器 - 只是我爱上了 KDE,它实际上运行更流畅/更快/通过 vnc 比 gnome 反应)
[jack@nasa .vnc]$ cat nasa:1.log
16/12/19 02:43:40 Xvnc version TightVNC-1.3.10
16/12/19 02:43:40 Copyright (C) 2000-2009 TightVNC Group
16/12/19 02:43:40 Copyright (C) 1999 AT&T Laboratories Cambridge
16/12/19 02:43:40 All Rights Reserved.
16/12/19 02:43:40 See http://www.tightvnc.com/ for information on TightVNC
16/12/19 02:43:40 Desktop name 'X' (nasa:1)
16/12/19 02:43:40 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
16/12/19 02:43:40 Listening for VNC connections on TCP port 5901
16/12/19 02:43:40 Listening for HTTP connections on TCP port 5801
16/12/19 02:43:40 URL http://nasa:5801
RandR extension missing
qt.qpa.xcb: XKeyboard extension not present on the X server
QApplication: invalid style override passed, ignoring it.
Available styles: Breeze, qt5ct-style, Oxygen, Windows, Fusion
Omitting both --window and --windowclass arguments is not recommended
qt.qpa.xcb: XKeyboard extension not present on the X server
qt.qpa.xcb: XKeyboard extension not present on the X server
dbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.systemd1 was not provided by any .service files
QApplication: invalid style override passed, ignoring it.
Available styles: Breeze, qt5ct-style, Oxygen, Windows, Fusion
kdeinit5: preparing to launch '/usr/lib/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 36797, result = 0
kdeinit5: opened connection to :1
kdeinit5: preparing to launch 'libkdeinit5_kded5'
kdeinit5: Launched KDED, pid = 36814 result = 0
kdeinit5: preparing to launch 'libkdeinit5_kcminit_startup'
kdeinit5: Launched 'kcminit_startup', pid = 36816 result = 0
kdeinit5: Got SETENV 'GTK_RC_FILES=/etc/gtk/gtkrc:/home/jack/.gtkrc:/home/jack/.config/gtkrc' from launcher.
kdeinit5: Got SETENV 'GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/jack/.gtkrc-2.0:/home/jack/.config/gtkrc-2.0' from launcher.
Xlib: extension "XInputExtension" missing on display ":1".
kdeinit5: Got SETENV 'XCURSOR_THEME=breeze_cursors' from launcher.
kdeinit5: Got EXEC_NEW '/usr/bin/kaccess' from launcher.
kdeinit5: preparing to launch '/usr/bin/kaccess'
kdeinit5: PID 36816 terminated.
kdeinit5: Got EXEC_NEW '/usr/lib/kf5/kconf_update' from launcher.
kdeinit5: preparing to launch '/usr/lib/kf5/kconf_update'
kdeinit5: PID 36867 terminated.
kdeinit5: PID 36839 terminated.
kdeinit5: Got SETENV 'SESSION_MANAGER=local/nasa:@/tmp/.ICE-unix/36864,unix/nasa:/tmp/.ICE-unix/36864' from launcher.
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/xembedsniproxy.desktop" ("/usr/bin/xembedsniproxy")
Xlib: extension "XInputExtension" missing on display ":1".
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/polkit-kde-authentication-agent-1.desktop" ("/usr/lib/polkit-kde-authentication-agent-1")
Xlib: extension "MIT-SCREEN-SAVER" missing on display ":1".
Xlib: extension "MIT-SCREEN-SAVER" missing on display ":1".
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/org.kde.plasmashell.desktop" ("/usr/bin/plasmashell")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/pam_kwallet_init.desktop" ("/usr/lib/pam_kwallet_init")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/pulseaudio.desktop" ("/usr/bin/start-pulseaudio-x11")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/restore_kmix_volumes.desktop" ("/usr/bin/kmixctrl", "--restore")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/org.kde.kdeconnect.daemon.desktop" ("/usr/lib/kdeconnectd")
grep: .desktop: No such file or directory
/usr/bin/start-pulseaudio-x11: line 27: [: : integer expression expected
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/org.kde.discover.notifier.desktop" ("/usr/lib/DiscoverNotifier")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/gmenudbusmenuproxy.desktop" ("/usr/bin/gmenudbusmenuproxy")
[ERROR audio_thread_priority::rt_linux] setrlimit64: 1
kdeinit5: Got EXEC_NEW '/usr/lib/DiscoverNotifier' from launcher.
kdeinit5: preparing to launch '/usr/lib/DiscoverNotifier'
16/12/19 02:43:45 Got connection from client 192.168.1.9
16/12/19 02:43:45 Using protocol version 3.8
16/12/19 02:43:45 Full-control authentication passed by 192.168.1.9
16/12/19 02:43:45 Pixel format for client 192.168.1.9:
16/12/19 02:43:45 32 bpp, depth 24, little endian
16/12/19 02:43:45 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
16/12/19 02:43:45 no translation needed
16/12/19 02:43:45 Using hextile encoding for client 192.168.1.9
16/12/19 02:43:45 Enabling X-style cursor updates for client 192.168.1.9
16/12/19 02:43:45 Enabling cursor position updates for client 192.168.1.9
16/12/19 02:43:45 rfbProcessClientNormalMessage: ignoring unknown encoding -131072
16/12/19 02:43:45 rfbProcessClientNormalMessage: ignoring unknown encoding -223
16/12/19 02:43:45 rfbProcessClientNormalMessage: ignoring unknown encoding -131071
16/12/19 02:43:45 rfbProcessClientNormalMessage: ignoring unknown encoding -131070
16/12/19 02:43:45 rfbProcessClientNormalMessage: ignoring unknown encoding -131069
16/12/19 02:43:45 rfbProcessClientNormalMessage: ignoring unknown encoding -309
kdeinit5: Got EXEC_NEW '/usr/bin/kmix' from launcher.
kdeinit5: preparing to launch '/usr/bin/kmix'
kdeinit5: PID 36966 terminated.
The X11 connection broke: Unsupported extension used (code 2)
XIO: fatal IO error 2 (No such file or directory) on X server ":1"
after 305 requests (282 known processed) with 0 events remaining.
kdeinit5: Got EXEC_NEW '/usr/bin/korgac' from launcher.
kdeinit5: preparing to launch '/usr/bin/korgac'
XIO: fatal IO error 2 (No such file or directory) on X server ":1"
after 417 requests (417 known processed) with 0 events remaining.
kdeinit5: Got EXEC_NEW '/usr/bin/dolphin' from launcher.
kdeinit5: preparing to launch '/usr/bin/dolphin'
XIO: fatal IO error 0 (Success) on X server ":1"
after 404 requests (376 known processed) with 0 events remaining.
XIO: fatal IO error 0 (Success) on X server ":1"
after 336 requests (325 known processed) with 0 events remaining.
kdeinit5: PID 36987 terminated.
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/powerdevil.desktop" ("/usr/lib/org_kde_powerdevil")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/gnome-shell-overrides-migration.desktop" ("/usr/lib/gnome-shell-overrides-migration.sh")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/light-locker.desktop" ("/usr/bin/light-locker")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/geoclue-demo-agent.desktop" ("/usr/lib/geoclue-2.0/demos/agent")
org.kde.plasma.session: Starting autostart service "/home/jack/.config/autostart/ignore-lid-switch-tweak.desktop" ("/usr/lib/gnome-tweak-tool-lid-inhibitor")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/org.kde.korgac.desktop" ("/usr/bin/korgac")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/tracker-miner-rss.desktop" ("/usr/lib/tracker-miner-rss")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/tracker-store.desktop" ("/usr/bin/gdbus", "call", "-e", "-d", "org.freedesktop.DBus", "-o", "/org/freedesktop/DBus", "-m", "org.freedesktop.DBus.StartServiceByName", "org.freedesktop.Tracker1", "0")
** (light-locker:37055): ERROR **: 02:43:47.104: Environment variable XDG_SESSION_PATH not set. Is LightDM running?
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/tracker-extract.desktop" ("/usr/lib/tracker-extract")
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/tracker-miner-fs.desktop" ("/usr/lib/tracker-miner-fs")
Xlib: extension "XInputExtension" missing on display ":1".
Xlib: extension "XInputExtension" missing on display ":1".
XIO: fatal IO error 0 (Success) on X server ":1"
after 304 requests (293 known processed) with 0 events remaining.
org.kde.plasma.session: Starting autostart service "/etc/xdg/autostart/kmix_autostart.desktop" ("/usr/bin/kmix", "--keepvisibility")
(uint32 1,)
Traceback (most recent call last):
File "/usr/lib/gnome-tweak-tool-lid-inhibitor", line 17, in on_activate
var, fdlist = bus.call_with_unix_fd_list_sync('org.freedesktop.login1',
gi.repository.GLib.Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied (9)
KCrash: Attempting to start /usr/bin/kdeinit5 from kdeinit
kdeinit5: Got EXEC_NEW '/usr/bin/kdeinit5' from wrapper.
kdeinit5: preparing to launch '/usr/bin/kdeinit5'
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kdeinit5 path = /usr/bin pid = 36814
KCrash: Arguments: /usr/bin/kdeinit5
KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
kdeinit5: Got EXEC_NEW '/usr/lib/drkonqi' from wrapper.
kdeinit5: preparing to launch '/usr/lib/drkonqi'
kdeinit5: Shutting down running client.
kdeinit5: Got termination request (PID 36787).
kdeinit5: Closed sockets, but not exiting until all children terminate.
klauncher: Exiting on signal 15
kdeinit5: PID 36797 terminated.
KCrash: Attempting to start /usr/lib/org_kde_powerdevil from kdeinit
Warning: connect() failed: : No such file or directory
KCrash: Attempting to start /usr/lib/org_kde_powerdevil directly
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = org_kde_powerdevil path = /usr/lib pid = 37050
KCrash: Arguments: /usr/lib/org_kde_powerdevil
KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
Warning: connect() failed: : No such file or directory
KCrash: Attempting to start /usr/lib/drkonqi directly
Xlib: extension "MIT-SCREEN-SAVER" missing on display ":1".
kdeinit5: preparing to launch '/usr/lib/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 37221, result = 0
XIO: fatal IO error 0 (Success) on X server ":1"
after 337 requests (326 known processed) with 0 events remaining.
kdeinit5: preparing to launch '/usr/lib/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 37234, result = 0
Xlib: extension "MIT-SCREEN-SAVER" missing on display ":1".
kdeinit5: opened connection to :1
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/tags.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/tags.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/trash.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/trash.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/file.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/file.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/file.so'
kdeinit5: Got EXEC_NEW '/usr/lib/qt/plugins/kf5/kio/thumbnail.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/qt/plugins/kf5/kio/thumbnail.so'
kdeinit5: Communication error with launcher. Exiting!
kdeinit5: PID 37187 terminated.
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = drkonqi path = /usr/lib pid = 37189
KCrash: Arguments: /usr/lib/drkonqi --appname kdeinit5 --kdeinit --apppath /usr/bin --signal 11 --pid 36814 --startupid 0 --restarted
KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
Warning: connect() failed: : Connection refused
KCrash: Attempting to start /usr/lib/drkonqi directly
kdeinit5: PID 36814 terminated.
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = drkonqi path = /usr/lib pid = 37213
KCrash: Arguments: /usr/lib/drkonqi --appname org_kde_powerdevil --apppath /usr/lib --signal 6 --pid 37050 --appversion 2.0.0 --programname KDE Power Management System --bugaddress [email protected] --startupid 0 --restarted
KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
Warning: connect() failed: : Connection refused
KCrash: Attempting to start /usr/lib/drkonqi directly
Unable to start Dr. Konqi
Re-raising signal for core dump handling.
Unable to start Dr. Konqi
Re-raising signal for core dump handling.
kdeinit5: PID 37189 terminated.
16/12/19 02:44:56 KbdAddEvent: unknown KeySym 0xff61 - allocating KeyCode 89
(tracker-miner-fs:37115): Tracker-CRITICAL **: 02:45:24.859: Could not remove files in volumes: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
(tracker-miner-fs:37115): Tracker-CRITICAL **: 02:45:24.859: Could not remove files in volumes: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
(tracker-miner-fs:37115): Tracker-CRITICAL **: 02:45:24.859: Could not initialize currently active mount points: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
kdeinit5: PID 37256 terminated.
kdeinit5: PID 37263 terminated.
kdeinit5: PID 37270 terminated.
kdeinit5: PID 37262 terminated.
kdeinit5: PID 37272 terminated.
16/12/19 02:53:56 Client 192.168.1.9 gone
16/12/19 02:53:56 Statistics:
16/12/19 02:53:56 key events received 12, pointer events 935
16/12/19 02:53:56 framebuffer updates 318, rectangles 834, bytes 13818357
16/12/19 02:53:56 cursor shape updates 74, bytes 9740
16/12/19 02:53:56 cursor position updates 1, bytes 12
16/12/19 02:53:56 copyRect rectangles 39, bytes 624
16/12/19 02:53:56 hextile rectangles 720, bytes 13807981
16/12/19 02:53:56 raw bytes equivalent 318610964, compression ratio 23.074406
所以我为我找到了 2 个解决方案 - 如果有人遇到同样的问题。
使用 Tigervnc 或 Tightvnc
用 x11vnc
两者的区别在于 1. 启动自己的 x11 服务器和 2. 连接到现有桌面。使用 1. 我可以设置任何我想要的屏幕分辨率,并尽可能多地启动硬件可以处理 - 没有任何限制。
1. 在第一次启动tigervnc 后,在~/.vnc 文件夹中出现一个xstartup 文件,该文件必须包含以下内容才能启动kde plasma x11 会话:
所有已注释掉的选项(还有更多是结果不好或根本没有结果的试验)
vncserver :1 -depth 24 -geometry 1920x1080
以 FullHD 启动服务器vncserver -kill :1
并将其终止(1 代表会话,并且在您之前运行该命令的次数越多)我可以使用带有 ip 和端口的 remmina gui 客户端连接到它 - fe 192.168.1.4:5901(标准端口,您可以找到您的服务器IP与ip addr
)仍然没有任务栏,也没有可用的后台桌面选项 - 但它可以工作,我可以移动和调整窗口大小并使用终端启动新窗口 - 如果你找到解决方案 - 很高兴听到它:)
2. 非常简单/快速,只需安装 x11vnc (
sudo pacman -S x11vnc
) 并在服务器上启动它x11vnc -many -display :0
比连接 remmina 客户端和 ip(无端口)(fe 192.168.1.4)-繁荣完成-原始监视器的图片。(在我的情况下只是高清分辨率 - 但使用桌面和任务面板)
如果我跳过命令 -many,会话仅可用于一个连接,并在我断开 vnc 客户端后结束,并且每次我想连接时都必须重新启动。有很多它留下来。重新启动后自动启动 x11vnc 完成以下操作:
我已经失去了几个小时。我认为以 root 身份启动 x11vnc 不是一个好主意。这
[email protected]
- 在 Arch Linux 上这个文件夹所在的位置/usr/lib/systemd/system/
- 只需创建一个文件[email protected]
并包含以下内容。可以启动一次
您可以在其中将“用户”更改为您的用户,它可以在启动后自动启动
它永远不会失败(也许关于重启的行可以省略)。
是的 - 就是这样:)
编辑:我现在在许多 Arch linux 服务器上对其进行了测试,出于稳定性原因,应该使用 git 版本(
yay -S x11vnc-git
而不是yay -S x11vnc
),因为通过在特定计算机上编译它,编译器可以针对已安装的系统对其进行完美优化。在大多数情况下不是必需的,但对于某些硬件是必需的。此外,-ncache 2 标志通过仅将差异发送到上一张图片来加速/保护 vnc 服务器的带宽,但如果带宽无关紧要,它是可选的并且没有它也可以正常工作。