FireDaemon Forums
Go Back   FireDaemon Forums > Support > HOWTOs: Application Tutorials > Business Productivity

Business Productivity HOWTOs and Tutorials regarding integrating FireDaemon with various Business Productivity applications.


Reply
 
Thread Tools Display Modes
  James Bourne's time 3rd December 2005, 08:20 AM    #1  
Old 2nd December 2005, 10:20 PM
James Bourne's Avatar
James Bourne James Bourne is offline
FireDaemon Tech Supp
 
Join Date: Jun 2005
Location: Sydney, AU
Posts: 605
Send a message via Skype™ to James Bourne
Default VMware Workstation As A Windows Service How To



How To Run VMware Workstation Virtual Machines as Windows Services with FireDaemon

To quote: VMware Workstation is powerful desktop virtualization software for software developers/testers and enterprise IT professionals that runs multiple operating systems simultaneously on a single PC.

We recommend you use VMware Workstation 5.0 or later with FireDaemon v1.8 or later. This guide also assumes you are familiar with VMware and running/managing virtual machines.

So why run VMware virtual machines under FireDaemon? Several reasons:
  • Normally, virtualised operating systems (virtual machines) can only be run manually after a user has logged in. FireDaemon allows you to start one or more virtual machines in the background prior to logging in at system boot/reboot
  • Allow multiple virtual machines to be suspended or stopped when the host machine is shutdown or rebooted
  • Use FireDaemon as a centralised VMware virtual machine launcher
  • Allow individual virtual machines to be bound to specific processors on multi-processor or multi-core machines
  • Use FireDaemon in conjuction with PanelDaemon to manage FireDaemon and other Windows services via a web browser.
For your information, we run test and debug FireDaemon under multiple VMware virtual machines on Windows XP x64 Edition all launched from FireDaemon (for example: Windows XP x64 running FireDaemon running Windows Server 2003 running FireDaemon!!).

The example below, covers running setting up and running RedHat Linux ES4 as a VMware 5.5 virtual machine under FireDaemon v1.8.

Warning When Upgrading VMware

We notice that if you upgrade VMware 5.5.x the VMware uninstaller will _DELETE_ all services with "VMware" in the name. The VMware uninstaller makes no checks at to whether it installed the service or not. Hence, take care when naming your services.

Basic VMware Virtual Machine Setup

1. Install VMware 5.5 into the directory of your choice (eg. C:\Program Files\VMware).

2. Start VMware Workstation



3. Create a New Virtual Machine using the Virtual Machine Wizard. Follow the Wizard, decide the Virtual machine configuration type, guest operating system, virtual machine location, network type and disk capacity



4. Boot your virtual machine and install your guest operating system. Don't forget to install the VMware tools. Shutdown or suspend your virtual machine.

FireDaemon Configuration

1. Install FireDaemon Pro into the directory of your choice (eg. C:\Program Files\FireDaemon). FireDaemon can be downloaded from here.

2. Start the FireDaemon GUI



3. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Obviously adjust paths to suite your installation. Pay special attention to the Parameters list.



The Parameters list defines which virtual machine or team of virtual machines to start. The -x option powers on a specific virtual machine or team. The Parameters list can be left blank if you just want to start VMware without starting a specific virtual machine.

4. If you want to see VMware running, click on the FireDaemon settings tab, and check Interact with Desktop.



5. If you want to enable FireDaemon debug logging, bind your virtual machine to a specific CPU or change the overall CPU priority of the virtual machine, click on the Advanced tab. You can even delay the start of your virtual machine by specifying a Pre-Launch delay. This is useful if you are starting multiple virtual machines at system boot and what to stagger their initialisation.



6. Click on the Dependencies tab. It is a good idea to make sure your virtual machine dependent on the Workstation (lanmanworkstation) or other late starting service. This is to ensure the TCP/IP and CIFS stacks are properly initialised.



You might also want to consider making your virtual machine service additionally dependent on the following services depending on how you have configured networking and so forth in each virtual machine:
  • VMAuthdService: VMware Authorization Service
  • VMnetDHCP: VMware DHCP Service
  • VMware NAT Service: VMware NAT Service
  • vmount2: VMware Virtual Mount Manager Extended
7. Click on the Environment tab. When you stop your service you need to use the vmrun.exe utility.



For that utility to run correctly, you need to include the path to your VMware installation in your system PATH variable. This can be done globally or can be done on a per service basis. To set the PATH environment variable, click the Insert button.



Then click OK. Environment expansion will occur when the service is run.



8. Last step. Click on the Pre / Post-Service tab. When your machine is shutdown or rebooted you need to make sure your virtual machine is stopped or suspended safely.



Click on the Insert button in the Post-Service Program section and fill out the Post Service form as follows (obviously adjust paths to suite your installation), then click OK:



The Parameters field defines the action to be taken against the virtual machine prior to the service being stopped. In this case the virtual machine is suspended. You can stop the virtual machine by changing the parameters to read: "stop rhel4.vmx". Be very generous in your execution time as it may take some time for your virtual machine to be suspended.

9. That's it! Your done. Click on the Install button. Your virtual machine will be installed as a system service and started automatically.





Also, don't forget you can export your FireDaemon service configuration as XML. Simply drag and drop the service configuration from the FireDaemon GUI onto your desktop.

One final thing to consider is that if you are running a large number of virtual machines simultanously, you might need to increase the amount of time allocated to shutdown all services cleanly when you machine is shutdown or rebooted. For more information please see this forum post.

Performance Tuning VMs
VMware can place quite a burden on your machine. Here's some tips to get the best out of it (things to do on the host OS are marked [HOST], in VMware are marked [VMWARE] and on the guest OS are marked [GUEST]):
  • [HOST] Buy more RAM!
  • [HOST] Make sure you defragment the guest OS and the file system on which the guest OS resides from time to time
  • [HOST] Install your guest OS on an NTFS partition with a big cluster size (ie. > 4096). Makes loading the guest OS much faster.
  • [HOST] Set DisablePagingExecutive in the registry to 1. This stops the NT kernel and drivers from being swapped to disk. More info here.
  • [HOST] Set LargeSystemCache in the registry to 1. This will also keep more "touched" memory pages in RAM but your mileage may vary. More info here.
  • [VMWARE] Only use one virtual processor (on multi-CPU, multi-core machines) and force each guest OS onto one CPU or core via FireDaemon's CPU setting. This will keep your machine responsive. More info here.
  • [VMWARE] Disconnect the CD-ROM for the guest OS when not in use (VM -> Settings -> CD-ROM -> Device status)
  • [VMWARE] Providing you have enough memory set VMware's memory to not swap (Edit -> Preferences -> Memory -> Fit all virtual memory into reserved host RAM)
  • [VMWARE] Disable snapshots (VM -> Settings -> Options -> Snapshots -> Disable snapshots
  • [GUEST] Make sure your virtual disk is set to use write caching in the guest OS (<DriveLetter> -> Properties -> Hardware -> <PhysicalDrive> -> Properties -> Policies -> Optimize for performance)
  • [GUEST] Disable all visual effects in the guest OS (eg. fade effect) (<Desktop> -> Properties -> Appearance -> Effects -> uncheck all)
  • [GUEST] Run the guest OS in full screen mode
Addendum
It would appear that with the most recent releases of VMware Workstation (5.5.1), it is no longer possible to get clean VM shutdowns upon reboot or shutdown. When you instantiate a virtual machine under FireDaemon, vmware.exe is launched which in turn launches vmware-vmx.exe. vmware.exe and vmrun.exe (used to shutdown the VM) talk with vmware-vmx.exe via named pipes. During a reboot or shutdown Windows sends control messages to all processes advising that the machine is about to be rebooted or shutdown. vmware.exe processes and handles these messages correctly, vmware-vmx.exe does not and consequently hard exits leaving your VM in a crashed state. To get around this issue - use this batch script below to shutdown your FireDaemon services in advance of reboot or shutdown. Place the batch script on your Desktop and double click it when you want to reboot or shutdown:

Code:
@echo off
echo Shutting down services ...
for /f %%x in ('"%FIREDAEMON%" -l') do net stop %%x
REM Use the line below to reboot
tsshutdn 0 /v /delay:0 /reboot
REM Use the line below to shutdown
tsshutdn 0 /v /delay:0 /powerdown
Issues ... other problems? Please post in the Public Support Forums!

Last edited by H4nd0; 16th July 2009 at 07:00 AM.
Reply With Quote
Reply

Bookmarks

Tags
service, vmware, windows, workstation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

 
Try it for Free for 30 Days

Join our Newsletter
Once a month we poke the right people on product releases and promos.



Bookmark our Blog


Buy FireDaemon Now


Getting started videos


Find out more about FireDaemon products?

Latest HOWTOs



All times are GMT. The time now is 05:28 AM.


Powered by vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
Copyright © 2009 FireDaemon Technologies Limited