xshell打开GUI程序失败

本文介绍了解决Xshell中GUI程序无法通过Xmanager正常显示的问题。当使用su命令切换用户后,尝试运行GUI程序时会出现连接丢失错误。文章提供了具体的解决方案,包括创建并配置/root/.xauth/export文件。

xshell中执行GUI程序时会自动运行Xmanager,并在客户端机器显示GUI程序的图形界面。但使用su - xiao切换用户后,执行GUI程序报错:Connection lost to X server `localhost:10.0';xshell直接登录用户xiao则能够正常显示。查看环境变量DISPLAY,两种情况下都是localhost:10.0。

 

新建文件 /root/.xauth/export,内容为用户名xiao,问题解决。

 

问题解析:

-------------------------

The message above is received when X application fails to connect to PC X server, Xmanager.

The common reasons that may cause connection failure to PC X server are the following:

1. PC X server is not installed: After installing Xmanager, set "Forward X11 connections to Xmanager"(Properties -> Tunneling -> X11 Forwarding).

2. When switched to a different user using su command, X11 authentication cookie cannot be accessed.

 

-------------------------

 

The authority is propagated. Once you switch user to root s broken and you must manually create the xauthority. This behaviour is controlled by pam_xauth, and apparently you can make it automatic for root to forward the xauth key to a user by creating a file /root/.xauth/export and adding the allowed users to it, see
http://www.kernel.org/pub/linux/libs...pam_xauth.html

 

参考:

http://www.netsarang.com/bbs/detail.html?id=xshell&num=151

### Xshell 打开时报错的解决方案 #### Initialize Flexnet Service Failed 错误码 50003 当遇到“Initialize Flexnet Service failed Error code:50003”的错误时,通常是因为许可证服务未能正常启动。可以尝试通过重启计算机来解决问题[^2]。 如果重启无效,则需确认防火墙设置是否阻止了FlexNet服务通信。确保Windows防火墙或其他第三方安全软件允许必要的网络访问权限给Xshell应用程序。 对于更深层次的问题排查,建议检查事件查看器中的应用程序日志,寻找任何可能影响FlexNet服务运行的相关警告或错误信息。 #### 需要最新更新或更高版本提示 面对“要继续使用此程序必须应用到最新的更新或使用新版本”的消息,最直接的方法是下载并安装官方发布的最新版Xshell客户端[^3]。这不仅能够修复已知漏洞,还能获得性能改进和其他功能增强。 #### msvcr110.dll 缺失问题 针对因缺少`msvcr110.dll`文件而导致无法启动的情况,可以从微软官方网站获取Visual C++ Redistributable包进行安装[^4]。该 redistributable 包含了运行基于 Visual Studio 开发的应用所需的支持库。 另外一种方法是在同一目录下放置一个名为 `Microsoft.VC110.CRT.manifest` 的清单文件以及对应的动态链接库副本(如 `msvcp110.dll`, `msvcr110.dll`),但这不是推荐的做法,因为可能会带来兼容性和安全性风险。 ```bash # 下载 Microsoft Visual C++ Redistributable for Visual Studio 2012 Update 4 wget https://aka.ms/vs/11/release/vc_redist.x64.exe -O vc_redist.x64.exe # 安装 VC++ ./vc_redist.x64.exe /install /quiet /norestart ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值