# Tuesday, 11 November 2008

At Vertica we employ a wide range of Microsoft server products in our solutions to maximize customer value. To help us manage these often complex environments we rely heavily on virtualization. For the longest time the obvious choice was Microsoft Virtual PC simply because it was there and freely available to use and just being able to run a virtual machine was amazing in its own right.

Our default setup when developing in the virtual environment is to install everything needed inside the virtual machine and use that exclusively. Running IIS, a couple of server products with Visual Studio and ReSharper works well but we’ve found that performance leaves something to be desired.

The obvious answer is to move Visual Studio out of the virtual environment, do development on the physical machine, and deploy the code to the virtual environment and test it there. Basically I require two things from this: 1) Pushing the build to the server should be very simple, 2) Debugging must be supported.

Pushing Code

We’ve got a bunch of options for pushing code to another environment: Publish Wizard in Visual Studio, msbuild or nant tasks, Powershell, and my personal favorite bat files :)

I wanted to create a generic solution which doesn’t dictate the use of msbuild or any other technology so I went with a bat file which in turns calls robocopy. With this in place we’re able to push files over the network to the target VM. Of course a one-time configuration of the virtual environment is needed but that isn’t in scope for this thing.

Download my deploy bat file. Basic usage Deploy c:\MyWebSite \\MyServer\MyWebSiteVDir.

Robocopy is part of the Windows Server 2003 Resource Kit.

Remote Debugging

Second requirement is debugging. I want a solution which is on par with running Visual Studio inside the virtual environment and that means debugging people! :)

The steps for doing remote debugging are well documented but for completeness sake I will include them here with nice screenshots to go along.

1) Copy Remote Debugger from \program files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger to somewhere on the virtual machine, e.g. desktop.

2) Run Remote Debugger on virtual machine (msvsmon.exe).

3) Grab the qualifier from the Remote Debugger (You’ll need it in a second).

Remote-Debugger-Qualifier

4) Connect to Remote Debugger from VS on physical machine via Debug > Attach to Process (CTRL + ALT +P)

5) In the Qualifier input field enter the qualifier from Remote Debugger window.

Visual-Studio-Attach-To-Process 

Volia. Set a break point on the remote machine and see the code break in Visual Studio.

VMWare

I stated earlier that we’re using Microsoft Virtual PC which is true but it’s also true that we’re looking into VMWare Workstation. My first reason for doing so is the performance boost which comes from running in VMWare. I haven’t done any sort of scientific testing of how much faster we’re talking about suffice it to say that it’s enough that you notice it when you’re going about your business in the virtual environment. VS is faster, compiles are faster, everything is just smoother. In my book the best sort of performance metric there is :)

Additionally VMWare provides other interesting features. The first one you’ll see is that storing and restoring state of a VM is blazingly fast. Enough so that you’ll actually find yourself using the feature all the time. I know I am.

Secondly VMWare supports multiple monitors. That’s right. Simply select how many monitors you want supported and it’ll do it. You can even switch on the fly. In case you’re wondering, yes, we do have three monitors setup for all the developer machine in the office :)

VMWare-Workstation-Multiple-Monitor-Support

The final feature is significant enough for our story to warrant a paragraph of its own. I accidentally stumbled across it this morning when I upgraded VMWare to version 6.5.

Remote Debugging Support in VMWare

You read my earlier steps to get remote debugging working which will work for any sort of virtual environment. VMWare however brings some nice debugging features to the table available right there in Visual Studio.

1) Goto the menu VMWare and select Attach to Process.

VMWare-Workstation-Debug-in-Virtual-Machine

2) Select the VM you want to start debugging on and point to the Remote Debugger that you’ve got locally in \program files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86.

VMWare-WorkStation-Attach-to-Process-in-Virtual-Machine

3) Click the Attach button and the Remote Debugger will launch inside the VM and you’re ready to debug.

No need to copy anything to the VM. It just works. You can even setup a config for this which enables you to attach to the debugger with F6. Nice!

In conclusion running Visual Studio outside of the VM is not only possible but with the right tools like VMWare in hand it’s even an enjoyable experience. Have fun!

posted on Tuesday, 11 November 2008 10:35:21 (Romance Standard Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, 26 August 2007

VerticaLogo August 2002. I'm getting off the bus ready for my interview. I've had two other interviews that same week which brings my total number of interviews up to four. Four interviews from fourtytwo applications sent to various companies in and around Aarhus. It's been a good week but that doesn't make the track record go away which means I'm nervous, not just nervous but shaking and having trouble focusing on the job at hand nervous.

With these thoughts in my mind I make my way to M. P. Bruunsgade 26 where my interview awaits. In the mail letting me know that I got the interview I've been told to look for a particular brand of photo shop and that the office of the company will be in the same building. Sure enough there it is. I make my way up the stairs and into what I can only describe as an private apartment, not the fancy office I imagined on the bus ride downtown ten minutes earlier.

I'm welcomed by a man who introduces himself as Erik Hougaard, CEO of Vertica. He shows me around the office and points everybody out to me, the whole thing is over in about 15 seconds and I'm whisked into a meeting room with Erik and two other guys whom I'm sure I was just told the names of but my nerves porhibit my brain from actually storing their names so I just archieve them as red haired guy #1 and red haired guy #2*.

Erik tells me a little bit about the company which has only been in existence for about one year and is currently held by five partners working fulltime in the company. Following the introduction I'm sure I'm asked a number of questions pertaining to me personally and technical stuff but I'm just not sure as I've entered crunch mode and my instincts have taken over... As I tune back into reality once more I'm awed by the fact that I've made it through the interview with only the memory of the chequered linolium floor I saw on my way into the meeting room, a brief image of Simon Sayilgan who was to become something of a mentor to me, and the feeling that I botched the interview by answering the question, "do you know about other technical stuff than programming?" with "do you mean stuff like model trains?".

Leaving the office having said my goodbys and thank yous I take heart in the fact that I've got two girls waiting for me in a nearby bar sure to have a cold beer ready for me.

The rest as they say is history. From that fateful summerday in August 2002 I've grown more than I'd imagined possible in such a short time, both technically and personally. My role has evolved from being the student to becoming the mentor bringing new people on board and having a great time doing so. I've moved from trying to grasp the base technologies such as OOP, SQL, .NET in general to building value added products on top of standard products from Microsoft like Commerce Server and SharePoint.

My two proudest achievements range from the code which drives invoicing and money capture for Bolia.com to building a great delveopment team which specializes in building high quality Commerce Server solutions and custom .NET solutions.

I'm lucky to work with top notch people whose technical skills inspire me to develop my own to ever higher levels. With these poeple around me I look forward to meeting the challenges still in store for me at Vertica head on!

* Red haired guys #1 and #2 are actually Sune Hansen and Troels Riisbrich Underlien, partners at Vertica.

posted on Sunday, 26 August 2007 22:16:28 (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback