使用rdesktop遠端連線Windows案頭

來源:互聯網
上載者:User

標籤:

之前使用的是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:使用32位color;

  • -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 -rclipboard:PRIMARYCLIPBOARD $host

更多細節可參考這裡:

rdesktop: Connect to Windows 7 and Vista with ClearType fontsmoothing enabled

So Windows Vista finally allows to enableClearType font smoothing for Remote Desktop / Terminal Servicessessions. Update: Windows XP SP3 does too!

If you try to connect to a machinerunning Windows XP SP 3 or later using rdesktop, you won’t getsmoothed font typing since at the time of this writing rdesktop doesnot officially offer an option to control this feature. However, hereis a workaround:



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

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



NOTE: You can skip over this rathertechnical part, if you’re not interested in the details. You’llfind the workaround below.



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

The file constants.h of the rdesktopsources 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 constantcan be defined like this:



#define RDP5_ENABLE_FONT_SMOOTHING0x80



The file rdesktop.c would have to beextended preferably with an additional argument that controls thefont smoothing.

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



Here is the workaround for the threedefaults mentioned above:



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

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

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

使用rdesktop遠端連線Windows案頭

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.