VM上のPostgreSQLにホストから接続

環境

Ubuntu
10.04 LTS
PostgreSQL
8.4
クライアント
Windows 7 pgAdminⅢ 1.12.3

設定手順

/etc/postgresql/8.4/main/postgresql.conf 編集

59行目あたり

listen_addresses = '*'

コメントアウトを解除して、* に変更。

/etc/postgresql/8.4/main/pg_hba.conf 編集

86行目あたり

host    all         all         192.168.198.0/24      trust

を追加。
※Windows側のコマンドプロンプトでipconfig /all の結果から、

イーサネット アダプター VMware Network Adapter VMnet8:
〜省略〜
IPv4 アドレス . . . . . . . . . . : 192.168.198.1(優先)

の結果から。

PostgreSQL再起動
$ sudo /etc/init.d/postgresql-8.4 restart

参考URL