0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MacからUbuntuへのRemote login

Last updated at Posted at 2025-05-24

自宅用サーバーとしてUbuntuのPCを作ってヘッドレス(ディスプレイ無し)で運用しようとしたところ、RDP接続で沼ったので書き留めておく。

サーバー:Ubuntu 24.04 LTS
クライアント:MacBookAir Apple M1 macOS Sequoia ver15.3.1
RDP接続ソフト:Microsoft remote-desktop

1. 沼った経緯

Ubuntu自体は認識しているが、そもそも接続できなかったり、接続するがログイン画面が現れずに真っ黒な画面が表示されるといった症状が出ていた。そこで 「Mac Ubuntu Remote desktop black screen」 などと打ち込んで調べたところ、様々な解決策が出てくる。

・ユーザーアカウント設定やログイン状況で整理したもの
・xrdpに回帰するもの
・vncを用いたもの
・仮想ディスプレイを設定するもの

一つずつ試したが、結果的に私の実力と環境では解決できず、最終的に起動しなくなった。。。(おそらく仮想ディスプレイ周りをいじった結果だと思う)

最終的にもっとシンプルな解決策が見つかった。以下、2ステップで解決。

2. Ubuntu側の設定

まずUbuntuにはRemote desktopとRemote loginという2つの設定が存在しており、これを理解する必要があった。以下のサイトを見つけてやっと理解できた。

Remote desktop: ディスプレイにつながった状態でログインしている端末の画面とコントロールを得るもの
Remote login:ログイン画面から始まるもの。(windowsのリモートデスクトップに近い)

私がしたかったのはヘッドレス運用なので、Remote loginとなる。

この辺理解せずに全部ONにして闇雲にやると、どっちの機能にアクセスしているかによって挙動が変わったりするのだろう。

引用サイトのRemote loginの説明に従って設定。Remote desktopはOFFにした。

3. Windows Remote Desktopアプリの設定変更

Ubuntu側の設定を行っても、真っ黒な画面が表示されてログインできない症状は解決しなかった。散々ググった結果、以下QAを見つけて解決した!

神様!

In the new Microsoft RDP Client (now called Windows App), you need to change the settings in the RDP file.

  • Find the line that says: use redirection server name:i:0
  • Change it to: use redirection server name:i:1

If you can't find the RDP file, you can create a new one:

  1. Right-click on your current connection.
  2. Select "Export" to save the file.
  3. Open the saved file and make the changes mentioned above.
  4. Import the edited file as a new connection.

ググって出てくる大半の解決策はgnomeの不安定さを懸念してgnome以外に引っ越すものだったが、私の環境ではクライアント側に問題があったことになる。

反省

ちゃんと機能を理解すること、問題の切り分けを行うこと、を心がけたい。

(GUIが無いと不安だという)誰かのお役に立てば幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?