macos - 无法打开显示错误

标签 macos opengl ssh terminal x11

每当我尝试通过 sshing 进入 linux 服务器打开外部显示器时,我都会遇到错误。该错误发生在各种情况下:

freeglut (./executable): 无法打开显示 'localhost:22.0' * 程序与 openGL 链接

(gedit:9741): Gtk-WARNING **: 无法打开显示: localhost:22.0

基本上任何需要打开外部显示器的东西都会导致错误。网上查了一下,跟display变量有关系,原来是0:0。但是,我更改了本地 ~/.profile 以包含显示相同错误的行 (DISPLAY=localhost:0.0; export DISPLAY),但使用 localhost:x:0 而不仅仅是 0:0。

我已经安装了 xquartz,并且我设置了 -Y 标志。我也试过 -X 标志,但仍然不走运。

最佳答案

Linux系统上的SSH服务器也必须开启X11转发。在/etc/ssh/sshd_config 设置

X11Forwarding yes
X11UseLocalhost yes

不要自己弄乱 DISPLAY 变量,SSH 服务器在内部处理正确的授权设置,并将相应地设置 DISPLAY。

关于macos - 无法打开显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22314995/

相关文章:

macos - 验证通过 codesign、spctl 和 check-signature 但无法运行的 macOS 应用程序 "because the identity of the developer cannot be confirmed"

macos - 无法获取删除键以使用 tmux 和 OSX

xcode - MacOS 应用程序无法在 Xcode 模拟器上运行

c++ - 使用 OpenGL 和 GLU 在 NURB 上查找点

opengl - CMake 链接 OpenGL 和 GLUT 库

c++ - 如何更新 GLSL 中的统一变量

c# - SshNet命令执行

phpseclib连接MYSQL服务器

intellij-idea - 使用 SSH 从远程服务器中的 IntelliJ IDEA 运行

mysql - 导入错误:没有名为 connector.conversion 的模块