@itagagaki (板垣 史彦)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

WSL2 Ubuntu にホストWindowsからRDP接続したい

解決したいこと

質問 Windows 11 WSL2 (Ubuntu) のIPアドレスとxrdp の続きです。

Winows 11 Pro 25H2 で WSL2 を有効化して Ubuntu 24.04.3 LTS (Noble Numbat) をインストールし、ネットワークモードは Nat で稼働させています。そこまでの経緯は上記の質問にあります。

WSL Settings のネットワークモードが Nat なので、Ubuntu ではホストの Windows と異なる IPv4 アドレスとなっています。そこで、この Ubuntu で xrdp を動かし、ホストの Windows のリモートデスクトップ接続 (mstsc.exe) で、Ubuntu の IPv4 アドレスを指定して接続してみたい。

xrdp を稼働させるまでの手順は下記のように行いました。

sudo apt update
sudo apt upgrade
sudo apt install ubuntu-desktop
sudo apt install xrdp
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp

RDP接続は下記の手順で試しました。

  1. Ubuntu からログアウト
  2. Windows で リモートデスクトップ接続 を実行

発生している問題・エラー

リモートデスクトップ接続 を実行して Ubuntu の IPv4 アドレスを入力すると、ウィンドウが開いてログイン画面は出るのですが、数秒後にウィンドウが勝手に閉じてしまい、ログインが不可能です。

そこで Ubuntu にコンソールでログインして、ログを見てみました。

/var/log/xrdp.log
[20251227-20:39:43] [INFO ] address [0.0.0.0] port [3389] mode 1
[20251227-20:39:43] [INFO ] listening to port 3389 on 0.0.0.0
[20251227-20:39:43] [INFO ] xrdp_listen_pp done
[20251227-20:39:45] [INFO ] starting xrdp with pid 26744
[20251227-20:39:45] [INFO ] address [0.0.0.0] port [3389] mode 1
[20251227-20:39:45] [INFO ] listening to port 3389 on 0.0.0.0
[20251227-20:39:45] [INFO ] xrdp_listen_pp done
[20251227-20:40:09] [INFO ] Received termination signal, stopping the server accept new connections thread
[20251227-20:40:09] [INFO ] address [0.0.0.0] port [3389] mode 1
[20251227-20:40:09] [INFO ] listening to port 3389 on 0.0.0.0
[20251227-20:40:09] [INFO ] xrdp_listen_pp done
[20251227-20:40:11] [INFO ] starting xrdp with pid 26830
[20251227-20:40:11] [INFO ] address [0.0.0.0] port [3389] mode 1
[20251227-20:40:11] [INFO ] listening to port 3389 on 0.0.0.0
[20251227-20:40:11] [INFO ] xrdp_listen_pp done
[20251227-20:40:46] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:172.28.192.1 port 54359
[20251227-20:40:46] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20251227-20:40:46] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20251227-20:40:46] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[20251227-20:40:46] [ERROR] SSL_read: I/O error
[20251227-20:40:46] [ERROR] libxrdp_force_read: header read error
[20251227-20:40:46] [ERROR] Processing [ITU-T T.125] Connect-Initial failed
[20251227-20:40:46] [ERROR] [MCS Connection Sequence] receive connection request failed
[20251227-20:40:46] [ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
[20251227-20:40:46] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
[20251227-20:40:46] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
[20251227-20:40:46] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20251227-20:40:46] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20251227-20:40:48] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:172.28.192.1 port 54361
[20251227-20:40:48] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20251227-20:40:48] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20251227-20:40:48] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[20251227-20:40:48] [INFO ] Connected client computer name: BLUE
[20251227-20:40:48] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
[20251227-20:40:48] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
[20251227-20:40:48] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0xE0010411]
[20251227-20:40:48] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [jp] options []
[20251227-20:40:48] [INFO ] TLS connection established from ::ffff:172.28.192.1 port 54361: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384
[20251227-20:40:48] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20251227-20:40:48] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 7864320 MB cache entries 100
[20251227-20:40:48] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[20251227-20:40:48] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[20251227-20:40:48] [WARN ] Cannot find keymap file /etc/xrdp/km-e0010411.ini
[20251227-20:40:48] [INFO ] Loading keymap file /etc/xrdp/km-00000411.ini
[20251227-20:40:48] [WARN ] local keymap file for 0xe0010411 found and doesn't match built in keymap, using local keymap file
[20251227-20:40:51] [INFO ] Received termination signal, stopping the server accept new connections thread
[20251227-20:41:12] [INFO ] address [0.0.0.0] port [3389] mode 1
[20251227-20:41:12] [INFO ] listening to port 3389 on 0.0.0.0
[20251227-20:41:12] [INFO ] xrdp_listen_pp done
[20251227-20:41:14] [INFO ] starting xrdp with pid 544
[20251227-20:41:14] [INFO ] address [0.0.0.0] port [3389] mode 1
[20251227-20:41:14] [INFO ] listening to port 3389 on 0.0.0.0
[20251227-20:41:14] [INFO ] xrdp_listen_pp done

[ERROR] がありますね。
いろいろ検索して調べましたが、まだどのエラーも原因がつかめません。
何か情報がありましたらご教授いただければ幸いです。

0 likes

No Answers yet.

Your answer might help someone💌