JP Vossen on 8 Dec 2009 23:14:27 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Virtual Setup Suggestions Wanted- resources used for centOS and vmware server


> Ron Kaye Jr wrote:
>> default packages installed, or have you determined what is not needed 
>> for a most basic centOS insneed
>> after installing vmware server, what resources have been consumed 
>> (storage, memory, etc)

Disk and RAM needed are determined by  what OS's you want to run and 
what you want to do with them.  I am able to run 2-3 VMs under VMware 
Workstation 5.5 on top of a GUI Ubuntu Hardy install with 2G RAM and 
500G disk, but the VMs are mostly 256-512M RAM Linux, Solaris or BSD 
with no GUI.  I do have some Windows VMs and they are fine too, but I 
can't run too much on that machine at once.  I also recently upgraded 
the machine to 8G RAM because it was dirt cheap.  This is for 
dev/testing/playing only, not production.

The machine I just set up is using about 1.2G for just the minimal OS, 
and VMware Server 1.x, installed as follows.  It's also using about 512M 
RAM at idle.  Compare that with a basic Debian Lenny install + Apache, 
BackupPC, Samba and some other stuff (not VMware) at 693M of disk (RAM 
comparison is not applicable).

This is expanded from similar message I sent the other day...

For work, I just installed a *minimal* CentOS-5.4 system and VMware 
Server 1.0.10 on an 8G/1.2T server that will be both production and 
testing (inside a VM that will only run for tests).  There are a few tricks.

First, Red Hat removed the "minimal" install option, starting with RHEL5 
IIRC.  It really sucked anyway, installing far too much cruft.  So the 
new way is:
	At the end of the installer, for package selection:
                 Uncheck "Desktop - Gnome"
                 Select "Customize now" radio button
                 > On the customize screen, uncheck EVERYTHING
			(including "Base System: Base")
                 Install & reboot

That still installed something like 187 packages, but that's way better 
than a "stock" install.  At that point is just wasn't worth my time to 
try and trim it any more.  Interestingly, man, Perl, NTP and an MTA are 
some of the packages not installed.  (Contrast this to a really minimal 
Debian install, which doesn't even include SSH.  THAT's minimal!)

Next, I install some stuff I just plain want (YMMV):
# yum install man mlocate ntsysv ntp perl screen vim-enhanced wget

You probably want Postfix or some MTA so cron, etc. can send email. 
Nullmailer isn't in the repos, but I did find it at a third-party site. 
  I forget where, Google for it.  Postfix is probably easier though.

If using Postfix you'll want to edit /etc/postfix/main.cf and tweak at 
least the following:
	myhostname =
	mydomain =
	myorigin =
and maybe:
	inet_interfaces = localhost
	relayhost =

# yum upgrade
and reboot.


The next trick is installing VMware Server 1.x.  (I hate the web-GUI for 
2.x and have never gotten it to work right anyway.)  For this minimal 
install, you'll probably need to install some extra packages or you'll 
get a bunch of "The correct version of one or more libraries needed to 
run VMware Server may be missing" errors.  Basically, the RPM is 
*broken* and doesn't list all the correct deps.

Running vmware-config.pl and getting it to compile various modules is a 
giant PITA and you have to do it every time you install a new kernel. 
Also, a lot of the time something breaks and you have to go figure out 
what.  That sucks, and is a big argument toward using something better 
supported, like VirtualBox, KVM, etc.  :-(

# yum install gcc kernel-PAE-devel make xinetd libICE libSM libXt libXtst

### Might also possibly need: libX11 libXau libXdmcp libXrender
### And maybe: glibc zlib
### But those will probably either already be there or be installed per 
the other stuff above.

# mkdir /root/Unpackaged & cd $_
# wget 
'http://download3.vmware.com/software/vmserver/VMware-server-1.0.10-203137.i386.rpm'
# rpm -ivh VMware-server-1.0.10-203137.i386.rpm
# vmware-config.pl

This broke.  Of course.  As always.  My kernel headers were in 
/usr/src/kernels/2.6.18-164.el5PAE-i686/include (note you won't have the 
PAE part unless you have >4G of RAM, IIRC).  I had to patch the damn 
kernel source as Red Hat seems to have released mis-matched kernels and 
sources.  When I give it the correct path, I'd get:
"The directory of kernel headers (version 2.6.18-164.6.1.el5PAE) does 
not match your running kernel (version 2.6.18-164.el5PAE).  Even if the 
module were to compile successfully, it would not load into the running 
kernel."  That's crap.  I have the correct headers installed 
(kernel-PAE-devel).

As you can see, the system is reporting that it is running 
2.6.18-164.6.1.el5PAE but the kernel-PAE-devel RPM installed headers for 
2.6.18-164.el5PAE.  Someone added a '6.1' tweak in the kernel but not 
the headers.  Grrrrr.

So hack around that:
# cp -av 
/usr/src/kernels/2.6.18-164.6.1.el5-PAE-i686/include/linux/utsrelease.h /tmp
# echo '#define UTS_RELEASE "2.6.18-164.el5PAE"' > 
/usr/src/kernels/2.6.18-164.6.1.el5-PAE-i686/include/linux/utsrelease.h
# cp -av /tmp/utsrelease.h 
/usr/src/kernels/2.6.18-164.6.1.el5-PAE-i686/include/linux/
# rm /tmp/utsrelease.h

This all worked, at least to the extent that I could connect to the 
machine using the fat client.  I have not actually tried to create or 
run a VM yet.

Next trick (sigh) is that VM's can be screwy with time sync (since they 
share a CPU without really being aware of that).

Fix time sync settings
     # grep '^cpu MHz' /proc/cpuinfo
         = e.g.: cpu MHz         : 2926.159
     # vi /etc/vmware/config
         # Fix Guest time sync issues
         # 
http://jeffrasmussen.wordpress.com/2007/10/03/ubuntu-host-with-windows-guest-time-sync-problem/
         # 
http://blog.autoedification.com/2006/11/vmware-guest-clock-runs-fast.html
         # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
         # 
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1591
         host.cpukHz = 2926159
         host.noTSC = TRUE
         ptsc.noTSC = TRUE
     # /etc/init.d/vmware restart

Fix slow VMware guests and pegged disk
1) On Linux Host OS
     On-the-fly
         # sudo -s   # if needed
         # echo '10' > /proc/sys/vm/swappiness
     # Permanently
         # vi /etc/sysctl.conf
             # Speed up VMware a bit, 2009-08-27
             # 
http://www.phocean.net/2006/12/06/slow-performance-in-vmware-using-ubuntu.html
             vm.swappiness = 10

2) Per VM settings:
     * VMware, VM Settings, Options, Advanced, check: "Disable memory 
page trimming"
         # http://communities.vmware.com/thread/26481
         # http://www.vmware.com/support/ws55/doc/ws_performance_diskio.html
     * VMware, VM Settings, Options, Disk, uncheck: "Disable write caching"


And if you get "rtc: lost x interrupts" log messages"
	# http://communities.vmware.com/thread/116590
	* vi /etc/vmware/config
		host.useFastClock = FALSE
	* Restart VMware


I hope this giant mess is useful to someone.  I'd say it looks worse 
than it really is, but...
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug