PR

Ubuntu 10.04 に Windows から FreeNX で接続する

Xvnc (Ubuntu / CentOS)やXming を見てきたが、ここにきてFreeNX というものがあるのを知った。あとついでにWAN からXming が使えなかったので他の方法を探しだしたというのもあるが(LAN 内は使えるしポートも開放しているのにnmap でClose になってたり)。

FreeNXの特徴はこんな感じです。

  • NXという商用製品をフリーで再実装したものがFreeNX。
  • 元が商用なので使い勝手がよい。
  •  画面描画情報を圧縮して送信するので、狭い帯域や描画能力の低いサーバでも軽快に使える。
  • クライアントはフリー。Windows用、Mac用、Linux用などが用意されている
  • サーバはフリー版と商用版がある。フリー版では同時接続数が2アカウントまでに制限されている。同時に3アカウント以上使用したいなら商用版を購入する必要あり。(「Linuxをリモート操作。VNC、FreeNX、xmingの3種を比較する – Hinemosu」より引用)

スポンサードリンク

環境構築

Ubuntu Server 10.04 LTS をVMware Player の簡易インストール機能を用いて構築した。

sudo loadkeys jp
sudo apt-get upodate
sudo apt-get upgrade -y
sudo apt-get install ssh
#sudo apt-get install vim
sudo apt-get install gdm
#sudo apt-get install xinetd

FreeNX インストール

リポジトリ追加

$ sudo aptitude install python-software-properties
$ sudo add-apt-repository ppa:freenx-team
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv F3A662B57D580D3A2E98E5152A8E3034D018A4CE
gpg: requesting key D018A4CE from hkp server keyserver.ubuntu.com
gpg: key D018A4CE: public key "Launchpad PPA for FreeNX Team" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

インストール

$ sudo apt-get update
$ sudo apt-get install freenx

セットアップ

$ wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz
$ tar -xvf nxsetup.tar.gz
$ sudo cp nxsetup /usr/lib/nx/nxsetup
$ sudo /usr/lib/nx/nxsetup --install
------> It is recommended that you use the NoMachine key for
        easier setup. If you answer "y", FreeNX creates a custom
        KeyPair and expects you to setup your clients manually.
        "N" is default and uses the NoMachine key for installation.

 Do you want to use your own custom KeyPair? [y/N]
Setting up /etc/nxserver ...done
Generating public/private dsa key pair.
Your identification has been saved in /etc/nxserver/users.id_dsa.
Your public key has been saved in /etc/nxserver/users.id_dsa.pub.
The key fingerprint is:
63:2a:62:28:c4:1b:3d:b7:b8:37:00:74:6d:2f:bb:b2 root@ubuntu
The key's randomart image is:
+--[ DSA 1024]----+
|    .            |
| . . o           |
|. . . .          |
|...  . .         |
| +.o .o S        |
|..o.+..o .       |
|o.o.o.o          |
|.. o.=           |
|   E+ .          |
+-----------------+
Setting up /var/lib/nxserver/db ...done
Setting up /var/log/nxserver.log ...done
Adding user "nx" to group "utmp" ...done
Setting up known_hosts and authorized_keys2 ...done
Setting up permissions ...done
Setting up cups nxipp backend ...cp: `/usr/lib/cups/backend/ipp' and `/usr/lib/cups/backend/ipp' are the same file

Windows セットアップ

「NoMachine NX – Download the NX Terminal Server and Remote Access Software」からダウンロードしてインストール。なんともあっさり繋がってしまったので割愛。

参考:

接続

エラー(接続エラーではなくてUbuntu のデスクトップとしてのエラー)がでるが、直し方は「Ubuntu 10.04 に Windows から Xming で接続」した時と同じ。

The panel encountered a problem while loading “OAFIID:GNOME_FastUserSwitchApplet”.
Do you want to delete the applet from your configuration?

切断

デスクトップからログアウトするか、NX Client を閉じようとすると上図の選択画面が表示される。どうやらDisconnect すると切断のみで、End ではセッションクローズとなるようだ。

そのほか

鍵生成

$ sudo /usr/lib/nx/nxkeygen
Unique key generated; your users must install

    /var/lib/nxserver/home/.ssh/client.id_dsa.key

on their computers.

画面が真っ黒

問題なく接続できるが、画面が真っ黒。SSH 接続すると次のエラーが表示される:

/usr/bin/xauth: error in locking authority file /home/{USER}/.Xauthority

次のコマンドだけではダメらしい:

$ rm -rf .Xauthority

こちらもやっておくようだ:

rm -rf .Xauthority-*

改めてSSH 接続すると以下のエラーが表示されるが、勝手に作ってくれるから気にしない:

/usr/bin/xauth:  file /home/{USER}/.Xauthority does not exist

※所有権がユーザーではなくroot になっている場合もあるらしい

11.10

11.10 ではちょっと様子が違うようで、以下を参考にしたところ、インストールできた。

wget http://de.archive.ubuntu.com/ubuntu/pool/main/e/esound/esound-common_0.2.41-8_all.deb
wget http://de.archive.ubuntu.com/ubuntu/pool/main/e/esound/libesd0_0.2.41-8_i386.deb
wget http://de.archive.ubuntu.com/ubuntu/pool/main/e/esound/esound-clients_0.2.41-8_i386.deb
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:freenx-team
sudo sed -i 's/oneiric/lucid/g' /etc/apt/sources.list.d/freenx-team-ppa-oneiric.list
sudo apt-get update && sudo apt-get upgrade
sudo dpkg -i esound-common_0.2.41-8_all.deb
sudo dpkg -i libesd0_0.2.41-8_i386.deb
sudo dpkg -i esound-clients_0.2.41-8_i386.deb
sudo apt-get install freenx

(「Ubuntu 11.10へFreeNXインストール」より引用)

とりあえず使えれば良いと思っているので、画像のようになっていても気にしない。気になるなら

$ sudo apt-get install gnome

などとする。

それから、場合によっては gnome-session ubuntu-2d とする必要があるかもとも記述されていた。

その他の接続

これはKDEを選択した時のもの(うろ覚え)。

参考文献

コメント