首页 > 编程知识 正文

vcxsrv连linux黑屏VcXsrv Windows X Server

时间:2023-05-05 05:59:22 阅读:208987 作者:3467

发现一个windows下开源且好用X Server.

http://sourceforge.net/projects/vcxsrv/

Windows X-server based on the xorg git sources (like xming or cygwin's xwin), but compiled with Visual C++ 2010. Source code can also be compiled with VS2008, VS2008 Express Edition and VS2010 Express Edition.

安装完后,修改system.XWinrc菜单

menu remotehost {

ubuntu-svr menu remoteapps

}

menu remoteapps {

xterm exec "wscript ubuntuexterm.vbs"

emacs exec "wscript ubuntuemacs.vbs"

}

menu root {

// Comments fit here, too...

"Reload system.XWinrc" RELOAD

"Applications" menu apps

Separator

"Show log" exec "notepad %logfile%"

Separator

"Remote Apps" menu remotehost

}

vbs脚本(目的是启动远程程序时不出现控制台窗口cmd):

dim objShell

set objShell=wscript.createObject("WScript.Shell")

iReturnCode=objShell.Run("plink -ssh -2 -X -pw pwd user@192.168.0.84 emacsclient -c -a '' ",0,TRUE)

可以编辑一个通用的执行脚本,如全名为remoteexec.vbs

内容如下:

dim objShell

set objShell=wscript.createObject("WScript.Shell")

Set args = WScript.Arguments

if args.Count > 2 then

pwd = args(0)

url = args(1)

cmd = args(2)

iReturnCode=objShell.Run("plink -ssh -2 -X -pw " & pwd &" " & url & " " & cmd,0,TRUE)

end if

可使用如下命令执行:

wscript remoteexec.vbs pwd user@192.168.56.10 emacs

菜单中配置可为:

menu vmsvrapps {

terminator exec "wscript remoteexec.vbs pwd user@192.168.56.10 terminator"

gnome-terminal exec "wscript remoteexec.vbs pwd user@192.168.56.10 gnome-terminal"

emacs exec "wscript remoteexec.vbs pwd user@192.168.56.10 emacs"

}

自启动x server:

1.运行xlanuch按喜好配置好,并保存配置文件

2.增加启动项,启动命令为:

xlanuch -run config.xlaunch

config.xlaunch为前面保存的配置文件。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。