如何在 Windows 中从命令行访问 NX Server?
我想使用具有 Windows 的客户端设备通过命令行使用 nxssh、nxWin、nxproxy 等组件访问 NX 服务器。不通过 NX 客户端的 GUI。
换句话说,我想要在 Windows 中使用与 Linux 中使用的“nxproxy -S ...”等命令相反的命令。
I want to access NX server using a client device which has Windows through command line using components like nxssh, nxWin, nxproxy. Not through the GUI of the NX Client.
In other words, I want the opposite command in Windows of the commands like 'nxproxy -S ...' that's used in Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
nxproxy 似乎没有为 Windows 客户端提供。但是,您可以使用 nxcomp-3.4.0-7.tar.gz 和 nxproxy-3.4.0-2.tar.gz 中的 Cygwin 工具对其进行编译。您可能需要以下 Cygwin 软件包:
将 NX tarball 解压到一个公共目录中,以便它包含子目录 nxcomp/ 和 nxproxy/然后。
构建 nxcomp-3.4.0-7:
构建 nxproxy-3.4.0-2:
然后将 cygXcomp.dll 和 nxproxy.exe 放在您选择的任何目录中,它应该从那里运行。
注意: nxcomp 包含使其在针对 Windows 构建时使用 nxauth 而不是 xauth 的代码。如果这不是您想要的,因为您想使用 Cygwin 的 xauth,请从 Auth.cpp 中删除相应的部分。但是,如果将 NX_SYSTEM 环境变量设置为 NX 客户端的安装目录,nxauth 应该可以正常工作。
NXWin 包含在客户端安装中。它对其调用可能有点挑剔。对我有用的一行是:
您可以提供“-screen 0 1280x1024”等而不是“-fullscreen”来获取窗口。
nxwin.exe 的路径参数应采用 POSIX 格式(“/cygdrive/c/...”)。要了解您的字体路径设置,您可以尝试通过 nxservice.exe 运行 NXWin,这将在控制台上输出信息丰富的日志,例如,
除了 NX_SYSTEM 之外,在运行 nxservice 之前还必须设置 NX_ROOT 和 XAUTHORITY 环境变量。 NX_ROOT 是您的 .nx 目录。 XAUTHORITY 指向 Xauthority 文件,可以是 %USERPROFILE%\.Xauthority。
nxproxy doesn't seem to be supplied for the Windows client. However, you can compile it with Cygwin tools from nxcomp-3.4.0-7.tar.gz and nxproxy-3.4.0-2.tar.gz. You might need the following Cygwin packages:
Unpack the NX tarballs in one common directory, so that it contains the subdirectories nxcomp/ and nxproxy/ afterwards.
To build nxcomp-3.4.0-7:
To build nxproxy-3.4.0-2:
Afterwards put cygXcomp.dll and nxproxy.exe in any directory of your choice, it should run from there.
Note: nxcomp includes code that makes it use nxauth instead of xauth when building for Windows. If that's not what you want, because you want to use Cygwin's xauth, remove the appropriate part from Auth.cpp. But nxauth should work just fine if you set the NX_SYSTEM environment variable to your NX client's installation directory.
NXWin is included with the client installation. It can be a bit picky about its invocation. A line that works for me is:
You can supply "-screen 0 1280x1024" etc. instead of "-fullscreen" to get a window.
Path arguments to nxwin.exe should be in POSIX format ("/cygdrive/c/..."). To find out about your font path setting, you could try running NXWin through nxservice.exe which will result in informative log output on the console, e. g.
In addition to NX_SYSTEM, it is necessary to set the NX_ROOT and XAUTHORITY environment variables before running nxservice. NX_ROOT is your .nx directory. XAUTHORITY points to the Xauthority file, which could be %USERPROFILE%\.Xauthority.