相信有不少在linux下玩vmware的朋友遇到了,安装的linux系统时间过慢的问题吧,我在虚拟机下安装的是ubuntu 运行了几天发现时间居然慢了那么多,第一想到的是用ntpdate每5分钟更新一次时间,后来想想,应该vmware有解决问题的办法吧,然后就去他官方晃荡了一下,最终还是找到了解决办法呵呵,
这个问题是因为lin不能完全支持自动变频的电源管理特性下面说说我的做法。
原文:
如果你是在windows上装的vmware 则在
C:\Documents and Settings\All Users\Application Data\VMware\VMware Workstation\config.ini for VMware Workstation
or
C:\Documents and Settings\All Users\Application Data\VMware\VMware GSX Server\config.ini for GSX Server.
编辑此文件夹下的config.ini如果文件不存在,新建一个config.ini并且编辑或添加
host.cpukHz = 7549747 //双核CPU一定要用单核CPU主频*2 1.8*2048*2048host.noTSC = TRUE
ptsc.noTSC = TRUE
processor0.use = "FALSE"
processor1.use = "TRUE"
如果你是在linux上装的vmware 我装在了ubuntu上 则修改 /etc/vmware/config
host.cpukHz = 7549747 //双核CPU一定要用单核CPU主频*2 1.8*2048*2048
host.noTSC = TRUE
ptsc.noTSC = TRUE
processor0.use = "FALSE"
processor1.use = "TRUE"然后在在 你安装的虚拟机上安装 vmware-tools 安装方法网上有很多教程,我只讲一下ubuntu的安装放法吧。
1.安装编译环境:
apt-get install build-essential linux-headers-`uname
-r`
2.在VMware的菜单中,点击VM->Install VMware Tools,你将看到有光盘被加载。
mount /dev/cdrom /mnt
cd /mnt
cp VMwareTools-1.0.4-56528.tar.gz /home
cd /home
tar zxvf VMwareTools-1.0.4-56528.tar.gz
./vmware-install.pl
一路回车就可以了,然后关闭这太虚拟机,
在 安装 vmware 主机上 找到 /opt/vmware/nagios/Ubuntu.vmx
最后边可以看到:
#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "4"
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
memsize = "256"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "Ubuntu.vmdk"
ide1:0.present = "TRUE"
ide1:0.fileName = "/home/ludy/ubuntu-7.10-server-i386.iso"
ide1:0.deviceType = "cdrom-image"
floppy0.fileName = "/dev/fd0"
Ethernet0.present = "TRUE"
displayName = "nagios"
guestOS = "ubuntu"
priority.grabbed = "normal"
priority.ungrabbed = "normal"
ide1:0.autodetect = "TRUE"
floppy0.present = "FALSE"
scsi0:0.redo = ""
ide1:0.startConnected = "TRUE"
ethernet0.addressType = "generated"
uuid.location = "56 4d 5e 6d 2a 38 7c 0b-60 91 34 5d 42 c4 dd 36"
uuid.bios = "56 4d 5e 6d 2a 38 7c 0b-60 91 34 5d 42 c4 dd 36"
ethernet0.generatedAddress = "00:0c:29:c4:dd:36"
ethernet0.generatedAddressOffset = "0"
tools.syncTime = "TRUE" (安装完vmware-tools默认是 FALSE 改为TRUE)保存退出,windows可以用记事本打开修改,然后启动虚拟机,时间就会效对了!