Solved

VMWare Server 2 requires vmware-config after each boot on Linux

Posted on 2010-09-16
20
2,002 Views
Last Modified: 2012-05-10
I use VMWare Server 2 on an Ubuntu 10.  I shutdown last thing & boot up again first thing.  Every boot up, the VMWare Server 2 fails to function - the web interface is inaccessible and starting the vmware-vmrc from the command-line fails to connect.  Running 'sudo /usr/bin/vmware-config.pl' results in the following:

====
The following VMware kernel modules have been found on your system that were
not installed by the VMware Installer.  Please remove them then run this
installer again.

vmnet
vmmon
vmci

I.e. - 'rm /lib/modules/2.6.32-24-generic/misc/<ModuleName>.{o,ko}'

Execution aborted.
====

At this point, I follow the instructions (note that the vsock.* is unafflicted) with 'sudo rm /lib/modules/2.6.32-24-generic/misc/vm*' and re-run the vmware-config.pl with full path.  This time it uses the init.d script for vmware to shut it down and everytime achieves:

====
Making sure services for VMware Server are stopped.

Stopping VMware autostart virtual machines:
   Virtual machines                                                    done
Stopping VMware management services:
   VMware Virtual Infrastructure Web Access
   VMware Server Host Agent                                            done
Stopping VMware services:
   VMware Authentication Daemon                                        done
   VM communication interface socket family:                           done
   Virtual machine communication interface                             done
   Virtual machine monitor                                             done
   Bridged networking on /dev/vmnet0                                   done
   Host network detection                                              done
   DHCP server on /dev/vmnet1                                          done
   Host-only networking on /dev/vmnet1                                 done
   DHCP server on /dev/vmnet8                                          done
   NAT service on /dev/vmnet8                                          done
   Host-only networking on /dev/vmnet8                                 done
   Virtual ethernet                                                   failed
Unable to stop services for VMware Server

Execution aborted.
====

My only recourse is to reboot (which thankfully is not long), log in & re-run the vmware-config.pl script once again and VMWare Server 2 kicks into life.

Note that the installation is from VMware-server-2.0.2-203138.i386.tar.gz with the AMD patch: VMware-server-2.0.2-203138-update-2.patch if that helps any.

I'd like to put an end to this cycle. :)
0
Comment
Question by:Barthax
  • 14
  • 6
20 Comments
 
LVL 19

Author Comment

by:Barthax
ID: 33689386
After the reboot (which I've just done :) ) the vmware-config.pl -default is run & goes through the init.d script successfully then it outputs for each module as they are compiled.  The vmmon module out is given below & the others are similar:


None of the pre-built vmmon modules for VMware Server is suitable for your 

running kernel.  Do you want this program to try to build the vmmon module for 

your system (you need to have a C compiler installed on your system)? [yes] 



Using compiler "/usr/bin/gcc". Use environment variable CC to override.



What is the location of the directory of C header files that match your running

kernel? [/lib/modules/2.6.32-24-generic/build/include] 



Extracting the sources of the vmmon module.



Building the vmmon module.



Using 2.6.x kernel build system.

make: Entering directory `/tmp/vmware-config0/vmmon-only'

make -C /lib/modules/2.6.32-24-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-headers-2.6.32-24-generic'

  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o

  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driverLog.o

  CC [M]  /tmp/vmware-config0/vmmon-only/linux/hostif.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/comport.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/cpuid.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/hashFunc.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/memtrack.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/phystrack.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/task.o

  CC [M]  /tmp/vmware-config0/vmmon-only/common/vmx86.o

  CC [M]  /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o

  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.o

  Building modules, stage 2.

  MODPOST 1 modules

  CC      /tmp/vmware-config0/vmmon-only/vmmon.mod.o

  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.ko

make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic'

cp -f vmmon.ko ./../vmmon.o

make: Leaving directory `/tmp/vmware-config0/vmmon-only'

This program previously created the file 

/lib/modules/2.6.32-24-generic/misc/vmmon.o, and was about to remove it.  

Somebody else apparently did it already.



This program previously created the file 

/lib/modules/2.6.32-24-generic/misc/vmmon.ko, and was about to remove it.  

Somebody else apparently did it already.



The vmmon module loads perfectly into the running kernel.

Open in new window

0
 
LVL 28

Expert Comment

by:bgoering
ID: 33692450
0
 
LVL 19

Author Comment

by:Barthax
ID: 33693258
Thanks, bgoering.  I'll give them a go. :)
0
 
LVL 19

Author Comment

by:Barthax
ID: 33715187
Hmmm... two reboots later & it's definitely not changing the circumstances.  I plan to look into it more as I think I may have missed something.  Not forgotten. ;)
0
 
LVL 28

Expert Comment

by:bgoering
ID: 33717447
Found another link with a script for a 2.6.32 kernel: http://radu.cotescu.com/2010/02/21/how-to-install-vmware-server-kernel-2-6-32/
0
 
LVL 28

Expert Comment

by:bgoering
ID: 33717474
0
 
LVL 19

Author Comment

by:Barthax
ID: 33732303
Thanks bgoering.  Of the above two latest links, the first one confirms in the responses beneath that it does not fix the issue I face - indeed the author confirms it happens to himself.  The second is a general "how to" getting it working in the first instance - I'm long past that one. ;)
0
 
LVL 19

Author Comment

by:Barthax
ID: 33849728
I've decided to try altering the vmware startup script & add in a new script which removes the modules on shutdown.
0
 
LVL 19

Author Comment

by:Barthax
ID: 33850123
So here's the attempt.  The script is in /etc/init.d and I've called it vmware-mod-rem.  chmod +x vmware-mod-rem is done to ensure it is executable and it works from a command window.  I've linked it into the /etc/r5.d directory as S02vmware-mod-rem and K50vmware-mod-rem - very early start but late closure compared to the K0x entries for vmware.

The check before running vmware-config.pl is of the vmmon.o - the first item built by the vmware-config.pl.

Just need to test booting (which I haven't got time today as I've wasted 30 mins preparing).
#!/usr/bin/env bash



case $1 in

         start)

		if [ ! -e "/dev/vmmon" ] ; then

			mknod /dev/vmmon c 10 165

			chmod 600 /dev/vmmon

		fi

		for a in `seq 0 9` ; do

			if [ ! -e "/dev/vmnet$a" ] ; then

				mknod /dev/vmnet$a c 119 $a

				chmod 600 /dev/vmnet$a

			fi

		done

		if [ ! -e /lib/modules/`uname -r`/misc/vmmon.o ] ; then

			/usr/bin/vmware-config.pl -default

		fi

         ;;

         stop)

		rm /lib/modules/`uname -r`/misc/vm*

         ;;

esac

Open in new window

0
 
LVL 19

Author Comment

by:Barthax
ID: 33858403
Minor update: had to alter the shebang to #!/bin/sh before it worked... and the minor mistake of putting the links in the wrong run level. :D  The files now get recompiled on reboot but VMWare doesn't start automatically.  Attempting to start it manually indicates the modules are for the wrong version of the kernel (still).  Thankfully, I can remove the modules, recompile them & start VMWare without any further reboots now.... That's at least one step closer. :)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 28

Assisted Solution

by:bgoering
bgoering earned 500 total points
ID: 33861050
Sounds like VMware server on Ubuntu is a hassle. Googling shows all kinds of issues. It has been a while since I used VMware server on Linux (although I still use it on Windows) - and that was on CentOS distribution.

Going back to my Linux basics - it appears that you are able to build and install the modules when you are manually logged in as root - but the automatic remove / rebuild process you are trying to implement is not working. This makes me wonder about environment issues for your build. If, for example, you are using a bash shell when interactively building and installing, and your script is using /bin/sh - what might you be setting up in your bash profile that isn't present in the environment when running under /bin/sh?

If you can correct the environment differences your automatic process should work.

Good Luck
0
 
LVL 19

Author Comment

by:Barthax
ID: 33861667
Good idea, thanks bgoering.  I've switched the script to bash & added a "env >/root/envbuild" line to get some detail.  It's 5:20 here, so I won't be returning to this until sometime next week.  Here's hoping. :)
0
 
LVL 19

Author Comment

by:Barthax
ID: 33873611
Hmmm... it compiled afresh on boot up - the file time stamps prove that.  Unfortunately, the ethernet portion of VMWare Server is not 100%, returning me to where I was.  The environment output is in the code block for this post - that seems sufficient, IMO.

So, I'm thinking now that it is boot order of something else which may be afflicting the build.  I'm going to push the rebuild script to last (S99) for the next boot.
TERM=xterm

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

PWD=/

LANG=en_GB.utf8

SHLVL=1

_=/usr/bin/env

Open in new window

0
 
LVL 19

Author Comment

by:Barthax
ID: 33876087
I found http://communities.vmware.com/thread/8767 and it has the suggestion of prepending "VMWARE_DEBUG=yes" before vmware scripts to get the debug output.

The script reckons it has found a conflict of IPs:
   Host-only networking on /dev/vmnet1Host-only networking disabled because 172.16.29.1
appears to be a real, physical, existing address.

Trouble is, this only exists after VMWare has failed... So, I know this is something in the network portion of VMWare which is causing it.  I've altered my script with belt-and-braces stop-vmware-at-all-costs-and-remove-the-modules knowledge and I'm going for another reboot.
0
 
LVL 19

Author Comment

by:Barthax
ID: 33876187
I've just noticed (post-reboot) that there's more than one vmware entry in the rc2.d.  I've removed them now, so my script is the only one involved.  Postponing more on this until tomorrow.
0
 
LVL 28

Expert Comment

by:bgoering
ID: 33876246
Sounds like you are on the right track - good luck
0
 
LVL 19

Accepted Solution

by:
Barthax earned 0 total points
ID: 33882395
Woohoo, belt-and-braces approach works. :D  This is the only startup script for VMWare now.  There are a series of kill scripts in the rc2.d with this one being K99 also.
#!/bin/bash
echo ----------------- >> /root/envbuild
env >>/root/envbuild

case $1 in
         stop)
		service vmware stop
		killall -TERM vmnet-bridge
		killall -TERM vmnet-natd
		rmmod vmmon
		rmmod vsock
		rmmod vmci
		rmmod vmnet
		rm /lib/modules/`uname -r`/misc/vm*
         ;;
         start)
		service vmware stop >>/root/envbuild
		killall -TERM vmnet-bridge >>/root/envbuild
		killall -TERM vmnet-natd >>/root/envbuild
		rmmod vmmon >>/root/envbuild
		rmmod vsock >>/root/envbuild
		rmmod vmci >>/root/envbuild
		rmmod vmnet >>/root/envbuild
		rm /lib/modules/`uname -r`/misc/vm* >>/root/envbuild
		if [ ! -e "/dev/vmmon" ] ; then
			mknod /dev/vmmon c 10 165
			chmod 600 /dev/vmmon
		fi
		for a in `seq 0 9` ; do
			if [ ! -e "/dev/vmnet$a" ] ; then
				mknod /dev/vmnet$a c 119 $a
				chmod 600 /dev/vmnet$a
			fi
		done
		if [ ! -e /lib/modules/`uname -r`/misc/vmmon.o ] ; then
			VMWARE_DEBUG=yes /usr/bin/vmware-config.pl -default >>/root/envbuild
		fi
         ;;
esac

Open in new window

0
 
LVL 19

Author Comment

by:Barthax
ID: 33882411
On checking, there is a different environment by the time S99 kicks in.  Naturally, there's some improvements to be made to the above script (like not appending to the same file forever!).  I think that does me.  Thanks for the assistance, bgoering.
0
 
LVL 28

Expert Comment

by:bgoering
ID: 33885312
Good job, glad you were able to achieve a workaround.
0
 
LVL 19

Author Comment

by:Barthax
ID: 33892238
One extra thing: the vmware-config.pl puts an S90vmware back in rc2.d.  So the end of the start portion of my script now also removes this entry.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now