Seamless Window for RDP - Code a World

Seamless Window for RDP

PengLiang posted @ 2011年7月06日 20:48 in Linux with tags seamlessrdp rdesktop , 5782 阅读

1. Intro

    Seamless Window (无缝窗口) 用在远程桌面上非常实用。

    Windows自带的远程桌面不支持无缝窗口,所以估计大家也没怎么用过,平常远程连接都是直接登录到远程机器上操作完了再返回,也没什么不方便的。但是设想一下,你实在想在Linux里用qq客户端或者无奈必须用IE浏览器,装个虚拟机或者远程登录到另外一台windows机器临时使用都可以,但是像qq这种长期使用的软件如果要不停的切换的远程机器上非常不爽,因为远程桌面大多是全屏的,不全屏也可以啊,窗口里面套窗口更不爽。这时候就可以上无缝窗口了,把远程的软件像本地软件一样显示在本地机器上,就跟在本地运行一样,就方便多了。效果图如右图:Linux的软件和Windows的软件同时供你选择,多么和谐啊。

2.  Theory

    和谐的只是表面现象,他们必须运行在各自的系统上才行(这里自动排除wine的情况...)。 虽然运行在各自的系统上,但是我们可以把它们显示在一起。原理也很简单,对微软的RDP协议来说,必须有服务端(远程机器),客户端(本地机器),服务端负责不停的给客户端发送远程机器的桌面显示(RDP协议传的只有一张图片,就是桌面截图),客户端向服务端发送用户的操作(鼠标、键盘操作什么的)。如果我们能让服务端除了发送整张桌面截图以外,还能把远程机器上所有打开窗口的坐标和位置信息发送过来,客户端再根据这些信息在整张图片上做裁剪就可以了~ 基于RDP的无缝窗口就实现了...

3. Software

 3.1 Windows To Windows

        Martin Wickett 在codeproject 上发布了一个小程序,拓展了windows自带的远程工具, 在windows与windows之间实现了无缝窗口,使用很简单,下载,在要远程的机器上安装server, 在本地安装client,然后和平常一样打开远程连接,配置一下连接选项就可以了使用了。 这个程序没什么实用价值,只是示例,还不能实用化,有源代码,有需要可以继续开发。我觉得Windows和Windows之间使用无缝窗口好像没什么必要,没想到什么应用场景。

        真想在Windows对Windows上使用的,可以使用rdesktop的windows版本,原理同下面要讲的一样,但是移植rdesktop到windows要花费一番功夫,虽然已经有人做过[7],但是他移植的这个版本不包含seamlessrdp 的功能,所以还要自己修改添加。 有需要的可以自己移植看看。

 3.2 Linux To Windows

       Linux下的rdesktop实现了客户端的功能, windows的服务端实在Martin Wickett发布的那个服务上开发而来。rdesktop的seamless实现是由cendio [3] 实现的, 在其主页上有详细的使用说明, 这里就不多讲。

      这个默认的实现每次打开一个远程的程序都会新建一个连接,像Windows Server还没问题,XP的话只能建一个远程连接, 新建一个上一个就自动断开了,很不友好,也很浪费带宽和资源,所以有人给rdesktop打了connection sharing 补丁[4],其主页也有详细的操作说明,虽然是针对是针对老版本的补丁, 经过我的测试再最新版也是能用的,只是打补丁的时候有几个地方要手动调整一下。

      其中由于服务端是windows程序,cendio 又把原始的 visual studio solution 删除了,改用在MinGW交叉编译,但是由于MinGW一个已知的bug [5],无法编译。 我刚开始不知道是MinGW的问题,尝试交叉编译失败后,我又手动给改成了visual studio solution 了... 后来联系了开发作者,他把他们内部fixed的MinGW给了我, 其实只是缺少几个头文件和lib,我也自己尝试过把Windows SDK里面对应的文件直接拷贝到Linux里面,但是Windows SDK里面的头文件很多居然是大写命名的...

      好了,废话不多讲, 如果你想尝试一下的话, 我已经把针对rdesktop最新版进行了升级过的patch,server端的visual studio版本,MinGW缺少的头文件和lib, 还有我预编译过的版本都上传到了我的github,你可以下载下来按照[4]或者README中的步骤进行操作。

 3.3  Linux/Windows To Linux

       因为Xwindow协议的Client/Server模式与Windows不一样,远程Linux机器上的X实际上是客户端,而显示的机器才是服务器,所有X协议原生支持无缝窗口。你要用Windows连接Linux,只需要在Windows上装个X server就行了,这样Linux端的程序就可以直接显示在Windows端,运行在Linux端。Linux连Linux,两边都不需要任何设置。有关Xwindow的简要概述请参考王垠这篇博客------理解 Xwindow,不再赘述。

4. Seamless window in VirtualBox

    我本来是要去研究VirtualBox里面的seamless mode实现, 结果误打误撞碰上了seamlessrdp, 就花时间看了下。有关VirtualBox虚拟机里面的seamless mode模式,等研究懂了改天再写...

 

Reference

[1] Seamless Window 原理 http://blog.csdn.net/generalking/article/details/6163613

[2] Extending Microsoft's Terminal Services Client To Provide Seamless Windows

[3] SeamlessRDP in rdesktop

[4] Rdesktop Seamless Connection Sharing

[5] http://sourceforge.net/tracker/?func=detail&aid=2844209&group_id=2435&atid=102435

[6] 王垠---理解 Xwindow

[7] rdesktop for windows

 

Avatar_small
cleaning services 说:
2019年10月22日 20:50

You are able to clean almost any house within about 4 hours per week. I discovered this after i had my very own residential house-cleaning company. One cause that cleaning other's houses is easier than cleaning your personal, is that you are not active in the mess. There is nothing personal and also you don't obtain distracted as long as you're cleaning.

Avatar_small
www.prhomeschool.com 说:
2020年4月20日 18:14

An excellent place to begin as any first-time home-buyer has been your credit history. If an individual haven't checked out it in the while, order your credit history. By legislation, you are entitled to one free credit file (from all the three credit reporting agencies) each 12 weeks.

Avatar_small
www.mvhomeinspection 说:
2020年4月20日 18:14

Any moisture assessment is greater than looking regarding leaking water lines and drains. Exterior scenarios that can cause moisture attack are seemed for along with proper venting for attics, attic room spaces, crawl places and roofing are considered to be well. Moisture problems in lots of spaces can easily go unseen for decades. This postpone is identification enhances the difficulty as well as the cost inside correcting these kinds of issues.

Avatar_small
www.ukcleaningdirect 说:
2020年4月20日 18:15

Every person can take pleasure in the comfort of your clean and also well stored home. Home cleaning can be a necessity and lots of people can't keep their property cleans due to their frantic schedules. Homes needs to be cleaned regularly for unpleasant scents and vermin infestations being prevented.

Avatar_small
www.mentholatumhome. 说:
2020年4月20日 18:15

When you are looking for the proper home you will probably find yourself having an endless collection of alternatives. House or perhaps condo? Suburban or perhaps city heart? But there is certainly one distinct choice in which bothers plenty of first-time customers. Should I obtain a starter property or even a home to be able to last for years into the future?

Avatar_small
www.isellpittsburghh 说:
2020年4月20日 18:15

The perfect solution is is to spot explanation for your residence sitting in the marketplace for way too long. Is right now there anything wrong with all the home? Can it be something you might have done, or never have done which is affecting your home in the marketplace? You needs to be worrying about how precisely to fix this all and look deeper to master the real basis for the residence sitting in the marketplace for way too long.

Avatar_small
maids in dubai 说:
2020年5月05日 19:33

Maid of recognize wedding speeches can be quite a tricky to have right. Because the maid regarding honor, it's also possible to find almost no time to devote preparing the particular speech amongst all the other wedding treatments. In the conclusion, though, it'll be worth the time and effort, as this is a privilege in order to speak for the bride along with your best good friend.

Avatar_small
painters in Dubai 说:
2020年5月05日 19:33

If getting the house decorated is on your own list of adventures, but you may not feel which you have the time and energy to infants, calling in the professional painter might be a good thought. This form of task will be time-consuming, especially in case you are not knowledgeable at portray. Before you select someone to perform the job for an individual, find out there what you could expect from the most effective companies.

Avatar_small
full time maids in d 说:
2021年6月08日 16:15

Most definitely, when one in every of your members of your family is poorly, you really have to take increased precaution and additionally care at the same time handling all the cleaning mission. Let’s see how to protect your personal property and shut ones from such an infection.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee