如何为 VNC 启用文本复制和粘贴

Fis*_*her 16 copy-paste vnc-viewer

我正在通过 VNC 查看器访问远程机器。有时我发现我无法从 VNC 查看器复制和粘贴文本。

Lio*_*ion 11

没有一个已发布的答案对我有用。vncconfig未安装,其他帖子表明这些修复仅在 c&p 过去工作时才有帮助。在新机器上,我的情况并非如此。

在 Raspberry Pi 3 上使用紧密的 vnc 服务器,我必须安装autocutsel

sudo apt-get install autocutsel
Run Code Online (Sandbox Code Playgroud)

将以下行添加到~/.vnc/xstartup

autocutsel -fork
Run Code Online (Sandbox Code Playgroud)

我的完整xstartup文件现在看起来像这样:

#!/bin/sh

xrdb $HOME/.Xresources
# -solid grey gaves us a real mouse pointer instead of the default X
xsetroot -solid grey -cursor_name left_ptr
# Allow copy & paste when ClientCutText is set to true on the client side
autocutsel -fork

export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
Run Code Online (Sandbox Code Playgroud)

要应用更改,请重新启动 VNC 服务器:

vncserver -kill :1
vncserver :1 -localhost -geometry 1400x1050
Run Code Online (Sandbox Code Playgroud)

根据您的需要调整参数(显示、分辨率……) 现在确保ClientCutText在您的客户端上将该属性设置为 true。在真正的 vnc 查看器中,打开属性并选择专家选项卡。

现在复制和粘贴对我有用:)


小智 6

嗯,这对我有用:

我所做的就是使用“以管理员身份运行”打开VNC,并且我能够通过VNC将粘贴从Windows 10复制到Mac


Fis*_*her 5

如果您无法复制和粘贴文本,请首先检查您是否运行了“vncconfig &”。

如果仍然不能,请检查终端编号 n 并运行“vncconfig -display :n &”。

希望这可以帮助。

  • 不直观的是,显示的 vncconfig 程序是复制和粘贴所必需的。我关上了它的窗口,想着:“我不需要改变我的设置。” 后来我注意到复制和粘贴不起作用,想知道为什么。运行 `vncconfig &` 为我修复了它。 (2认同)