VMWare 伺服器

維持 VMware 客端操作系統內的時間

一個已知的問題與內核計時器所設定的頻律有關。2.6 版本的內核每秒發出 1000 個時鐘的中斷要求,令虛擬機器難以跟上(詳情見這個錯誤報告)。為了補救這個問題,CentOS 過往提供時鐘速率設定為 100 赫的內核。

CentOS 亦提供預先建立及更新了的 vmware 映像。詳情見這個 CentOS 錯誤報告及在CentOS 開發者網站下載 vmware 映像。

由 CentOS 5.2 開始,內核提供了一個名叫 "divider=" 的新參數。你可以在內核參數中加入 divider=10 來將計時器的頻律設為 10 赫。很不幸地,在多數情況下這樣做仍不足以保持客端的時間準確。截至本文的寫作時,VMware 知識庫內的這篇文章提供了維持系統時間的最佳方法:

http://kb.vmware.com/kb/1006427

下面是對應 CentOS 而改動了的扼要指引:

(加在檔案的頂部)
# modification as per http://kb.vmware.com/kb/1006427
# The configuration directive tinker panic 0 instructs NTP not to give up
# if it sees a large jump in time and must be at the top of the ntp.conf file.
tinker panic 0
# end of mod

(將兩行變為註釋,如下)
(comment out 2 lines as below)
# modification as per http://kb.vmware.com/kb/1006427
# It is also important not to use the local clock as a time source,
# often referred to as the Undisciplined Local Clock. NTP has a
# tendency to fall back to this in preference to the remote servers
# The following 2 lines commented out.

# when there is a large amount of time drift.
# server        127.127.1.0     # local clock
# fudge 127.127.1.0 stratum 10

0.centos.pool.ntp.org
1.centos.pool.ntp.org

{i} VMware Tools 的 rpm 套件可以從 http://people.centos.org/hughesjr/open-vm-tools/ 取得

更改客端虛擬機器的網絡接橋,使它能運用主機的無線連線

你可以輕易地將 eth0 改為另一個位址,好讓你不必在無線連線上採用網路位址轉譯。首要是停止 vmware 服務,但請先確保所有客端虛擬機器都不在運行。

# service vmware stop 

接著,編輯 vmware 設定檔並將所有 eth0 字串改為你的無線連線。以我為例,這是 eth1。

# vim /etc/vmware/locations 
answer VNET_0_INTERFACE eth1
answer VNET_0_INTERFACE eth1

儲存並離開這個檔案。現在重新啟動 vmware 服務。

# service vmware start 

現在你應該可以輕鬆地將虛擬機器接橋至主機中。你不必為了在客端操作系統安裝無線驅動程式而操心,因為它是透過 VMware 的虛擬網絡介面而接橋的。

Translation of revision 22

zh-tw/TipsAndTricks/VMWare Server (last edited 2009-09-07 07:58:37 by TimothyLee)