Ubuntu設定-3-

coLinux上のUbuntu(coUbuntu)で設定したことのメモ。
coUbuntuのインストールはこちら参照。


Ubuntu設定-1-で,「gdi++.dllを使う」と書きましたが,やめです。
普通に,puttyの設定[Font settings]-[Font quality]で[ClearType]を選択すれば,いい感じのフォントになりました。


Ubuntu設定-2-で,「puttyの設定でTreat CJK ambiguous charactars as wideをチェック」と書きましたが,端末内でemacsを実行してると*1表示が崩れたので,Cygwin-Xを使って,X上でemacsを使うことにしました。


1.xorg,xfsインストール

$ sudo apt-get install xserver-xorg
$ sudo apt-get install emacs22-gtk
$ sudo apt-get install xfs
$ sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable


2.mplus bitmap fontインストール

$ tar zxvf mplus_bitmap_fonts.tar.gz
$ cd mplus_bitmap_fonts/
$ sudo ./install_mplus_fonts

/etc/X11/fs/configを変更

no-listen = tcp

から

#no-listen = tcp

に。

catalogue = /usr/share/fonts/X11/misc/,/usr/share/fonts/X11/cyrillic/,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/

から

catalogue = /usr/share/fonts/X11/misc/,/usr/share/fonts/X11/cyrillic/,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/75dpi/,/usr/X11R6/lib/X11/fonts/mplus

に。
.emacsに以下を追加

(create-fontset-from-fontset-spec
    "-mplus-*-mplus-r-normal--10-*-*-*-*-*-fontset-mplus_10r,
    ascii:-mplus-gothic-medium-r-normal--10-*-iso8859-1,
    japanese-jisx0208:-mplus-gothic-medium-r-normal--10-*-jisx0208.1990-0,
    katakana-jisx0201:-mplus-gothic-medium-r-normal--10-*-jisx0201.1976-0")
(create-fontset-from-fontset-spec
    "-mplus-*-mplus-r-normal--12-*-*-*-*-*-fontset-mplus_10b,
    ascii:-mplus-gothic-bold-r-normal--10-*-iso8859-1,
    japanese-jisx0208:-mplus-gothic-bold-r-normal--10-*-jisx0208.1990-0,
    katakana-jisx0201:-mplus-gothic-bold-r-normal--10-*-jisx0201.1976-0")
(create-fontset-from-fontset-spec
    "-mplus-*-mplus-r-normal--12-*-*-*-*-*-fontset-mplus_12r,
    ascii:-mplus-gothic-medium-r-normal--12-*-iso8859-1,
    japanese-jisx0208:-mplus-gothic-medium-r-normal--12-*-jisx0208.1990-0,
    katakana-jisx0201:-mplus-gothic-medium-r-normal--12-*-jisx0201.1976-0")
(create-fontset-from-fontset-spec
    "-mplus-*-mplus-r-normal--12-*-*-*-*-*-fontset-mplus_12b,
    ascii:-mplus-gothic-bold-r-normal--12-*-iso8859-1,
    japanese-jisx0208:-mplus-gothic-bold-r-normal--12-*-jisx0208.1990-0,
    katakana-jisx0201:-mplus-gothic-bold-r-normal--12-*-jisx0201.1976-0")
(set-default-font "fontset-mplus_12r")

3.Cygwyn-Xのstartxwin.batを編集

REM %RUN% XWin -multiwindow -clipboard -silent-dup-error
%RUN% XWin -multiwindow -clipboard -fp tcp/192.168.100.100:7100

もともとあったのをコメントアウトしてcoUbuntuのフォントサーバを使う指定を追加。


4.Cygwyn-Xのstartxwin.batを実行して勝手にemacsを立ち上げる準備
4-1.coUbuntuとCygwin間でsshの鍵を登録する。
Ubuntuで,

$ ssh-keygen -t rsa
$ cd ~/.ssh
$ cat id_rsa.pub >> authorized_keys
$ chmod 600 authorized_keys

パスフレーズは何も入力せずにEnter。
Cygwinで,/home/hogeがあるか確認しておく。
僕の場合は,

$ cd ~; pwd
/cygdrive/c/home

だったので,/cygdrive/c/homeのシンボリックリンクを/home/hogeに作っておく。*2

$ mkdir /home
$ cd /home/
$ ln -s /cygdrive/c/home hoge
$ cd
$ mkdir .ssh
$ cd .ssh

Ubuntuの~/.ssh/id_rsaCygwinに持ってくる。

$ scp hoge@192.168.100.100:~/.ssh/id_rsa .

鍵を登録する

$ eval `ssh-agent`
$ ssh-add id_rsa
$ eval `ssh-agent -k`

sshでパスワードなしでログインできることを確認する。

$ ssh hoge@192.168.100.100

4-2.startxwin.batにemacsを起動するコマンドを書く
startxwin.batのxterm起動が書いてあったところを変更。

run xterm -e /usr/bin/ssh -Y -f 192.168.100.100 "emacs &"

こんな感じに。
f:id:kshimo69:20071110231511p:image

*1:emacs -nw

*2:sshしたときに,/home/hoge/.ssh/known_hostsに書けませんとか言われるので