VMWare2: start and stop only webAccess

Posted on Sun, 23 Aug 2009 in vmware by Martijn

VMware's new webAccess interface that ships with VMware 2 Server edition is reasdonably nice though a bit flashy and it can (unnessarily) eat up resources. So... what to do when you don't really need webAccess most of the time? Well, VMware quite helpfully created a command called vmware-web... not!

What VMware doesn't seem able to do, we are able to do my friends. And its quite simple too. (Locations of files may differ per system, this is on Fedora and Ubuntu)

  1. Edit the /etc/init.d/vmware script.
  2. Find the service_vmware_mgmt() function.
  3. Copy the entire function and paste it below as "service_vmware_web".

You should now have ended up with something like:

service_vmware_mgmt() {
    ....
}

service_vmware_web() {
    ....
}

Next, we change the new function:

  1. In the start) section of the new service_vmware_web() function, remove the "vmware_start_hostd" line.
  2. In the stop) section of the new service_vmware_web() function, remove the "vmware_stop_hostd" line.

You should end up with a new service_vmware_web function looking like this:

service_vmware_web() {
   # See how we were called.
   case "$1" in
      start)
         if [ "`vmware_product`" = "wgs" ]; then
            echo 'Starting VMware webAccess services:'
            vmware_start_webAccess
            #clean up output from webAccess
            echo
         fi
      ;;
      stop)
         if [ "`vmware_product`" = "wgs" ]; then
            echo 'Stopping VMware webAccess services:'
            vmware_stop_webAccess
            #clean up output from webAccess
            echo
         fi
      ;;
      restart)
         "$SCRIPTNAME" stop && "$SCRIPTNAME" start
      ;;
      *)
         echo "Usage: "$BASENAME" {start|stop|restart}"
         exit 1
      ;;
   esac
}

Next, change the start) section of the old service_vmware_mgmt() function and comment out the "vmware_start_webAccess" line. We don't want it to start webAccess anymore... we'll do that manually from now on.

Lastly, go down to the end of the file and the following code just above the "vmware-autostart)" line:

   vmware-web)
      service_vmware_web "$1"
   ;;

That's it for the changes in this file. Just save and close it.

One last step...

Create a new link called "vmware-web" to the vmware script. On my system I simply did:

ln -s /etc/init.d/vmware vmware-web

And you're done. You can now use the command "vmware-web start", "vmware-web stop" and "vmware-web restart" to easily control the webAccess component.

0 Responses so far.

Your name
 
Email
 
Website
 
Anti-spam check

Please insert the result of the arithmetical operation from the following image:

Please insert the result of the arithmetical operation from this image. =
 
Comment