VMwareにおけるシリアルポート設定
はじめに(要件)
ホストとVM間を仮想シリアル経由で通信(送受信)したい.
設定方法
1. Virtual Machine SettingsでSerial Portを作成し,以下のように設定する.
図. Virtual Machine Settings
ポイント
- Use named pipeの2番目:"The end is the server"に設定
- Use named pipeの3番目:"The other end is an application" or "The other end is a virtual machine"どちらでも動作した
2. VMをPower ONし,ゲストOSを起動する.
3. VMが立ち上がったら,ホストOS上でsocatを用いて/tmp/vmsockにアクセスする.これで仮想シリアル通信ができる.
$ socat /tmp/vmsock stdout
ちなみに,/tmp/vmsockはUnixドメインソケット.
また,socatはhttp://dag.wieers.com/rpm/packages/socat/からDL.
まとめ
ホストとVM間を仮想シリアル経由で通信(送受信)するためには,VMwareのシリアルデバイスをnamed pipe(実際はUnixドメインソケット)を利用するように設定し,Unixドメインソケットファイルをsocat等でアクセスすればよい.
その他1
ゲスト(カーネル,ドライバ等)のログ採取のためだけなら,仮想シリアル出力をホスト上のファイル出力(Use output file)と設定すれば十分でしょう.(これまでそうしてた)
VM0-VM1間で仮想シリアル経由で通信(送受信)する場合.
その他2
VM0-VM1間で仮想シリアル経由で通信(送受信)する場合,
以下のように設定すればよい.
VM0
- Use named pipe
- /tmp/vmsock
- This end is the server
- The other end is a virtual machine
VM1
- Use named pipe
- /tmp/vmsock
- This end is the client
- The other end is a virtual machine