VcXsrv Windows X Server

23 篇文章 0 订阅
6 篇文章 0 订阅

发现一个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为前面保存的配置文件。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值