vmware 4.5.2 下測試 linux console 重定向到串口的功能

發表于:2007-05-26來源:作者:點擊數: 標簽:
今天作的有意義的一件事就是測試了在 vmware 4.5.2 下測試 linux console 重定向到串口的功能 測試環境: Host OS: SUSE Pro 9.3 vmware: 4.5.2 for linux (any-any-update89) Virtual OS: SLES9 兩臺 (SLES9serv1, SLES9serv2) 關鍵詞: Linux, console, seri
今天作的有意義的一件事就是測試了在 vmware 4.5.2 下測試 linux console 重定向到串口的功能

測試環境:
Host OS: SUSE Pro 9.3
vmware: 4.5.2 for linux (any-any-update89)
Virtual OS: SLES9 兩臺 (SLES9serv1, SLES9serv2)

關鍵詞:
Linux, console, serial, vmware, console loglevel

Linux 的系統的 console 可以重定向到串口,系統的 console 消息可以通過終端軟件記錄下來,對分析系統的故障
很有幫助。 由于沒有串口線,所以只好借助 vmware 來測試這個功能了。

vmware 4.5.2 支持將串口創建為命名管道(在 linux 下實際是socket)
具體的做法如 vmware 文檔 file:///usr/lib/vmware/help-manual/devices_serial_ws.htm 所介紹的方法

In the server virtual machine

  1. Open the virtual machine settings editor (VM > Settings).
  2. Click Add to start the Add Hardware Wizard.
  3. Select Serial Port, then click Next.
  4. Select Output to named pipe, then click Next.
  5. In the Path field, enter /tmp/ or another Unix socket name of your choice.
  6. Select This end is the server.
  7. Select The other end is a virtual machine.
  8. By default, the device status setting is Connect at power on. You may deselect this setting if you wish.

In the client virtual machine

  1. Open the virtual machine settings editor (VM > Settings).
  2. Click Add to start the Add Hardware Wizard.
  3. Select Serial Port, then click Next.
  4. Select Output to named pipe, then click Next.
  5. In the Path field, enter /tmp/ or another Unix socket name of your choice. The pipe name must be the same on both server and client.
  6. Select This end is the client.
  7. Select The other end is a virtual machine.
  8. By default, the device status setting is Connect at power on. You may deselect this setting if you wish.

別忘了保存相應的配置。:-)

啟動虛擬機之后,VM SLES9serv1 作為串口使用中的服務器端,它的終端會重定向到串口
1) 在 VM SLES9serv1 的 /boot/grub/menu.lst 文件 kernel 對應的行上添加 console=ttyS0,9600 console=tty0,要令它生效需要重啟系統。

2) 如果希望在另外一臺 VM SLES9serv2 上登錄這臺 VM SLES9serv1,
在 VM SLES9serv1 的 /etc/inittab 中添加行:

S0:2345:respawn:/sbin/agetty -L 9600 ttyS0 vt102

然后運行命令: # init q

3)在 VM SLES9serv2 上配置 minicom 設置串口為 /dev/ttyS0 參數為 9600 8N1
然后連接上去,應該一切ok了

4) 如果希望把盡可能多的消息通過串口發送出去,需要調整 VM SLES9serv1 的 console loglevel
# echo 8 > /proc/sys/kernel/printk

5) 在 VM SLES9serv1 上插入會產生 kernel msg 的內核模塊,測試內核消息發送是否正常


參見:
1. /usr/src/linux/Documentation/serial-console.txt
2. /usr/src/linux/Documentation/sysctl/kernel.txt
3. vmware/help-manual/devices_serial_ws.htm
4. man 1 minicom
5. man 8 init


原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97