我正在使用 ssh -X 在本地显示 GUI 应用程序。
有没有更好的方法来加速这个过程——类似于 NoMachine Nx 服务器/客户端所做的事情?
谢谢,马留斯。
每当我使用 X11 ssh 从我的 macbook 转发到远程盒子时,我会在几秒钟暂停后收到以下错误:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Run Code Online (Sandbox Code Playgroud)
有想法该怎么解决这个吗?
我在 Linux 服务器中有一个 OpenGL 程序。我想通过 X 转发远程运行该程序,但它失败了,而 xclock 和 xeyes 等程序运行良好。(我确认该程序可在本地桌面环境中运行。)以下是附加信息。
测试代码:
#include <GL/glut.h>
#define WIDTH 300
#define HEIGHT 300
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3d(1, 0, 0);
glBegin(GL_POLYGON);
glVertex2i(10, 10);
glVertex2i(WIDTH / 2, HEIGHT - 10);
glVertex2i(WIDTH - 10, 10);
glEnd();
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(WIDTH, HEIGHT);
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);
glutCreateWindow("Test");
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0, WIDTH, 0, HEIGHT);
glutDisplayFunc(display);
glutMainLoop();
}
Run Code Online (Sandbox Code Playgroud)
跑步:
$ gcc test.c -lGLU -lglut
$ ./a.out
Xlib: extension "Generic Event Extension" …Run Code Online (Sandbox Code Playgroud) 我可以成功打开ssh -X从host.home到host.work(Mac OS X)的连接。X11 正在运行host.home。当我启动xterm或xeyes打开时,host.work我看到它打开host.home,但是如果我启动 macvim,它会host.work在host.home.
是否可以远程使用 macvim on host.home,或者只能使用支持X11 的程序进行远程交互?
当我在该 macbook 上的 Ubuntu 虚拟机中时,我可以从我的 macbook SSH 到远程 Linux 机器 - 但不能从 OSX。我寻求有关如何让 OSX 与 X11 转发一起工作的指导,并怀疑这是 OSX Mavericks 问题。在我升级之前它曾经在 Mountain Lion 上工作,所以我想我错过了一步。
请注意,这不是升级到 OS X Mavericks 后 X11/XQuartz 不会自动启动?正如我对 Mavericks 进行格式化和全新安装一样
# This is the /etc/ssh/sshd_config file, trimmed down
# Relevant lines:
X11Forwarding yes
X11UseLocalhost yes
X11DisplayOffset 10
# Maybe relevant:
RSAAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
PasswordAuthentication yes # I didn't want to copy the rsa key into ubuntu VM …Run Code Online (Sandbox Code Playgroud) bash我的 bash 配置文件中有一个特定的代码:
$ cat ~/.bash_profile
#!/usr/bin/env bash
echo "SHELL: $SHELL"
function printfiles() {
while IFS='' read -r _file || [[ -n "$_file" ]]; do
echo "file: ${_file}"
done < <(ls)
} && export -f printfiles
Run Code Online (Sandbox Code Playgroud)
的< <(FUNCTION)是bash特定的语法,不支持的sh。当我使用 ssh 登录到远程机器时:
$ ssh my.remote
me@xxx.xx.xxx.xx's password:
Last login: Fri Nov 17 11:27:39 2017 from yyy.yy.yy.yy
sourcing /home/me/.bash_profile
SHELL: /bin/bash
Run Code Online (Sandbox Code Playgroud)
它工作正常。现在我想再次登录但转发我的X11:
$ ssh -X my.remote
me@xxx.xx.xxx.xx's password:
sh: printfiles: line 2: syntax error …Run Code Online (Sandbox Code Playgroud) 我想从远程机器运行一个容器化的 GUI 应用程序。
我不想通过向容器添加 ssh 主机来解决这个问题,因为
我已经可以在主机上成功运行 GUI 应用程序,但不能从容器内运行。这些是我迄今为止采取的步骤:
xauth + (不是长期的,但有助于消除可能的问题)docker-user主机上的 uid 501000 ==docker-user容器中的 uid 1000 通过命名空间功能.Xauthority文件复制到docker-user主文件夹xauth并且为了测试目的,xtermdocker-user使用适当的 uid/gid创建DISPLAY转发的环境变量/home/docker-user/:/home/docker-user/:ro提供.Xauthority的cookie/tmp/.X11-unix:/tmp/.X11-unix:ro提供X11插槽接入su - docker-user -c "export DISPLAY=$DISPLAY && xterm"
su 曾经作为 docker-userDISPLAY转发到su上下文中不幸的是,这还不够。虽然主机操作系统上的 xterm 连接到我的本地 X 服务器没有问题,但容器中的 xterm 显示Xt error: Can't open display: …
我正在连接到 ubuntu 服务器,并希望使用 X-forwarding 在本地客户端计算机上绘制图形窗口。我在客户端运行xming。
在 cmd.exe 中,这是有效的:
set DISPLAY=localhost:0.0
ssh -Y me@ubuntuserver
Run Code Online (Sandbox Code Playgroud)
我在 Powershell 中运行相同的操作,它连接成功,但是当我尝试在服务器上运行 xeyes 这样的图形程序时,我得到:
Error: Can't open display:
Run Code Online (Sandbox Code Playgroud)
有什么不同?
如果我曾经ssh -X在计算机 B 的屏幕上运行来自计算机 A 的应用程序,那么两台计算机的处理器之间如何分配计算和资源?
这有点令人困惑。
另外,哪个是“服务器”,哪个是“客户端”?
我正在使用速度较慢但便携的计算机(华硕 eeepc、vivobook 等),并在远程服务器上进行所有开发。
大多数时候我只是ssh到服务器,开始screen会话,如果发生任何事情(例如客户端睡眠,连接中断等),我只是再次连接并恢复我的屏幕会话。
但最近我一直在运行 X 应用程序作为我开发的一部分,尤其是 android 模拟器。每次我让我的笔记本电脑进入睡眠状态并尝试恢复工作时,我所有的 X 应用程序都死了,类似于:
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server "localhost:10.0"
after 356 requests (356 known processed) with 0 events remaining.
Run Code Online (Sandbox Code Playgroud)
无论如何,我可以使用控制台应用程序但使用 X 应用程序的那种远程工作流程吗?
我正在使用 Raspberry Pi 开发机器人,但在 X11 转发方面遇到问题。当我要运行我的脚本时:
sudo python myscript.py
Run Code Online (Sandbox Code Playgroud)
我收到错误:
Putty X11 proxy: Authorisation not recognised
(Imagen Combinada:3642) : Gtk-Warning **: cannot open display: localhost:10.0
Run Code Online (Sandbox Code Playgroud)
我正在使用 PuTTY 和 Xming(启用 SSH -> X11 -> 启用 X11 转发)。
有人知道这里会发生什么,我该如何解决?
我有以下环境:
我正在寻找一种方法来“统一”两者。我花了一些时间从 Ubuntu 远程桌面进入 Windows,但遇到了一些让我放弃的小故障。我目前正在使用 Synergy,它运行良好,但有其自身的故障(即复制/粘贴)。
我最近的实验涉及在我的笔记本电脑上运行 Cygwin X 并将我所有的 GVIM 窗口等转发到 Windows。这工作得很好,但是每当我将笔记本电脑与网络断开连接时,所有这些窗口(以及 Ubuntu 上的相应进程)都会死掉。当我重新连接时,我必须再次重新启动所有这些进程。
我的问题:有没有一种方法可以像使用 tmux/screen 这样的程序一样使用 Cygwin X。例如:
这可能吗?
x11-forwarding ×12
ssh ×6
xorg ×4
linux ×2
alpine-linux ×1
bash ×1
cygwin ×1
docker ×1
mac ×1
macos ×1
networking ×1
opengl ×1
powershell ×1
putty ×1
raspberry-pi ×1
remote ×1
sh ×1
shell ×1
suspend ×1
ubuntu ×1
xauth ×1
xforwarding ×1