Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of inaccurate clock in CentOS system under VMware

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to solve the problem of clock inaccuracy in CentOS system under VMware". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

In the VMware virtual machine of CentOS system, because the time is out of sync with the real-time clock, there are many problems in the development, such as Makefile files will cause some unnecessary repeated compilation, and even some programs refuse to compile. I try to run ntpd to synchronize the clock, but often because the error is too large, I refuse to synchronize. Of course, you can also use ntpdate to regularly access an external server to synchronize, but it always feels awkward. Is there a better way? Later, I learned that you need to install vmware-tools on the CentOS system. The steps to install it on the CentOS system are as follows:

1. Install vmware-tools on CentOS system

1. In the VMware window menu, VM-> setting, select CD-ROM image iso to point to

C:\ Program Files\ VMware\ VMware Workstation\ linux.iso

two。 In the linux terminal, execute the following command:

[root] # cd / media [root] # mount cdrom mount: block device / dev/hdc is write-protected, mounting read-only [root] # cd cdrom [root] # ls [root] # rpm-ivh VMwareTools-5.5.1-19175.i386.rpm

I generally like to use rpm installation, the advantage is that it is very convenient to uninstall the program. It is also easy to view the details of the installation.

Then run / usr/bin/vmware-config-tools.pl and note that the command cannot be run on a remote terminal.

Next it's time to run vmware-toolbox for configuration. But the program needs a xwin environment, so it can't be run yet.

2. Install Xming xserver for windows in windowsxp / CentOS system

Many friends are concerned about this step, just like everyone else, because linux runs in server mode and generally does not install xwindows components.

The solution is to install xserver on your own work machine.

Xming is an open source xserver that is easy to use and can be downloaded from http://sourceforge.net/projects/xming

If you just need to run a simple program like vmware-toolbox remotely, you only need to download and install Xming-6-9-0-21-setup.exe. Other fonts and client are not necessary.

The installation of Xming is very simple. When running for the first time, pay attention to using XLaunch to configure the parameters of xserver, especially to check No Access Control, otherwise remote customers cannot connect to xserver.

Running vmware-toolbox in CentOS system

Set up export DISPLAY=192.168.1.100:0 in the linux terminal, where 192.168.1.100 is my xserver address, that is, my windowsxp worker address.

[root] # export DISPLAY=192.168.1.100:0

[root] # vmware-toolbox &

Ok. If all goes well, the vmware-toolbox window will pop up on the work machine, isn't it cool, ^ _ ^

Pay attention to check Time synchrononiation between the virtual machine and the host operating system in option. That's it.

4. Set grub startup parameters in CentOS system

At the end of the kernel line of the grub startup configuration, add clock=pit. The example is as follows

[root@mail grub] # cat / boot/grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a / boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,0) # kernel / boot/vmlinuz-version ro root=/dev/sda1 # initrd / boot/initrd-version.img # boot=/dev/sda default=0 timeout=5 splashimage= (hd0,0) / boot/grub/splash.xpm.gz hiddenmenu title CentOS_ServerCD (2.6.9-42.EL) root (hd0,0) kernel / boot/vmlinuz-2.6.9-42.EL ro root=LABEL=/ clock=pit Initrd / boot/initrd-2.6.9-42.EL.img

If guest OS cannot install vmware tools, or if vmware guest OS is SuSE SLES9 performance time is too fast, use clock=pmtmr instead. If the virtual cpu guest OS is a single nosmp noapic nolapic, add these three parameters to the kernel parameter of grub *. The problem of time inaccuracy in the CentOS system is thus solved.

This is the end of the content of "how to solve the problem of clock inaccuracy in CentOS system under VMware". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report