首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用( MacOS )vnc控制Debian主机的MacOS屏幕共享应用

使用( MacOS )vnc控制Debian主机的MacOS屏幕共享应用
EN

Unix & Linux用户
提问于 2021-05-12 11:47:13
回答 2查看 514关注 0票数 0

我的目标是连接到远程主机(运行Debian),这样我就可以控制整个桌面环境。因此,我尝试使用vnc/x11vnc,如下文所示:

当我想连接时,我在Debian主机中调用它:

代码语言:javascript
复制
❯ x11vnc -rfbauth ~/.vnc/passwd
12/05/2021 06:01:16 passing arg to libvncserver: -rfbauth
12/05/2021 06:01:16 passing argx to libvncserver: /home/massisenergy/.vnc/passwd
12/05/2021 06:01:16 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 3011
12/05/2021 06:01:16 XOpenDisplay("") failed.
12/05/2021 06:01:16 Trying again with XAUTHLOCALHOSTNAME=localhost ...
12/05/2021 06:01:16
12/05/2021 06:01:16 *** XOpenDisplay failed. No -display or DISPLAY.
12/05/2021 06:01:16 *** Trying ":0" in 4 seconds.  Press Ctrl-C to abort.
12/05/2021 06:01:16 *** 1 2 3 4
12/05/2021 06:01:20 *** XOpenDisplay of ":0" successful.
12/05/2021 06:01:20
12/05/2021 06:01:20 Using X display :0
12/05/2021 06:01:20 rootwin: 0x143 reswin: 0x2400001 dpy: 0xc74adb40
12/05/2021 06:01:20
12/05/2021 06:01:20 ------------------ USEFUL INFORMATION ------------------
12/05/2021 06:01:20 X DAMAGE available on display, using it for polling hints.
12/05/2021 06:01:20   To disable this behavior use: '-noxdamage'
12/05/2021 06:01:20
12/05/2021 06:01:20   Most compositing window managers like 'compiz' or 'beryl'
12/05/2021 06:01:20   cause X DAMAGE to fail, and so you may not see any screen
12/05/2021 06:01:20   updates via VNC.  Either disable 'compiz' (recommended) or
12/05/2021 06:01:20   supply the x11vnc '-noxdamage' command line option.
12/05/2021 06:01:20
12/05/2021 06:01:20 Wireframing: -wireframe mode is in effect for window moves.
12/05/2021 06:01:20   If this yields undesired behavior (poor response, painting
12/05/2021 06:01:20   errors, etc) it may be disabled:
12/05/2021 06:01:20    - use '-nowf' to disable wireframing completely.
12/05/2021 06:01:20    - use '-nowcr' to disable the Copy Rectangle after the
12/05/2021 06:01:20      moved window is released in the new position.
12/05/2021 06:01:20   Also see the -help entry for tuning parameters.
12/05/2021 06:01:20   You can press 3 Alt_L's (Left "Alt" key) in a row to
12/05/2021 06:01:20   repaint the screen, also see the -fixscreen option for
12/05/2021 06:01:20   periodic repaints.
12/05/2021 06:01:20
12/05/2021 06:01:20 XFIXES available on display, resetting cursor mode
12/05/2021 06:01:20   to: '-cursor most'.
12/05/2021 06:01:20   to disable this behavior use: '-cursor arrow'
12/05/2021 06:01:20   or '-noxfixes'.
12/05/2021 06:01:20 using XFIXES for cursor drawing.
12/05/2021 06:01:20 GrabServer control via XTEST.
12/05/2021 06:01:20
12/05/2021 06:01:20 Scroll Detection: -scrollcopyrect mode is in effect to
12/05/2021 06:01:20   use RECORD extension to try to detect scrolling windows
12/05/2021 06:01:20   (induced by either user keystroke or mouse input).
12/05/2021 06:01:20   If this yields undesired behavior (poor response, painting
12/05/2021 06:01:20   errors, etc) it may be disabled via: '-noscr'
12/05/2021 06:01:20   Also see the -help entry for tuning parameters.
12/05/2021 06:01:20   You can press 3 Alt_L's (Left "Alt" key) in a row to
12/05/2021 06:01:20   repaint the screen, also see the -fixscreen option for
12/05/2021 06:01:20   periodic repaints.
12/05/2021 06:01:20
12/05/2021 06:01:20 XKEYBOARD: number of keysyms per keycode 7 is greater
12/05/2021 06:01:20   than 4 and 51 keysyms are mapped above 4.
12/05/2021 06:01:20   Automatically switching to -xkb mode.
12/05/2021 06:01:20   If this makes the key mapping worse you can
12/05/2021 06:01:20   disable it with the "-noxkb" option.
12/05/2021 06:01:20   Also, remember "-remap DEAD" for accenting characters.
12/05/2021 06:01:20
12/05/2021 06:01:20 X FBPM extension not supported.
12/05/2021 06:01:20 X display is capable of DPMS.
12/05/2021 06:01:20 --------------------------------------------------------
12/05/2021 06:01:20
12/05/2021 06:01:20 Default visual ID: 0x21
12/05/2021 06:01:20 Read initial data from X display into framebuffer.
12/05/2021 06:01:20 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/7680
12/05/2021 06:01:20
12/05/2021 06:01:20 X display :0 is 32bpp depth=24 true color
12/05/2021 06:01:20
12/05/2021 06:01:20 Autoprobing TCP port
12/05/2021 06:01:20 Autoprobing selected TCP port 5900
12/05/2021 06:01:20 Autoprobing TCP6 port
12/05/2021 06:01:20 Autoprobing selected TCP6 port 5900
12/05/2021 06:01:20 listen6: bind: Address already in use
12/05/2021 06:01:20 Not listening on IPv6 interface.
12/05/2021 06:01:20
12/05/2021 06:01:20 Xinerama is present and active (e.g. multi-head).
12/05/2021 06:01:20 Xinerama: number of sub-screens: 1
12/05/2021 06:01:20 Xinerama: no blackouts needed (only one sub-screen)
12/05/2021 06:01:20
12/05/2021 06:01:20 fb read rate: 3248 MB/sec
12/05/2021 06:01:20 fast read: reset -wait  ms to: 10
12/05/2021 06:01:20 fast read: reset -defer ms to: 10
12/05/2021 06:01:20 The X server says there are 20 mouse buttons.
12/05/2021 06:01:20 screen setup finished.
12/05/2021 06:01:20

The VNC desktop is:      debianSR:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

12/05/2021 06:01:23 Got connection from client 10.39.3.163
12/05/2021 06:01:23   other clients:
12/05/2021 06:01:23 Normal socket connection
12/05/2021 06:01:23 Disabled X server key autorepeat.
12/05/2021 06:01:23   to force back on run: 'xset r on' (3 times)
12/05/2021 06:01:23 incr accepted_client=1 for 10.39.3.163:57928  sock=11
12/05/2021 06:01:23 Client Protocol Version 3.3
12/05/2021 06:01:23 Protocol version sent 3.3, using 3.3
12/05/2021 06:01:23 created   xdamage object: 0x2400040
12/05/2021 06:01:23 client useCopyRect: 10.39.3.163 0
12/05/2021 06:01:23 client_set_net: 10.39.3.163  0.0035
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x000003F3)
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x000003EA)
12/05/2021 06:01:24 Enabling full-color cursor updates for client 10.39.3.163
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000450)
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044C)
12/05/2021 06:01:24 Enabling NewFBSize protocol extension for client 10.39.3.163
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044D)
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000451)
12/05/2021 06:01:24 Using zlib encoding for client 10.39.3.163
12/05/2021 06:01:24 Pixel format for client 10.39.3.163:
12/05/2021 06:01:24   32 bpp, depth 32, little endian
12/05/2021 06:01:24   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x000003F3)
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x000003EA)
12/05/2021 06:01:24 Enabling full-color cursor updates for client 10.39.3.163
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000450)
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044C)
12/05/2021 06:01:24 Enabling NewFBSize protocol extension for client 10.39.3.163
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044D)
12/05/2021 06:01:24 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000451)
12/05/2021 06:01:24 Switching from zlib to zlib Encoding for client 10.39.3.163
12/05/2021 06:01:25 client 1 network rate 386.8 KB/sec (5119.8 eff KB/sec)
12/05/2021 06:01:25 client 1 latency:  0.5 ms
12/05/2021 06:01:25 dt1: 1.6203, dt2: 0.0000 dt3: 0.0005 bytes: 626674
12/05/2021 06:01:25 link_rate: LR_LAN - 1 ms, 386 KB/s
12/05/2021 06:01:26 copy_tiles: allocating first_line at size 61
12/05/2021 06:01:33 created selwin: 0x2400041
12/05/2021 06:01:33 called initialize_xfixes()
12/05/2021 06:01:39 client_count: 0
12/05/2021 06:01:39 Restored X server key autorepeat to: 1
12/05/2021 06:01:39 viewer exited.
12/05/2021 06:01:39 deleted 60 tile_row polling images.

但是过了一段时间(可能2分钟,也许2小时),它就停止了,我不知道为什么。如果我重新启动它,然后再工作一段时间。你知道是怎么回事吗?我怎样才能使vnc连接更可靠,更持久(每次最多8小时)?

这是我的startup文件:

代码语言:javascript
复制
❯ cat ~/.vnc/xstartup
#!/bin/zsh

# unset SESSION_MANAGER

xrdb $HOME/.Xresources
startxfce4 &
/etc/X11/Xsession
  1. 任何关于其他连接方式的建议(比如我现在正在考虑的克普拉 )也是受欢迎的!
  2. 我无法使用双向剪贴板(在Screen Sharing.app中是灰色的)。需要更改Debian主机中的任何设置吗?
EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2021-05-12 12:07:17

有两种备选方案:

  • X2Go --这是一个很棒的远程桌面解决方案,实际上是我能找到键盘布局切换正确工作的唯一解决方案(如果您使用多个键布局)。X2Go服务器可以在Debian上使用;您需要自己的客户端,有一个Mac版本。
  • xrdp --这也很好;它实际上启动了一个Microsoft / RDS协议。它也可以在Debian repos中获得。对于客户端,您需要一个Microsoft协议客户端;还有一个来自MS的官员,我想还有其他人。

以上解决方案提供双向剪贴板.

我使用Xpra进行远程应用程序访问;它比X转发更快。我还没有把它用于远程桌面。

票数 1
EN

Unix & Linux用户

发布于 2021-06-08 13:23:44

不能同时使用x11vnctightvnc。它们的工作方式完全不同。x11vnc允许远程访问存在的真实X服务器,而tightvnc则创建一个新的隐藏X服务器,由VNC客户端访问。

我假设您希望使用x11vnc,因为这是您运行的命令。在这种情况下,请删除tightvncserver包和~/.vnc/xstartup,因为xstartup只用于tightvnc

此外,当您启动x11vnc服务器时,从退出的X会话中启动它,以便正确设置$DISPLAY变量。

根据您的桌面环境,您可能能够找到一个名为"X11VNC服务器“的应用程序,该应用程序可以在GUI模式下启动x11vnc,从而使您能够轻松地配置它。

要让它自动启动,如果您正在使用xinit,请将它添加到您的.xinitrc中。如果使用的是显示管理器,请参见这个职位

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/649360

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档