<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>FireDaemon Forums - Business Productivity</title>
		<link>http://forums.firedaemon.com/</link>
		<description>HOWTOs and Tutorials regarding integrating FireDaemon with various Business Productivity applications.</description>
		<language>en</language>
		<lastBuildDate>Thu, 09 Sep 2010 22:30:26 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.firedaemon.com/smoothred/misc/rss.jpg</url>
			<title>FireDaemon Forums - Business Productivity</title>
			<link>http://forums.firedaemon.com/</link>
		</image>
		<item>
			<title>VMware Workstation 7</title>
			<link>http://forums.firedaemon.com/showthread.php?t=690&amp;goto=newpost</link>
			<pubDate>Thu, 10 Jun 2010 22:33:03 GMT</pubDate>
			<description>Image: http://forums.firedaemon.com/images/posts/vmware7/vmware.jpg  
 
*How To Run VMware Workstation 7 Virtual Machines as Windows Services with...</description>
			<content:encoded><![CDATA[<div><img src="http://forums.firedaemon.com/images/posts/vmware7/vmware.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
<font size="5"><b>How To Run VMware Workstation 7 Virtual Machines as Windows Services with FireDaemon</b></font><br />
<br />
To quote: <a href="http://www.vmware.com" target="_blank" rel="nofollow">VMware Workstation</a> is powerful desktop virtualization software for software developers/testers and enterprise IT professionals that runs multiple operating systems simultaneously on a single PC.<br />
<br />
So why run VMware virtual machines under FireDaemon? Several reasons:<ul><li>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</li>
<li>Allow multiple virtual machines to be suspended or stopped when the host machine is shutdown or rebooted</li>
<li>Use <a href="http://www.firedaemon.com">FireDaemon</a> as a centralised VMware virtual machine launcher</li>
<li>Allow individual virtual machines to be bound to specific processors on multi-processor or multi-core machines</li>
<li>Use FireDaemon in conjuction with <a href="http://www.paneldaemon.com" target="_blank" rel="nofollow">PanelDaemon</a> to manage FireDaemon and other Windows services via a web browser.</li>
</ul><br />
The example below, covers running setting up and running Ubuntu as a VMware 7 virtual machine under FireDaemon v3.0 in Windows 7 Professional 64Bit.<br />
<br />
<b>Basic VMware Virtual Machine Setup</b><br />
<br />
1. Install VMware 7.0 into the directory of your choice (eg. C:\Program Files (x86)\VMware).<br />
<br />
2. Start VMware Workstation<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware1.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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.<br />
<br />
<b>Note:</b> If you want your Virtual Machine to be accesible to all users who use the computer, set the virtual machine location outside of your windows user directory; for instance 'C:\VMWare Machines'<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware2.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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.<br />
<br />
<b>FireDaemon Configuration</b><br />
<br />
1. Install FireDaemon Pro into the directory of your choice (eg. C:\Program Files\FireDaemon). FireDaemon can be downloaded <a href="http://www.firedaemon.com/downloads">from here</a>.<br />
<br />
2. Start the FireDaemon GUI<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware3.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
3. Click on the &quot;Create a new service definition&quot; 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.<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware4.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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.<br />
<br />
Here&#8217;s the full parameter list you should have:<br />
<b>-x &quot;C:\PATH TO YOUR VM\name.vmx&quot;<br />
</b><br />
<br />
4. If you want to see VMware running, click on the FireDaemon settings tab, and check Interact with Desktop.<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware5.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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.<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware6.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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.<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware7.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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:<ul><li>VMware Authorization Service</li>
<li>VMware DHCP Service</li>
<li>VMware NAT Service</li>
</ul><br />
7. Click on the Environment tab. When you stop your service you need to use the vmrun.exe utility.<br />
<br />
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 and enter:<br />
<br />
Variable Name: PATH<br />
Variable Value: C:\Program Files (x86)\VMWare;%PATH%<br />
<br />
Then click OK. Environment expansion will occur when the service is run.<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware8.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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.<br />
<br />
<img src="http://forums.firedaemon.com/images/posts/vmware7/vmware9.jpg" border="0" alt="" class="tcattdimgresizer" onload="NcodeImageResizer.createOn(this);" /><br />
<br />
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:<br />
<br />
Executable: C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe<br />
Working Directory: C:\VMWare Machines<br />
Parameters: suspend Ubuntu.vmx<br />
Execution Time: 20000<br />
Run Program: Before Event<br />
<br />
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: &quot;stopUubuntu.vmx&quot;. Be very generous in your execution time as it may take some time for your virtual machine to be suspended.<br />
<br />
<b>Note:</b> When your virtual machine is started or restarted, it will usually take many minutes until it fully loads.  The exact time will be dependant on your computer hardware and the size or type of virtual machine being loaded.<br />
<br />
9. That's it! Your done. Click on the Install button. Your virtual machine will be installed as a system service and started automatically.<br />
<br />
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.<br />
<br />
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 <a href="http://forums.firedaemon.com/increasing-service-shutdown-time-t79.html">forum post</a>.<br />
<br />
<b>Performance Tuning VMs</b><br />
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]):<ul><li>[HOST] Buy more RAM!</li>
<li>[HOST] Make sure you defragment the guest OS and the file system on which the guest OS resides from time to time</li>
<li>[HOST] Install your guest OS on an NTFS partition with a big cluster size (ie. &gt; 4096). Makes loading the guest OS much faster.</li>
<li>[HOST] Set DisablePagingExecutive in the registry to 1. This stops the NT kernel and drivers from being swapped to disk. More info <a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/29931.mspx?mfr=true" target="_blank" rel="nofollow">here</a>.</li>
<li>[HOST] Set LargeSystemCache in the registry to 1. This will also keep more &quot;touched&quot; memory pages in RAM but your mileage may vary. More info <a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/29931.mspx?mfr=true" target="_blank" rel="nofollow">here</a>.</li>
<li>[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 <a href="http://forums.firedaemon.com/maintaining-processor-affinity-under-t218.html">here</a>.</li>
<li>[VMWARE] Disconnect the CD-ROM for the guest OS when not in use (VM -&gt; Settings -&gt; CD-ROM -&gt; Device status)</li>
<li>[VMWARE] Providing you have enough memory set VMware's memory to not swap (Edit -&gt; Preferences -&gt; Memory -&gt; Fit all virtual memory into reserved host RAM)</li>
<li>[VMWARE] Disable snapshots (VM -&gt; Settings -&gt; Options -&gt; Snapshots -&gt; Disable snapshots</li>
<li>[GUEST] Make sure your virtual disk is set to use write caching in the guest OS (&lt;DriveLetter&gt; -&gt; Properties -&gt; Hardware -&gt; &lt;PhysicalDrive&gt; -&gt; Properties -&gt; Policies -&gt; Optimize for performance)</li>
<li>[GUEST] Disable all visual effects in the guest OS (eg. fade effect) (&lt;Desktop&gt; -&gt; Properties -&gt; Appearance -&gt; Effects -&gt; uncheck all)</li>
<li>[GUEST] Run the guest OS in full screen mode</li>
</ul><b>Addendum</b><br />
It would appear that with the most recent releases of VMware Workstation, 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 <a href="http://en.wikipedia.org/wiki/Named_pipe" target="_blank" rel="nofollow">named pipes</a>. 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:<br />
<br />
The following code only works in 7 and 2008 Server:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">@echo off<br />
echo Shutting down services ...<br />
for /f %%x in ('&quot;%FIREDAEMON%&quot; -l') do net stop %%x<br />
REM Use the line below to reboot<br />
shutdown /r&nbsp; 0 /v /delay:0 /reboot<br />
REM Use the line below to shutdown<br />
shutdown /r 0 /v /delay:0 /powerdown</code><hr />
</div>The following code only works in XP and below:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">@echo off<br />
echo Shutting down services ...<br />
for /f %%x in ('&quot;%FIREDAEMON%&quot; -l') do net stop %%x<br />
REM Use the line below to reboot<br />
tsshutdn&nbsp; 0 /v /delay:0 /reboot<br />
REM Use the line below to shutdown<br />
tsshutdn 0 /v /delay:0 /powerdown</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forums.firedaemon.com/forumdisplay.php?f=17">Business Productivity</category>
			<dc:creator>Jordan</dc:creator>
			<guid isPermaLink="true">http://forums.firedaemon.com/showthread.php?t=690</guid>
		</item>
	</channel>
</rss>
