<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pivotal Labs &#187; Brian Cunnie</title>
	<atom:link href="http://pivotallabs.com/author/cunnie/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Wed, 22 May 2013 15:53:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>QuickBooks &#8220;Error: Connection Has Been Lost&#8221;</title>
		<link>http://pivotallabs.com/quickbooks_connection_has_been_lost/</link>
		<comments>http://pivotallabs.com/quickbooks_connection_has_been_lost/#comments</comments>
		<pubDate>Tue, 30 Apr 2013 15:53:21 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=18675</guid>
		<description><![CDATA[<p>Abstract Our Finance organization uses QuickBooks, which they run on their Macs via a Windows virtual machine.  After our Controller and Financial Analyst were given new MacBooks, they began to receive &#8220;Error: Connection Has Been Lost&#8221; from their QuickBooks session several times a day, forcing them to re-open QuickBooks.  We discovered that by modifying the MacBooks&#8217; Energy Saver preferences, changing the Computer sleep setting from 15 minutes to 2 hours, we were able to eliminate the problem. Our QuickBooks Setup QuickBooks Premier Accountant Edition 2010 multi-user mode The QuickBooks file is kept on a fileserver; it&#8217;s accessed over the network Older Client: iMac OS X 10.7 Lion Parallels Desktop 6 for Mac Windows XP (Virtual Machine) Newer Client MacBook OS X 10.8 Mountain Lion VMware Fusion 5 Windows 7 64-bit (Virtual Machine) The Differential Diagnosis We weren&#8217;t sure why the newer clients were having this problem but the older clients&#8230;</p><p>The post <a href="http://pivotallabs.com/quickbooks_connection_has_been_lost/">QuickBooks &#8220;Error: Connection Has Been Lost&#8221;</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h1>Abstract</h1>
<p>Our Finance organization uses QuickBooks, which they run on their Macs via a Windows virtual machine.  After our Controller and Financial Analyst were given new MacBooks, they began to receive &#8220;Error: Connection Has Been Lost&#8221; from their QuickBooks session several times a day, forcing them to re-open QuickBooks.  We discovered that by modifying the MacBooks&#8217; Energy Saver preferences, changing the Computer sleep setting from 15 minutes to 2 hours, we were able to eliminate the problem.</p>
<h1>Our QuickBooks Setup</h1>
<ul>
<li><span style="line-height: 15px;">QuickBooks Premier Accountant Edition 2010</span></li>
<li>multi-user mode</li>
<li>The QuickBooks file is kept on a fileserver; it&#8217;s accessed over the network</li>
<li>Older Client:
<ul>
<li>iMac OS X 10.7 Lion</li>
<li>Parallels Desktop 6 for Mac</li>
<li>Windows XP (Virtual Machine)</li>
</ul>
</li>
<li>Newer Client
<ul>
<li>MacBook OS X 10.8 Mountain Lion</li>
<li>VMware Fusion 5</li>
<li>Windows 7 64-bit (Virtual Machine)</li>
</ul>
</li>
</ul>
<h1>The Differential Diagnosis</h1>
<p>We weren&#8217;t sure why the newer clients were having this problem but the older clients were not.  We checked the log files on Windows Virtual Machine (Event Viewer → Windows Logs → Application):</p>
<pre><code style="text">
"An unexpected error has occured in ""QuickBooks: Premier Accountant Edition 2010"":
DQE execution failed. Could not retrieve COUNT(user name)."
"An unexpected error has occured in ""QuickBooks: Premier Accountant Edition 2010"":
ExecuteQuery failed (DETAIL AVAILABLE), error id: -6019, sub id: 0, 'Succeeded', ''"
"An unexpected error has occured in ""QuickBooks: Premier Accountant Edition 2010"":
DB error -101 ErrorMessage:'Not connected to a database' from file:'.\.\src\SQLDynamicQuery.cpp' at line 274 from function:'DQE::DMDQEDynamicQuery::DBDoQuery'"
"An unexpected error has occured in ""QuickBooks: Premier Accountant Edition 2010"":
DB error -101 ErrorMessage:'Not connected to a database' from file:'.\.\src\DMSQLTransaction.cpp' at line 318 from function:'DBMgr::SADMTransaction::DBSQLGetUTCTimestamp'"
"An unexpected error has occured in ""QuickBooks: Premier Accountant Edition 2010"":
DB error -308 ErrorMessage:'Connection was terminated' from file:'.\.\src\DMSQLTransaction.cpp' at line 318 from function:'DBMgr::SADMTransaction::DBSQLGetUTCTimestamp'"
[ warning] [vmusr:vmusr] pbrpc::AsyncSocketRpcServer::SocketErrorOccurred: An error 4 occurred on Socket 1F55660
</code></pre>
<p>And we checked the logs (/var/log/system.log) on the OS X host, too:</p>
<pre><code>
vmnt: VMNetDisconnect called for port 0xfffffff80
</code></pre>
<h1>False Starts</h1>
<p>We tried to fix this a number of ways:</p>
<ul>
<li>Changed their Windows Virtual Machine&#8217;s interface from NAT to bridged (note: we later switched back to NAT because that made VPN connections much easier)</li>
<li>Turned off their Windows Virtual Machine&#8217;s 3D Acceleration (fixed an unrelated java problem, but didn&#8217;t fix this one)</li>
<li>Changed their Windows Virtual Machine&#8217;s energy settings (Control Panel → System and Security → Power Options → Change when the computers sleeps → Put the computer to sleep (30 minutes) → Never)</li>
</ul>
<h1>The Solution</h1>
<p>We finally noticed (while perusing /var/log/system.log on the OS X machine) that a sleep event preceded every QuickBooks disconnect.</p>
<pre><code>kernel[0]: Previous Sleep Cause: 5</code></pre>
<p>At that point we modified the sleep settings (System Preferences → Energy Saver → Computer sleep) from 10 minutes to 2 hours.  Since we made that change a week ago, the problem has only occurred once.</p>
<p>The post <a href="http://pivotallabs.com/quickbooks_connection_has_been_lost/">QuickBooks &#8220;Error: Connection Has Been Lost&#8221;</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/quickbooks_connection_has_been_lost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting rid of &quot;VMware Shared Folders&quot; under OS X</title>
		<link>http://pivotallabs.com/getting-rid-of-vmware-shared-folders-under-os-x/</link>
		<comments>http://pivotallabs.com/getting-rid-of-vmware-shared-folders-under-os-x/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 23:49:11 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=8120</guid>
		<description><![CDATA[<p><h1>The Scenario</h1>

<p>You have a fresh machine.  But when you log in, you see a link on your desktop to <em>VMware Shared Folders</em>.  You drag it to your Trash.  Next time you log in, you see it again:  <em>VMware Shared Folders</em>.  Again, you move it to the Trash.  The third time it happens, you wonder, "What the heck is going on?  How can I permanently delete <em>VMware Shared Folders</em>?"</p>

<h1>The Cause</h1>

<p>The most likely cause is that your machine was cloned from an image that was created under a VMware Fusion instance that had VMware Tools installed.</p> <a href="http://pivotallabs.com/getting-rid-of-vmware-shared-folders-under-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/getting-rid-of-vmware-shared-folders-under-os-x/">Getting rid of &quot;VMware Shared Folders&quot; under OS X</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h1>The Scenario</h1>
<p>You have a fresh machine. But when you log in, you see a link on your desktop to <em>VMware Shared Folders</em>. You drag it to your Trash. Next time you log in, you see it again: <em>VMware Shared Folders</em>. Again, you move it to the Trash. The third time it happens, you wonder, &#8220;What the heck is going on? How can I permanently delete <em>VMware Shared Folders</em>?&#8221;</p>
<h1>The Cause</h1>
<p>The most likely cause is that your machine was cloned from an image that was created under a VMware Fusion instance that had VMware Tools installed.</p>
<h1>The Easy Fix</h1>
<p>The easy fix is to Uninstall VMware Tools.  It can be found in /Library/Application Support/VMware Tools.</p>
<h1>The Hard Fix</h1>
<p>Log in to your workstation and run these commands; they should fix the problem:</p>
<pre><code>for PLIST in \
  /Library/LaunchAgents/com.vmware.launchd.vmware-tools-userd.plist  /Library/LaunchDaemons/com.vmware.launchd.tools.plist
<span style="font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; font-style: normal; line-height: normal;">do</span>
  [ -f $PLIST ] &amp;&amp;
  sudo defaults write $PLIST RunAtLoad -bool false &amp;&amp;
  sudo plutil -convert xml1 $PLIST &amp;&amp;
  sudo chmod 444 $PLIST
done
rm ~/Desktop/VMWare\ Shared\ Folders
</code></pre>
<p>The <em>VMware Shared Folders</em> should be gone for good.</p>
<h2>The Specs</h2>
<p>This has been tested under OS X 10.8.3 and VMware Fusion 5.0.3</p>
<h2>Other Clues</h2>
<p>Another indication that you&#8217;re running a machine that was imaged from a virtual machine with VMware tools installed is that you receive the following message when you run lsof:</p>
<pre><code>lsof: WARNING: can't stat() vmhgfs file system /Volumes/VMware Shared Folders
</code></pre>
<h2>A Bolder Way</h2>
<p>If you know that you&#8217;ll never want to re-enable VMware tools, deleting the configuration files may be easier (<em>caveat utor</em>: I have not tried this myself):</p>
<pre><code>sudo rm /Library/LaunchAgents/com.vmware.launchd.vmware-tools-userd.plist /Library/LaunchDaemons/com.vmware.launchd.tools.plist
rm ~/Desktop/VMWare\ Shared\ Folders
</code></pre>
<p>&nbsp;</p>
<p>The post <a href="http://pivotallabs.com/getting-rid-of-vmware-shared-folders-under-os-x/">Getting rid of &quot;VMware Shared Folders&quot; under OS X</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/getting-rid-of-vmware-shared-folders-under-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enabling OS X Screen Sharing from the Command Line</title>
		<link>http://pivotallabs.com/enabling-os-x-screen-sharing-from-the-command-line/</link>
		<comments>http://pivotallabs.com/enabling-os-x-screen-sharing-from-the-command-line/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 20:37:29 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=11423</guid>
		<description><![CDATA[<p>There are several ways to enable screen sharing on OS X Mountain Lion from the command line.  The first method is an old standby: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers This will work in 99% of the cases, but there may be some situations when it&#8217;s not quite enough.  The above command enables Screen Sharing by enabling Remote Management; however, we lose the ability to add fine-grained control to who can connect &#38; those who can&#8217;t. Here&#8217;s another way to enable screen sharing from the command line: sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false sudo launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist In the second example, we enable only Screen Sharing, not Remote Management. This allows us to use System Preferences to restrict who can screen share to our machine (e.g. local administrators, network administrators). We use the second example when configuring our authentication servers remotely.</p><p>The post <a href="http://pivotallabs.com/enabling-os-x-screen-sharing-from-the-command-line/">Enabling OS X Screen Sharing from the Command Line</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>There are several ways to enable screen sharing on OS X Mountain Lion from the command line.  The first method is an old standby:</p>
<pre><code>sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers</code></pre>
<p>This will work in 99% of the cases, but there may be some situations when it&#8217;s not quite enough.  The above command enables Screen Sharing by enabling Remote Management; however, we lose the ability to add fine-grained control to who can connect &amp; those who can&#8217;t.</p>
<p>Here&#8217;s another way to enable screen sharing from the command line:</p>
<pre><code>sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false
sudo launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist</code></pre>
<p>In the second example, we enable only Screen Sharing, not Remote Management.  This allows us to use System Preferences to restrict who can screen share to our machine (e.g. local administrators, network administrators).  We use the second example when configuring our authentication servers remotely.</p>
<p>The post <a href="http://pivotallabs.com/enabling-os-x-screen-sharing-from-the-command-line/">Enabling OS X Screen Sharing from the Command Line</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/enabling-os-x-screen-sharing-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Migrating a VMWare Fusion 4.1 instance to ESXi 5</title>
		<link>http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/</link>
		<comments>http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 18:54:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/</guid>
		<description><![CDATA[<p><p>A VMware Fusion instance originally created as a side project may grow in importance and need to be housed on a production &#40;i.e. ESXi&#41; server.</p>

<p>Rather than undertaking the painful process of re-creating an instance, it's easier to migrate the .vmdk files to the ESXi server.</p>

<h3>Procedure</h3>

<p>In this example, we're migrating a Windows 7 instance &#40;named w7_64bit_base_10-12-11_updated_IE9&#41; to our ESXi server &#40;server name: esxi2&#41; &#40;new instance name: windows7_2&#41;.  First, we log into the ESXi server and create a temporary holding directory, then copy the Fusion .vmdk files over:</p>

<pre><code>ssh root@esxi2
mkdir /vmfs/volumes/datastore1/windows7-tmp
exit
scp ~/Documents/Virtual Machines.localized/w7_64bit_base_10-12-11_updated_IE9.vmwarevm/*.vmdk root@esxi2:/vmfs/volumes/datastore1/windows7-tmp
ssh root@esxi2
cd /vmfs/volumes/datastore1/windows7-tmp
vmkfstools -i w7_64bit_base.vmdk -d zeroedthick windows7_2.vmdk
</code></pre> <a href="http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/">Migrating a VMWare Fusion 4.1 instance to ESXi 5</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>A VMware Fusion instance originally created as a side project may grow in importance and need to be housed on a production &#40;i.e. ESXi&#41; server.</p>
<p>Rather than undertaking the painful process of re-creating an instance, it&#8217;s easier to migrate the .vmdk files to the ESXi server.</p>
<h3>Procedure</h3>
<p>In this example, we&#8217;re migrating a Windows 7 instance &#40;named w7_64bit_base_10-12-11_updated_IE9&#41; to our ESXi server &#40;server name: esxi2&#41; &#40;new instance name: windows7_2&#41;.  First, we log into the ESXi server and create a temporary holding directory, then copy the Fusion .vmdk files over:</p>
<pre><code>ssh root@esxi2
mkdir /vmfs/volumes/datastore1/windows7-tmp
exit
scp ~/Documents/Virtual Machines.localized/w7_64bit_base_10-12-11_updated_IE9.vmwarevm/*.vmdk root@esxi2:/vmfs/volumes/datastore1/windows7-tmp
ssh root@esxi2
cd /vmfs/volumes/datastore1/windows7-tmp
vmkfstools -i w7_64bit_base.vmdk -d zeroedthick windows7_2.vmdk
</code></pre>
<p>We&#8217;ll then need to create a new instance.  For this, we use vSphere:</p>
<ul>
<li>File &rarr; New &rarr; Virtual Machine</li>
<li>Configuration: <strong>Typical</strong></li>
<li>Name: <strong>windows7_2</strong></li>
<li>Select a datastore for the virtual machine &#40;i.e. <strong>datastore1</strong>&#41;</li>
<li>Guest Operation System: <strong>Windows</strong>; Version: <strong>Microsoft Windows 7 &#40;64-bit&#41;</strong></li>
<li>Choose your network connection</li>
<li>Virtual disk size:  <strong>32GB Thin Provision</strong></li>
</ul>
<p>Now move the .vmdk file into place:</p>
<pre><code>ssh root@esxi2
cd /vmfs/volumes/datastore1/windows7-tmp
mv -i windows7_2*.vmdk ../windows7_2/
exit
</code></pre>
<p>You should be able to boot  </p>
<p>Clean up the old files:</p>
<pre><code>ssh root@esxi2
rm -r /vmfs/volumes/datastore1/windows7-tmp
exit
</code></pre>
<h3>Addendum</h3>
<p>You&#8217;ll need to make sure that inbound ssh is enabled on the ESXi server.</p>
<p>In the case of Windows, you will need to manage the licensing &#40;e.g. re-activating&#41;.</p>
<p>It would be more efficient to keep one terminal session logged into the ESXi server rather than continually ssh&#8217;ing in &amp; exiting.</p>
<h3>Acknowledgements</h3>
<p><a href="http://www.johnkastler.net/2012/02/01/convert-fusion-vmdk-to-esxi-compatible-image/">John Kastler</a> provided the crucial vmkfstools command.</p>
<p>The post <a href="http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/">Migrating a VMWare Fusion 4.1 instance to ESXi 5</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/migrating-a-vmware-fusion-4-1-instance-to-esxi-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick &amp; Dirty Anonymous FTP Server</title>
		<link>http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/</link>
		<comments>http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/#comments</comments>
		<pubDate>Mon, 12 Nov 2012 18:30:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/</guid>
		<description><![CDATA[<p><p><em>Hey, we need an FTP server.  Yes, it has to be an FTP server.  We're going to tell our clients to upload files there.  Oh, and we don't want to bother creating userids for each individual clients&#8212;too much work, so it's important that they can upload files but can't see anybody else's files.  Except for us:  we need to be able to see all the uploaded files.</em></p>

<p>FTP, although long since superseded by better &#38; more efficient file transfer protocols &#40;e.g. scp, HTTP, bittorrent&#41;, has  managed to survive to this day, occasionally rearing its ugly head, reminding us that dinosaurs still walk the earth.</p>

<p>Here are the steps to go through to create a secure anonymous FTP server, one where the anonymous clients can upload files but cannot read them.</p>

<h3>Create an Amazon EC2 Instance</h3>

<p><a href="https://aws.amazon.com">Amazon AWS</a> is an excellent service for hosting virtual machines on the Internet.  Create an account and perform the following steps &#40;<em>caveat lector</em>: Amazon may change the menus/procedures at its discretion&#41;:</p> <a href="http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/">A Quick &amp; Dirty Anonymous FTP Server</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><em>Hey, we need an FTP server.  Yes, it has to be an FTP server.  We&#8217;re going to tell our clients to upload files there.  Oh, and we don&#8217;t want to bother creating userids for each individual clients&mdash;too much work, so it&#8217;s important that they can upload files but can&#8217;t see anybody else&#8217;s files.  Except for us:  we need to be able to see all the uploaded files.</em></p>
<p>FTP, although long since superseded by better &amp; more efficient file transfer protocols &#40;e.g. scp, HTTP, bittorrent&#41;, has  managed to survive to this day, occasionally rearing its ugly head, reminding us that dinosaurs still walk the earth.</p>
<p>Here are the steps to go through to create a secure anonymous FTP server, one where the anonymous clients can upload files but cannot read them.</p>
<h3>Create an Amazon EC2 Instance</h3>
<p><a href="https://aws.amazon.com">Amazon AWS</a> is an excellent service for hosting virtual machines on the Internet.  Create an account and perform the following steps &#40;<em>caveat lector</em>: Amazon may change the menus/procedures at its discretion&#41;:</p>
<ul>
<li>Log into Amazon AWS &#40;you have created an account, haven&#8217;t you?&#41;</li>
<li>Click on <strong>EC2 Dashboard</strong></li>
<li>Click <strong>Launch Instance</strong></li>
<li>Select <strong>Classic Wizard</strong></li>
<li>Select <strong>Ubuntu Server 12.04.1 LTS 64-bit</strong></li>
<li>Select <strong>EC2</strong>; if you  have an <strong>Availability Zone</strong> preference, select it here.</li>
<li>The <strong>Advanced Instance Options</strong> have a reasonable set of defaults</li>
<li>Similarly with the <strong>Storage Device Configuration</strong></li>
<li>Add <strong>Tags</strong>
<ul>
<li>Name:  <strong>anon FTP</strong></li>
</ul>
</li>
<li>Select <strong>Create a new Key Pair</strong>,
<ul>
<li>name it <strong>anonftp</strong></li>
<li>click <strong>Create &amp; Download</strong></li>
<li>save to <strong>~/.ssh/anonftp.pem</strong></li>
</ul>
</li>
<li>Select <strong>Create a new Security Group</strong>
<ul>
<li>group name <strong>anon FTP</strong></li>
<li>group description <strong>allow all TCP</strong></li>
<li>Create a new rule: <strong>All TCP</strong></li>
<li>Click <strong>Add Rule</strong></li>
</ul>
</li>
<li>Click <strong>Launch</strong></li>
<li>
<p>Click <strong>Close</strong></p>
</li>
<li>
<p>Click on <strong>Elastic IPs</strong></p>
</li>
<li>Click <strong>Allocate New Address</strong> &#40;for example, 54.243.47.142, which we will use in the remainder of this document, but remember to substitute <em>your</em> allocated elastic IP address&#41;</li>
<li>Click <strong>Associate Address</strong>
<ul>
<li>Instance: <strong>anon FTP</strong></li>
</ul>
</li>
</ul>
<h3>Configure Anon FTP</h3>
<pre><code>chmod 600 ~/.ssh/anonftp.pem
ssh -i ~/.ssh/anonftp.pem ubuntu@54.243.47.142
sudo apt-get install vsftpd
sudo vim /etc/vsftpd.conf
</code></pre>
<p>We made the following changes to our <code>/etc/vsftpd.conf</code> file:</p>
<pre><code>local_enable=YES
write_enable=YES
anon_upload_enable=YES
chown_uploads=YES
chown_username=ftpmaster
chroot_local_user=YES
</code></pre>
<p>Now we need to create our <code>ftpmaster</code> user, who will be able to log in &amp; see all files.  We are going to assign him the password <code>themasterseesall</code>:</p>
<pre><code>sudo restart vsftpd
sudo useradd -G ftp -d /srv/ftp ftpmaster
sudo passwd ftpmaster
sudo mkdir /srv/ftp/pub
sudo chown ftpmaster:ftp /srv/ftp/pub
sudo chmod 733 /srv/ftp/pub
sudo tee /srv/ftp/readme.txt &lt;&lt;-EOF
        Please upload all movies into the /pub directory.

        You may upload files into the pub directory, but you will not be
        able to read files in the pub directory, not even the ones
        you've uploaded.

        If you can't upload files into the /pub directory, it is possible
        that there is already a file of the same name already there; try
        uploading your file using a different name.
EOF
</code></pre>
<h3>Test</h3>
<p>From <em>your</em> workstation &#40;not the Amazon EC2 instance&#41;, connect via anonymous FTP &amp; upload a file.  Also, try to get a directory listing:</p>
<pre><code>ftp ftp@54.243.47.142
Connected to 54.243.47.142.
220 &#40;vsFTPd 2.3.5&#41;
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp&gt; put /etc/hosts /pub/hosts.txt
local: /etc/hosts remote: /pub/hosts.txt
229 Entering Extended Passive Mode &#40;|||64563|&#41;.
150 Ok to send data.
100% |*********************************************************************************************|   236        4.50 MiB/s    00:00 ETA
226 Transfer complete.
236 bytes sent in 00:00 &#40;1.44 KiB/s&#41;
ftp&gt; ls /pub/
229 Entering Extended Passive Mode &#40;|||29280|&#41;.
150 Here comes the directory listing.
226 Transfer done &#40;but failed to open directory&#41;.
ftp&gt; quit
221 Goodbye.
</code></pre>
<p>That was a successful FTP session:</p>
<ul>
<li>we were able to connect &amp; upload the file</li>
<li>we were unable to browse the contents of the upload directory</li>
</ul>
<p>Now let&#8217;s make sure that the <code>ftpmaster</code> can log in &amp; retrieve the uploaded files:</p>
<ul>
<li>Browse <a href="ftp://ftpmaster:themasterseesall@54.243.47.142/pub">ftp://ftpmaster:themasterseesall@54.243.47.142/pub</a></li>
<li>Click on the <code>hosts.txt</code> file to download</li>
</ul>
<h3>Configure DNS</h3>
<ul>
<li>Create a DNS A record for anonftp.<em>yourcompany</em>.com that points to 54.243.47.142</li>
</ul>
<h3>Security Concerns</h3>
<p>Anonymous FTP can be a security concern &#40;this author ran an anonymous FTP server in 2001 only to discover that a gentleman from Germany was using its diskspace &amp; bandwidth to illegally distribute movies.  Even worse, his taste in movies was universally mediocre&#41;.  But this should not be a concern: given that anonymous FTP users cannot see or download the material they have uploaded, our German hacker would be thwarted in his attempt to use this FTP server as a distribution mechanism.  Also, bittorrent has supplanted using pilfered anonymous FTP servers in the modern day.</p>
<p>There are also [somewhat lame] denial-of-service attacks: someone could, for example, fill the up the disk space, preventing others from uploading.</p>
<p>There is no encryption on the FTP uploads.  If the content is sensitive, this may not be the appropriate solution.</p>
<p>Can the server be hacked?  Can someone break in through one of the services and own the machine?  I suspect the likelihood is low: there are only 2 services running: FTP &amp; ssh.</p>
<ul>
<li>The only user who can ssh in is the <code>ubuntu</code> user &#40;for the sshd configuration requires ssh keys to log in, and <code>ubuntu</code> is the only user that has keys&#41;.</li>
<li>The FTP service is using an FTP server that has been built for security.</li>
</ul>
<p>The post <a href="http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/">A Quick &amp; Dirty Anonymous FTP Server</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/a-quick-dirty-anonymous-ftp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using DeployStudio Across Subnets—a Path not Taken</title>
		<link>http://pivotallabs.com/using-deploystudio-across-subnets-a-path-not-taken/</link>
		<comments>http://pivotallabs.com/using-deploystudio-across-subnets-a-path-not-taken/#comments</comments>
		<pubDate>Tue, 09 Oct 2012 20:43:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/using-deploystudio-across-subnets/</guid>
		<description><![CDATA[<p><p>At Pivotal Labs we use <a href="http://deploystudio.com/Home.html">DeployStudio</a> to rapidly image machines over the network.  It was an excellent solution when the DeployStudio server and the client were on the same subnet.  It did <em>not</em> work when they were on different subnets.</p>

<p>We found that, with a combination of clever use of tcpdump, a carefully-crafted dhcpd configuration file, and a judicious set of firewall exceptions, we were able to extend DeployStudio so that it worked across subnets.</p>

<p>Unfortunately, it was an epic fail:  every third install would cause our firewall &#40;m0n0wall 1.8.0b512&#41; to lock up.  We have put the project on ice until we get a new firewall.</p> <a href="http://pivotallabs.com/using-deploystudio-across-subnets-a-path-not-taken/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/using-deploystudio-across-subnets-a-path-not-taken/">Using DeployStudio Across Subnets—a Path not Taken</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>At Pivotal Labs we use <a href="http://deploystudio.com/Home.html">DeployStudio</a> to rapidly image machines over the network. It was an excellent solution when the DeployStudio server and the client were on the same subnet. It did <em>not</em> work when they were on different subnets.</p>
<p>We found that, with a combination of clever use of tcpdump, a carefully-crafted dhcpd configuration file, and a judicious set of firewall exceptions, we were able to extend DeployStudio so that it worked across subnets.</p>
<p>Unfortunately, it was an epic fail: every third install would cause our firewall (m0n0wall 1.8.0b512) to lock up. We have put the project on ice until we get a new firewall.</p>
<h3>Audience</h3>
<p>This blog post is intended for IT organizations with the following characteristics</p>
<ul>
<li>use DeployStudio to deploy OS X workstations</li>
<li>have multiple subnets</li>
<li>are uncomfortable having a DeployStudio server span multiple networks (most often these are security concerns; by compromising the DeployStudio server, a hacker would gain access to <em>all</em> the networks) (a DeployStudio server <em>must</em> run several services, at least one of which, NFS, requires discipline to implement in a secure manner)</li>
<li>use an ISC DHCP server</li>
<li>are willing to put their firewall to the test</li>
</ul>
<h3>The easy way</h3>
<p>See Ryan&#8217;s comments below.  With a few lines of Cisco configuration (assuming you have a Cisco router), you can easily configure DeployStudio boots across subnets.</p>
<p>The rest of this blog post is the much more difficult path that I took, and I don&#8217;t recommend it unless you really enjoy doing things the hard way.</p>
<h3>The Hard Way: Start with tcpdump</h3>
<p>To make DeployStudio work across subnets, you first need to use tcpdump to capture how it works within a subnet. In this case, we used a laptop (kate-enet), and our DeployStudio server (deploystudio).</p>
<p>First, we started the capture. We captured to a file so that we could examine the output at our leisure. We ran the following command on our deploystudio server:</p>
<pre><code>sudo tcpdump -w /tmp/kate.tcp -s 1536 host kate-enet
</code></pre>
<p>Next, we started a network install:</p>
<ul>
<li>we turned on kate-enet (a 13&#8243; MacBook Air laptop with a thunderbolt ethernet adapter)</li>
<li>we held down the option-key so that we were presented with a choice of boot options</li>
<li>we chose the network install</li>
<li>when DeployStudio runtime screen came up, we ctrl-c&#8217;d the tcpdump—we had what we needed.</li>
</ul>
<p>Then we examined the tcpdump file using the following command:</p>
<pre><code>sudo tcpdump -r /tmp/kate.tcp -vvv | less
</code></pre>
<p>There were two packets we were particularly interested in:</p>
<pre><code>deploystudio.sf.pivotallabs.com.bootps &gt; kate-enet.sf.pivotallabs.com.bootpc: [bad udp cksum 2b5a!] BOOTP/DHCP, Reply, length 319, Flags [none] (0x0000)
      Client-IP kate-enet.sf.pivotallabs.com
      Client-Ethernet-Address 40:6c:8f:3d:e6:b4 (oui Unknown)
      Vendor-rfc1048 Extensions
        Magic Cookie 0x63825363
        DHCP-Message Option 53, length 1: ACK
        Server-ID Option 54, length 4: deploystudio.sf.pivotallabs.com
        Vendor-Class Option 60, length 9: "AAPLBSDPC"
        Vendor-Option Option 43, length 56: 1.1.1.4.2.127.209.7.4.130.0.4.56.8.4.130.0.4.56.9.35.130.0.4.56.30.49.48.46.56.95.109.97.99.95.109.105.110.105.95.115.101.114.118.101.114.45.50.48.49.50.45.48.56.48.54
        END Option 255, length 0
</code></pre>
<p>And</p>
<pre><code>deploystudio.sf.pivotallabs.com.bootps &gt; kate-enet.sf.pivotallabs.com.bootpc: [bad udp cksum 254b!] BOOTP/DHCP, Reply, length 379, Flags [none] (0x0000)
      Client-IP kate-enet.sf.pivotallabs.com
      Server-IP deploystudio.sf.pivotallabs.com
      Client-Ethernet-Address 40:6c:8f:3d:e6:b4 (oui Unknown)
      sname "deploystudio.sf.pivotallabs.com"
      file "/private/tftpboot/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/i386/booter"
      Vendor-rfc1048 Extensions
        Magic Cookie 0x63825363
        DHCP-Message Option 53, length 1: ACK
        Server-ID Option 54, length 4: deploystudio.sf.pivotallabs.com
        Vendor-Class Option 60, length 9: "AAPLBSDPC"
        RP Option 17, length 93: "nfs:10.80.28.64:/Library/NetBoot/NetBootSP0:10.8_mac_mini_server-2012-0806.nbi/NetInstall.dmg"
        Vendor-Option Option 43, length 21: 1.1.2.8.4.130.0.4.56.130.10.78.101.116.66.111.111.116.48.53.48
        END Option 255, length 0
</code></pre>
<p>Note:</p>
<ul>
<li>You can ignore any &#8216;bad cksum&#8217; messages: those messages are an artifact of the checksums being calculated by the ethernet hardware (<a href="http://en.wikipedia.org/wiki/TCP_checksum_offload#checksum_offload">TCP checksum offloading</a>) instead of by the kernel.</li>
<li>deploystudio responds to DHCP queries <em>even though it is not a DHCP server</em>. It is not dishing out IP addresses; it is merely providing additional data for netbooting to work.</li>
</ul>
<p>There are 4 crucial pieces of data that you must capture.</p>
<ul>
<li>The <strong>file</strong> directive</li>
<li>The <strong>RP Option 17</strong></li>
<li>The two <strong>Vendor-Option Option 43</strong></li>
</ul>
<p>We then added the information we had culled from the tcpdump to our dhcpd.conf file (special thanks to Pepijn Oomen and Bennett Perkins; see bibliography):</p>
<pre><code>class "netboot" {
    match if substring (option vendor-class-identifier, 0, 9) = "AAPLBSDPC";
    option dhcp-parameter-request-list 1,3,17,43,60;

    if (option dhcp-message-type = 1) {
        option vendor-class-identifier "AAPLBSDPC";
        option vendor-encapsulated-options
            08:04:81:00:00:89;    # bsdp option 8 (length 04) -- selected image id;
    } elsif (option dhcp-message-type = 8) {
        option vendor-class-identifier "AAPLBSDPC";
        if (substring(option vendor-encapsulated-options, 0, 3) = 01:01:01) {
            log(debug, "bsdp_msgtype_list");

            # bsdp image list message:
            # one image, plus one default image (both are the same)
            option vendor-encapsulated-options
                01:01:01:04:02:7f:d2:07:04:82:00:04:38:09:23:82:00:04:38:1e:31:30:2e:38:5f:6d:61:63:5f:6d:69:6e:69:5f:73:65:72:76:65:72:2d:32:30:31:32:2d:30:38:30:36;

        } else {
            log(debug, "bspd_msgtype_select");

            # details about the selected image
            #
            option vendor-encapsulated-options
                01:01:02:08:04:82:00:04:38:82:0a:4e:65:74:42:6f:6f:74:30:35:30;

            next-server deploystudio.sf.pivotallabs.com;
            filename "/private/tftpboot/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/i386/booter";
            option root-path = "nfs:10.0.0.64:/Library/NetBoot/NetBootSP0:10.8_mac_mini_server-2012-0806.nbi/NetInstall.dmg";
        }
    }
}
</code></pre>
<p>Resist the temptation to substitute a hostname for the NFS server&#8217;s IP address; (i.e. leave it &#8220;nfs:10.0.0.64&#8243;; do not put &#8220;nfs:deploystudio.sf.pivotallabs.com&#8221;). IP addresses will work; hostnames won&#8217;t.</p>
<p>We used ruby (irb) to convert the dotted-decimal strings in tcpdump to colon-hexadecimal in dhcpd.conf. In the following example, we convert &#8220;1.1.2.8.4.130.0.4.56.130.10.78.101.116.66.111.111.116.48.53.48&#8243;:</p>
<pre><code> bc$ irb
1.9.3p194 :001 &gt; string="1.1.2.8.4.130.0.4.56.130.10.78.101.116.66.111.111.116.48.53.48"
 =&gt; "1.1.2.8.4.130.0.4.56.130.10.78.101.116.66.111.111.116.48.53.48"
1.9.3p194 :002 &gt; string.split(".").each { |n| printf("%02x:",n) }; p
01:01:02:08:04:82:00:04:38:82:0a:4e:65:74:42:6f:6f:74:30:35:30: =&gt; nil
</code></pre>
<h2>Firewall Rules</h2>
<p>If you have a firewall arbitrating traffic between the subnets, you&#8217;ll need to allow all inbound traffic to your DeployStudio server. Additionally, if your firewall can&#8217;t snoop TFTP traffic, you&#8217;ll need to allow outbound UDP traffic on unreserved ports (1024 &#8211; 65535).</p>
<h2>Troubleshooting</h2>
<p>If you&#8217;re having problems, you need to check that your TFTP and NFS are working, preferably from a machine that&#8217;s on the subnet of the client which your trying to image.</p>
<h3>TFTP</h3>
<p>In our example, we know that our tftp server is deploystudio.sf.pivotallabs.com, and the file we&#8217;re downloading is /private/tftpboot/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/i386/booter. Let&#8217;s try from the command line:</p>
<pre><code>bc $ tftp deploystudio.sf.pivotallabs.com
tftp&gt; get /private/tftpboot/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/i386/booter
Received 993680 bytes in 18.3 seconds
</code></pre>
<h3>NFS</h3>
<p>Testing NFS is a little tricky because the NFS path is slightly mangled. Specifically, a &#8220;:&#8221; is substituted for the second-to-last &#8220;/&#8221; in the pathname. For example, the dhcp root-path directive &#8220;nfs:10.80.28.64:/Library/NetBoot/NetBootSP0:10.8_mac_mini_server-2012-0806.nbi/NetInstall.dmg&#8221;<br />
is translated to a pathname of &#8220;/net/10.80.28.64/Library/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/NetInstall.dmg&#8221; <em>for testing purposes on a client machine</em>. We take advantage of automount running on a typical OS X client. First do an <em>ls</em> to make sure we can see the file, then do a <em>cp</em> to make sure we can read the file:</p>
<pre><code> ls /net/10.80.28.64/Library/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/NetInstall.dmg
 cp /net/10.80.28.64/Library/NetBoot/NetBootSP0/10.8_mac_mini_server-2012-0806.nbi/NetInstall.dmg /dev/null
</code></pre>
<h2>Performance</h2>
<p>The time required to image a machine will more than double. A typical install will take 40 minutes or more.</p>
<h3>Initial Boot-up</h3>
<p>Certain operations are much slower. Specifically, the time between selecting netboot server and being presented with the DeployStudio runtime screen takes approximately 7 minutes. We have studied that lag, and over 4 minutes is due to abysmal (3.8kBps) TFTP throughput. We are unclear why there is such a gross lag; running the same tftp on the command line completes 20x faster (74.7kBps).</p>
<p>We have a firewall that negotiates traffic between our subnets, and we are aware that TFTP provides challenges for firewalls (it re-negotiates its destination port) (Cisco firewalls have <a href="http://www.cisco.com/en/US/docs/security/pix/pix63/configuration/guide/fixup.html#wp1118544">special directives</a> to handle TFTP traffic appropriately).</p>
<h2>Bibliography</h2>
<ul>
<li><a href="http://bennettp123.com/2012/05/05/booting-imac-12,1-from-isc-dhcp">Bennett Perkins&#8217;s</a> blog post</li>
<li><a href="http://blog.piprograms.com/2009/07/09/booting-macmini3-1-from-isc-dhcpd">Pepijn Oomen&#8217;s</a> blog post</li>
<li>TFTP <a href="http://tools.ietf.org/html/rfc1350">RFC</a></li>
</ul>
<p>The post <a href="http://pivotallabs.com/using-deploystudio-across-subnets-a-path-not-taken/">Using DeployStudio Across Subnets—a Path not Taken</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/using-deploystudio-across-subnets-a-path-not-taken/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Shunting Ethernet Guests to a &quot;Safe&quot; Network</title>
		<link>http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/</link>
		<comments>http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/#comments</comments>
		<pubDate>Thu, 27 Sep 2012 21:52:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[ops]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/</guid>
		<description><![CDATA[<p><h2>Abstract</h2>

<p>On occasion a non-employee will need to connect their laptop to our ethernet network, which begs the question, "How do we allow customers to access our network while protecting our workstations?"</p>

<p>The short answer is that we use a combination of <a href="http://en.wikipedia.org/wiki/VLAN_Management_Policy_Server">VMPS</a>-capable switches, VMPS software, <a href="http://en.wikipedia.org/wiki/VLAN">VLANs</a>, DNS, and DHCP.  And, of course, reasonably stringent firewall rules.</p>

<p>We are a Software Services company, and at any given moment 40% of the 200-odd people in our San Francisco office are not employees.  Of those 80 people, 98% of them can access the guest WiFi network without a problem.  There are, however, the remaining 2% who, for whatever reason &#40;their WiFi chipset doesn't interoperate well with our WiFi Access Points, their wireless is broken, they've accidentally deleted their drivers, etc...&#41; cannot connect to the WiFi.  They need to access the Internet, and they can only use ethernet.</p>

<p>We want to give our guests ethernet connectivity when needed, but not in such a way that it jeopardizes the security of our workstations.</p> <a href="http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/">Shunting Ethernet Guests to a &quot;Safe&quot; Network</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Abstract</h2>
<p>On occasion a non-employee will need to connect their laptop to our ethernet network, which begs the question, &#8220;How do we allow customers to access our network while protecting our workstations?&#8221;</p>
<p>The short answer is that we use a combination of <a href="http://en.wikipedia.org/wiki/VLAN_Management_Policy_Server">VMPS</a>-capable switches, VMPS software, <a href="http://en.wikipedia.org/wiki/VLAN">VLANs</a>, DNS, and DHCP.  And, of course, reasonably stringent firewall rules.</p>
<p>We are a Software Services company, and at any given moment 40% of the 200-odd people in our San Francisco office are not employees.  Of those 80 people, 98% of them can access the guest WiFi network without a problem.  There are, however, the remaining 2% who, for whatever reason &#40;their WiFi chipset doesn&#8217;t interoperate well with our WiFi Access Points, their wireless is broken, they&#8217;ve accidentally deleted their drivers, etc&#8230;&#41; cannot connect to the WiFi.  They need to access the Internet, and they can only use ethernet.</p>
<p>We want to give our guests ethernet connectivity when needed, but not in such a way that it jeopardizes the security of our workstations.</p>
<h3>Audience</h3>
<p>This article is directed to IT organizations</p>
<ul>
<li>That have smart switches that are VMPS-capable</li>
<li>That have *NIX-based DNS &amp; DHCP servers</li>
<li>That have guests that need need ethernet access</li>
<li>That have a requirement to quarantine their guests&#8217; machines</li>
<li>That are willing to record the MAC address of every device on their network &#40;i.e. not their guests&#8217; devices, just their own&#41;</li>
</ul>
<h2>Steps</h2>
<p>These are the steps to go through.</p>
<p>First, we assume you have already set up your VLANS, and have entered them into your ethernet switch&#40;es&#41;. These are our VLANs &#40;note: the IP addresses and subnet masks are simplified for purposes of our discussion&#41;:</p>
<pre><code>VLAN    Name            IP
1       default         10.0.1.0/24
2       SERVER          10.0.2.0/24
3       PAIRING_DMZ     10.0.3.0/24
4       VOIP            10.0.4.0/24
5       PIVOTAL_WIFI    10.0.5.0/24
6       PIVOTAL_GUEST   10.0.6.0/24
7       SECURITY        10.0.7.0/24
8       COMMON          10.0.8.0/24
</code></pre>
<p>Note VLAN 6 &#40;<em>PIVOTAL_GUEST</em>&#41;; this is the VLAN we&#8217;ll use to quarantine our guests.</p>
<p>Secondly, you&#8217;ll need to configure your switches.  In our case, we have Cisco 2960G 48-port switches, which requires enabling both <a href="http://en.wikipedia.org/wiki/VLAN_Trunking_Protocol">VTP</a> and VMPS.</p>
<p>We&#8217;ll need to configure one switch as the VTP server, and the remaining switches as the VTP clients. We used the following commands to configure the server:</p>
<pre><code>sw-00#config term
Enter configuration commands, one per line.  End with CNTL/Z.
sw-00&#40;config&#41;#vtp mode server
sw-00&#40;config&#41;#vtp version 2
sw-00&#40;config&#41;#vtp domain sf.pivotallabs.com
sw-00&#40;config&#41;#vmps server 10.0.1.16 primary
sw-00&#40;config&#41;#end
</code></pre>
<p>You&#8217;ll need to configure the remaining switches as follows:</p>
<pre><code>sw-01#config term
Enter configuration commands, one per line.  End with CNTL/Z.
sw-01&#40;config&#41;#vtp mode client
sw-01&#40;config&#41;#vmps retry 5
sw-01&#40;config&#41;#vmps server 10.0.1.16 primary
sw-01&#40;config&#41;#end
</code></pre>
<p>Then you&#8217;ll need to set up your VMPS server on your *NIX box:</p>
<ul>
<li>The VMPS server must be reachable from every switch on the network.  In our case, we decided to run the VMPS daemon on our DNS/DHCP server &#40;10.0.1.16&#41;.</li>
<li>We used Dori Seliskar&#8217;s <a href="http://sourceforge.net/projects/vmps/">OpenVMPS</a>.  It installed fairly easily on our FreeBSD 8.3 machine.</li>
</ul>
<p>The commands to install:</p>
<pre><code>curl -L http://sourceforge.net/projects/vmps/files/latest/download  | tar xzvf -
cd vmpsd-1.4.04
bash configure
make
sudo make install
</code></pre>
<h3>VMPS Server Configuration</h3>
<p>We replaced the VMPS server configuration file &#40;/usr/local/etc/vlan.db&#41; with the following &#40;truncated &#40;we only show 8 address records of the full 381&#41; and edited for readability&#41;:</p>
<pre><code>vmps domain sf.pivotallabs.com
vmps mode open
vmps fallback PIVOTAL_GUEST
vmps no-domain-req deny

vmps-mac-addrs

! address &lt;addr&gt; vlan-name &lt;vlan_name&gt; ! comment
address 0022.4d6b.dead vlan-name SECURITY ! nvr
address 3c07.545c.beef vlan-name CUST_2 ! bartol
address 001f.f352.dead vlan-name default ! adair
address c82a.1414.beef vlan-name PAIRING_DMZ ! aerial
address f0de.f134.dead vlan-name FINANCE ! bill-thinkpad
address 001b.781d.beef vlan-name COMMON ! goldfinger
address 0004.f234.dead vlan-name VOIP ! voip-ash
</code></pre>
<p>The important things to note about this file are the following:</p>
<ul>
<li>You should customize the VMPS domain &#40;i.e.  <em>sf.pivotallabs.com</em>&#41; to match your site.  It must also match the VTP domain configured on your switches.  You are not required to use DNS domain-format.</li>
<li>The <em>fallback PIVOTAL_GUEST</em> directive is crucial:  it shunts all unrecognized MAC addresses onto the PIVOTAL_GUEST VLAN.</li>
<li>The VLANs &#40;e.g. PIVOTAL_GUEST, VOIP, COMMON&#41; must be defined on the switches; use the IOS command <em>show vlan</em> to determine which VLANs have been defined.</li>
<li>The MAC addresses are in Cisco notation &#40;e.g. c82a.1414.beef&#41; not IEEE 802 notation &#40;e.g. c8:2a:14:14:be:ef&#41;.</li>
<li>An exclamation mark &#40;&#8221;<strong>!</strong>&#8220;&#41; and everything following it are ignored &#40;i.e. used for comments&#41;.</li>
<li>We do <strong>not</strong> record the MAC addresses of our WiFi clients; by connecting to the WiFi they are automatically restricted to the appropriate VLAN &#40;PIVOTAL_WIFI in the case of employees, PIVOTAL_GUEST in the case of guests&#41;.</li>
</ul>
<h2>Customizations</h2>
<p>We additionally did the following:</p>
<ul>
<li>wrote a start-up script so that the vmpsd daemon would start on reboot</li>
<li>wrote a script which created the vlan.db based on the MAC addresses culled from our DHCP tables</li>
<li>modified our Makefile &#40;we use <em>make</em> to build our DNS &amp; DHCP files&#41; to include the building of our VMPS file &#40;<em>vlan.db</em>&#41;</li>
</ul>
<h2>Gotchas</h2>
<ul>
<li>Treat your vlan.db file with care.  On the second day of our roll-out, we accidentally truncated our vlan.db file.  The effect was the a subset of people lost connectivity &#40;their workstations had been shunted off to the guest VLAN, but  retained the IP address from their previous VLAN &#40;their DHCP lease had not expired&#41;.  Net result: it was as if someone had yanked out their ethernet cable&#41;.</li>
<li>Small desktop switches are unusable if two of the devices on the switch are on different VLANs.  For example, we plugged an IP Phone &#40;VLAN 4, VOIP&#41; and a Mac Mini &#40;VLAN 1, PIVOTAL&#41; into the same desktop switch, and made a phone call while doing a download.  Our experience:  the download would freeze while the phone conversation was fine.  A few seconds later, the phone conversation would cut off while the download suddenly started up again.  A few seconds after that, the phone call would resume and the download would freeze.</li>
<li>Similarly, a user of virtualization software &#40;e.g. VMware, VirtualBox, Xen, Linux KVM&#41; who bridges &#40;instead of NATs&#41; their VM&#8217;s network interface will suffer as the ethernet switch ping-pongs their interface between the guest network and their normal network. </li>
<li>This [solution] is not Fort Knox.  For example, a canny hacker could clone a MAC address of one of our workstations and use that to access our network.</li>
<li>It takes a fair amount of IT discipline to record the MAC address of every ethernet device.</li>
</ul>
<h2>Bibliography</h2>
<ul>
<li><a href="http://www.cisco.com/en/US/docs/switches/lan/catalyst2960/software/release/15.0_2_se/configuration/guide/2960_scg.pdf">Cisco 2960 Documentation</a></li>
</ul>
<h2>Acknowledgements</h2>
<p>I would like to thank <a href="http://www.tenebras.com">Michael Sierchio</a> for doing the lion&#8217;s share of the work, and Colin Deeb for fixing problems during the roll-out.</p>
<p>The post <a href="http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/">Shunting Ethernet Guests to a &quot;Safe&quot; Network</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/shunting-ethernet-guests-to-a-safe-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing the Packages that underlie Apple&#8217;s App Store</title>
		<link>http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/</link>
		<comments>http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/#comments</comments>
		<pubDate>Tue, 11 Sep 2012 00:28:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[ops]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/</guid>
		<description><![CDATA[<p><p>Apple uses its App Store as a mechanism to distribute software, and it works quite well when a human operator is available to interact with it.</p>

<p>Unfortunately, many configuration management tools &#40;e.g. chef, puppet&#41; can't interact with the App Store, but they <em>can</em> interact with MAC OS X installer packages &#40;.pkg, .mpkg files&#41;.  We'll show you how to extract the underlying installer package file from the App Store.</p>

<p>This was tested under OS X 10.8.1 installing the OS X server package.  It may not work for other packages.</p> <a href="http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/">Accessing the Packages that underlie Apple&#8217;s App Store</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Apple uses its App Store as a mechanism to distribute software, and it works quite well when a human operator is available to interact with it.</p>
<p>Unfortunately, many configuration management tools &#40;e.g. chef, puppet&#41; can&#8217;t interact with the App Store, but they <em>can</em> interact with MAC OS X installer packages &#40;.pkg, .mpkg files&#41;.  We&#8217;ll show you how to extract the underlying installer package file from the App Store.</p>
<p>This was tested under OS X 10.8.1 installing the OS X server package.  It may not work for other packages.</p>
<h1>Procedure</h1>
<p>Bring up the App Store,  find the package you would like to install, install it, and as soon as it starts downloading, jump to a terminal window and stop the installd daemon by sending it a STOP signal:</p>
<pre><code>sudo killall -STOP installd
</code></pre>
<p>Find out where the package file was downloaded to using the lsof command:</p>
<pre><code>sudo lsof | grep storeagen | grep pkg
</code></pre>
<p>The pathname should be a long and fairly random string, similar to &#8220;/private/var/folders/83/5wx556bd59zbj0n2j0w7kjyc0000gn/C/com.apple.appstore/537441259/mzm.unntdyyb.pkg&#8221;.  You&#8217;ll need to move that file to the appropriate location.</p>
<pre><code>mv /private/var/folders/83/5wx556bd59zbj0n2j0w7kjyc0000gn/C/com.apple.appstore/537441259/mzm.unntdyyb.pkg ~/os_x_server.pkg
</code></pre>
<p>Now that we&#8217;ve moved the package to a safe place &#40;and inadvertently pulled the rug out from under the installd daemon&#41;, we&#8217;re ready to let the installd daemon continue and generate an error message:</p>
<pre><code>sudo killall -CONT installd
</code></pre>
<p>Ignore the error message about a failed install.</p>
<p>The package would be subsequently installed by using the installer command, e.g.:</p>
<pre><code>sudo installer -pkg ~/os_x_server.pkg -target /
</code></pre>
<p>The post <a href="http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/">Accessing the Packages that underlie Apple&#8217;s App Store</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/accessing-the-packages-that-underlie-apple-s-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering OS X Open Directory from Backup</title>
		<link>http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/</link>
		<comments>http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 18:07:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[open directory]]></category>
		<category><![CDATA[ops]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/</guid>
		<description><![CDATA[<p><h2>Lost Open Directory Database</h2>

<p>You've lost your Open Directory server database.  You need to recover it, but you don't have an Open Directory Archive, and you don't have a replica that you can promote.  And you don't want to restore the entire server, either.</p>

<p>This blog post covers how to restore an Open Directory database from backup.</p>

<h2>Audience</h2>

<p>This blog post is directed towards system administrators</p>

<ul>
<li>who have an Open Directory Server that is running OS X Snow Leopard 10.6.8 &#40;this procedure would probably run under other versions of Snow Leopard, but we haven't tested it&#41;</li>
<li>who do <em>not</em> have a replica that they can promote</li>
<li>who do <em>not</em> have a conventional Open Directory backup &#40;i.e. Server Admin &#8594; Open Directory &#8594; Archive&#41;</li>
<li>who want to do a surgical restore of <em>just</em> the Open Directory; who do not want to touch the other parts of the system</li>
<li>who have backed up their files.</li>
</ul>

<h2>Disclaimer</h2>

<p>This procedure worked for us; it may not work for you.  YMMV. There is no warranty, express or implied.  This is <em>by no means</em> an Apple-approved procedure.</p> <a href="http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/">Recovering OS X Open Directory from Backup</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Lost Open Directory Database</h2>
<p>You&#8217;ve lost your Open Directory server database. You need to recover it, but you don&#8217;t have an Open Directory Archive, and you don&#8217;t have a replica that you can promote. And you don&#8217;t want to restore the entire server, either.</p>
<p>This blog post covers how to restore an Open Directory database from backup.</p>
<h2>Audience</h2>
<p>This blog post is directed towards system administrators</p>
<ul>
<li>who have an Open Directory Server that is running OS X Snow Leopard 10.6.8 (this procedure would probably run under other versions of Snow Leopard, but we haven&#8217;t tested it)</li>
<li>who do <em>not</em> have a replica that they can promote</li>
<li>who do <em>not</em> have a conventional Open Directory backup (i.e. Server Admin → Open Directory → Archive)</li>
<li>who want to do a surgical restore of <em>just</em> the Open Directory; who do not want to touch the other parts of the system</li>
<li>who have backed up their files.</li>
</ul>
<h2>Disclaimer</h2>
<p>This procedure worked for us; it may not work for you. YMMV. There is no warranty, express or implied. This is <em>by no means</em> an Apple-approved procedure.</p>
<h2>Open Directory</h2>
<p>Open Directory is a tightly integrated application that includes OpenLDAP, kerberos, and Apple&#8217;s password service. For a successful recovery, you need to restore the records for all 3 services.</p>
<h2>Procedure</h2>
<p>Your Open Directory Server needs to be configured as a server (not replica). If it&#8217;s configured as a replica, re-configure it as a standalone server before you begin.</p>
<p>First, shut down the relevant daemons (slapd/OpenLDAP, kerberos, Password Service).</p>
<pre><code>sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist sudo launchctl unload /System/Library/LaunchDaemons/edu.mit.Kerberos.kadmind.plist sudo launchctl unload /System/Library/LaunchDaemons/edu.mit.Kerberos.krb5kdc.plist sudo launchctl unload /System/Library/LaunchDaemons/com.apple.PasswordService.plist </code></pre>
<p>Check to make sure the processes aren&#8217;t running (we&#8217;re being very careful, maybe even paranoid):</p>
<pre><code>ps auxwww | egrep "slapd|kadmin|krb5|Pass" </code></pre>
<p>Move the old files out of the way:</p>
<pre><code>sudo mv -i /var/db/openldap{,-broke} sudo mv -i /var/db/krb5kdc{,-broke} sudo mv -i /var/db/authserver{,-broke} sudo mv -i /etc/krb5.keytab{,-broke} sudo mv -i /Library/Preferences/edu.mit.Kerberos{,-broke} </code></pre>
<p>Restore the files from backup (your backup directory, e.g. &#8220;/Volumes/Backup/yesterday&#8221;, may differ):</p>
<pre><code>sudo rsync -avH /Volumes/Backup/yesterday/private/var/db/openldap /var/db/ sudo rsync -avH /Volumes/Backup/yesterday/private/var/db/krb5kdc /var/db/ sudo rsync -avH /Volumes/Backup/yesterday/private/var/db/authserver /var/db/ sudo rsync -avH /Volumes/Backup/yesterday/private/etc/krb5.keytab /etc/ sudo rsync -avH /Volumes/Backup/yesterday/Library/Preferences/edu.mit.Kerberos /Library/Preferences/ </code></pre>
<p>Double-check that they&#8217;re in place (yes, paranoia again):</p>
<pre><code>sudo ls -l /var/db/{krb5kdc,openldap,authserver} /etc/krb5.keytab /Library/Preferences/edu.mit.Kerberos </code></pre>
<p>Reboot the machine:</p>
<pre><code> sudo shutdown -r now </code></pre>
<p>When the machine comes up, you should have recovered your Open Directory database to the same state as it was when you performed your backup.</p>
<p>Good luck.</p>
<p>The post <a href="http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/">Recovering OS X Open Directory from Backup</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/recovering-os-x-opendirectory-from-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Headless &amp;&amp; Head OK</title>
		<link>http://pivotallabs.com/headless-head-ok/</link>
		<comments>http://pivotallabs.com/headless-head-ok/#comments</comments>
		<pubDate>Fri, 15 Jun 2012 14:25:00 +0000</pubDate>
		<dc:creator>Brian Cunnie</dc:creator>
				<category><![CDATA[Standup]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/headless-head-ok/</guid>
		<description><![CDATA[<p><h2>Helps</h2>

<ul>
<li>asset pipeline testing with RSpec render_views</li>
</ul>

<p>I'm trying to test the asset pipeline configuration in our project. I've tweaked our test environment to it won't automatically compile assets;</p>

<p>environments/test.rb:
...
if ENV['ASSET_PIPELINE']
  config.assets.compile = false
else
  config.assets.compile = true
end
...</p>

<p>alas in controller specs that have render_views, breaks:</p>

<p>ActionView::Template::Error:
  controllers/application.js isn't precompiled.</p>

<p>&#40;which is not true&#41;</p>

<p>in most cases I can remove render_views, but that's not ideal.</p>

<p>--</p>

<p>To fix it, make sure <code>digest</code> is true.</p>

<ul>
<li>capybara-webkit + headless + lobot CI => Locking assertion failure</li>
</ul>

<p>Tried sloppy locking and downgrading libx11 to 1.0.3, but no success.</p>

<p>Probably a Qt error, make sure Qt is 4.8.1 or 4.8.2 or try recompiling Qt or dependencies.</p>

<h2>Interestings</h2>

<ul>
<li>rake db:test:prepare with spork</li>
</ul>

<p>We got frustrated having to shut down spork every time we wanted to run a migration.</p>

<p>We dug in, and found that we needed to close the ActiveRecord::Base connections in the prefork block.  ActiveRecord automatically reestablishes the connection post fork.</p>

<p>We opened a pull request on spork-rails with the fix:
https://github.com/sporkrb/spork-rails/pull/9</p>

<ul>
<li>javascript:</li>
</ul>

<p>Chrome and other browsers are now stripping out 'javascript:' from the beginning of urls  that are pasted into the addressbar.  This is not a problem with links that start with 'javascript:'</p>

<ul>
<li>Head OK, empty body, JQuery == bad mixture</li>
</ul>

<p>"Head OK" with an empty body returns a single space &#38; confuses JQuery because a single-space string is invalid JSON.  A work-around is to set the content-type to NOT be application/json.  Or render :text => '' or render :json => {}</p> <a href="http://pivotallabs.com/headless-head-ok/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/headless-head-ok/">Headless &amp;&amp; Head OK</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Helps</h2>
<ul>
<li>asset pipeline testing with RSpec render_views</li>
</ul>
<p>I&#8217;m trying to test the asset pipeline configuration in our project. I&#8217;ve tweaked our test environment to it won&#8217;t automatically compile assets;</p>
<p>environments/test.rb:<br />
&#8230;<br />
if ENV['ASSET_PIPELINE']<br />
  config.assets.compile = false<br />
else<br />
  config.assets.compile = true<br />
end<br />
&#8230;</p>
<p>alas in controller specs that have render_views, breaks:</p>
<p>ActionView::Template::Error:<br />
  controllers/application.js isn&#8217;t precompiled.</p>
<p>&#40;which is not true&#41;</p>
<p>in most cases I can remove render_views, but that&#8217;s not ideal.</p>
<p>&#8211;</p>
<p>To fix it, make sure <code>digest</code> is true.</p>
<ul>
<li>capybara-webkit + headless + lobot CI => Locking assertion failure</li>
</ul>
<p>Tried sloppy locking and downgrading libx11 to 1.0.3, but no success.</p>
<p>Probably a Qt error, make sure Qt is 4.8.1 or 4.8.2 or try recompiling Qt or dependencies.</p>
<h2>Interestings</h2>
<ul>
<li>rake db:test:prepare with spork</li>
</ul>
<p>We got frustrated having to shut down spork every time we wanted to run a migration.</p>
<p>We dug in, and found that we needed to close the ActiveRecord::Base connections in the prefork block.  ActiveRecord automatically reestablishes the connection post fork.</p>
<p>We opened a pull request on spork-rails with the fix:</p>
<p>https://github.com/sporkrb/spork-rails/pull/9</p>
<ul>
<li>javascript:</li>
</ul>
<p>Chrome and other browsers are now stripping out &#8216;javascript:&#8217; from the beginning of urls  that are pasted into the addressbar.  This is not a problem with links that start with &#8216;javascript:&#8217;</p>
<ul>
<li>Head OK, empty body, JQuery == bad mixture</li>
</ul>
<p>&#8220;Head OK&#8221; with an empty body returns a single space &amp; confuses JQuery because a single-space string is invalid JSON.  A work-around is to set the content-type to NOT be application/json.  Or render :text => &#8221; or render :json => {}</p>
<p>The post <a href="http://pivotallabs.com/headless-head-ok/">Headless &amp;&amp; Head OK</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/headless-head-ok/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using apc
Database Caching 2/9 queries in 0.034 seconds using apc
Object Caching 1116/1210 objects using apc

 Served from: pivotallabs.com @ 2013-05-22 11:10:29 by W3 Total Cache -->