zoukankan      html  css  js  c++  java
  • 使用rdesktop远程连接Windows桌面

    之前使用的是KDE下的krdc。该程序的Grab Keys功能存在bug,导致Alt+TAB大多数时候不能被捕捉,从而无法使用键盘切换窗口。不过,其全屏功能是正常的,在多显示器的情况下,全屏只在一个屏幕上有效。最终,还是换回到rdesktop。命令如下:

    rdesktop -a 32 -u user_name  -g 1920x1030 -x 0x80 -r clipboard:PRIMARYCLIPBOARD 192.168.1.102

    其中,各选项含意如下:

    • -a 32:使用32color

    • -u创:指定用户名;

    • -g 1920x1030:指定窗口大小。由于在多显示器情况下,rdesktop在全屏的时候会扩展到两个屏幕上,因此,不能使用-f全屏选项,而只能直接指定窗口大小。原本Home PC主显示器的分辨率为1920x1080,将高度设置为1030是由于底部工具栏的高度。然后,在KDE Special windows settings中将rdesktop的标题栏隐藏,则可以最终实现类似于全屏的效果;

    • -x 0x80:指定user experience level。在rdesktop的源码中有:#define RDP5_ENABLE_FONT_SMOOTHING 0x80。因此,将该值设为0x80,则可以显示出最好的字体效果。(原先设置的为lan,虽然使颜色深度加到了最大值32,但是字体显示没有ClearType效果);

    • -r clipboard:PRIMARYCLIPBOARD:实现本机与远程主机间的剪贴板共享;

    • 最后指定远程主机的IP地址。

    创建了如下的脚本rdcwin,用于连接远程主机:

    #!/bin/bash
    
    if [ -z $1 ]; then
        echo "Default host 192.168.1.102 will be conneted!"
        host=192.168.1.102
    else
        host=$1
    fi
    
    rdesktop -a 32 -u user_name -g 1920x1030 -x 0x80 -r clipboard:PRIMARYCLIPBOARD $host

    更多细节可参考这里:

    rdesktop: Connect to Windows 7 and Vista with ClearType font smoothing enabled

    So Windows Vista finally allows to enable ClearType font smoothing for Remote Desktop / Terminal Services sessions. Update: Windows XP SP3 does too!

    If you try to connect to a machine running Windows XP SP 3 or later using rdesktop, you won’t get smoothed font typing since at the time of this writing rdesktop does not officially offer an option to control this feature. However, here is a workaround:



    rdesktop allows to specify the RDP5 experience via the -x experience switch.

    One can either define one of three default experiences (modem, broadband, lan) or one can specify a raw hex value that is send to the server.



    NOTE: You can skip over this rather technical part, if you’re not interested in the details. You’ll find the workaround below.



    This hex value is actually a combination of defined bit flags. After some tinkering I found that the hex value 0×80 will enable font smoothing for the connection.

    The file constants.h of the rdesktop sources contains these flags:



    #define RDP5_DISABLE_NOTHING 0x00

    #define RDP5_NO_WALLPAPER 0x01

    #define RDP5_NO_FULLWINDOWDRAG 0x02

    #define RDP5_NO_MENUANIMATIONS 0x04

    #define RDP5_NO_THEMING 0x08

    #define RDP5_NO_CURSOR_SHADOW 0x20

    #define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */



    So, naturally an additional flag constant can be defined like this:



    #define RDP5_ENABLE_FONT_SMOOTHING 0x80



    The file rdesktop.c would have to be extended preferably with an additional argument that controls the font smoothing.

    If you want to use font smoothing with rdesktop now you have to combine the flags (bitwise OR, addition will do too) and specify the result via the -x switch.



    Here is the workaround for the three defaults mentioned above:



    rdesktop -x 0x8F mywinserver # equals the modem default + font smoothing

    rdesktop -x 0x81 mywinserver # equals the broadband default + font smoothing

    rdesktop -x 0x80 mywinserver # equals the LAN default + font smoothing

  • 相关阅读:
    【转载】mysql 日志开启
    无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。
    MVC4 本地IIS测试
    新浪网易IP地区信息查询API接口调用方法(转载)
    解决方案看起来是受源代码管理,但无法找到它的绑定信息。保存解决方案的源代码管理设置的 MSSCCPRJ.SCC 文件或其他项可能已被删除。由于无法自动恢复这些缺少的信息,缺少绑定的项目将被视为不受源代码管理。
    SQL语句中order_by_、group_by_、having的用法区别
    项目总结之关于JQuery一些常用的函数
    Log4Net使用指南之用log4net记录日志到数据库(含有自定义属性)------附Demo例子源代码
    HighCharts点击柱形或饼块等加URL或Click事件
    .Net用字符串拼接实现表格数据相同时合并单元格
  • 原文地址:https://www.cnblogs.com/quantumman/p/4573836.html
Copyright © 2011-2022 走看看