Setting up your Mac for .NET development

Last night I spent a few hours getting my Windows virtualization setup so I could use Visual Studio from the Mac. It ended up being way cooler and easier than I thought. All it requires is two simple things, Parallels and mklink.

Parallels

I was hesitant about paying $79 for virtualization software when other software like VirtualBox is completely free. My advice, try the free trial of Parallels and you will understand why it is worth the price.

It allows you to create shortcuts to Windows apps in the Mac Dock.

Integrates the Windows task bar with the Mac menu bar.

Putting it all together, you get to run Windows apps right beside Mac apps in what Parallels calls Coherence mode.

Some other notable features are:

  • Integration with Bootcamp partition
  • Integration with Windows start meu
  • Much more…

The overall performance is good. I noticed some slowness when dragging windows around, but for everyday usage, it runs great. There are some oddities of using Parallels in Coherence mode, but no deal breakers. I definitely recommend it because of the low overhead in context switching between Mac and Windows applications.

mklink

Even with Parallels, Windows runs on a different filesystem than the Mac. It does offer shared profiles, but I only wanted to share my Visual Studio project files.

mklink is a tool I had never used until last night. For those of you familiar with Linux, it is simliar to the ln command. Here is how I used it.

mklink /d "c:\Users\Brian\Documents\Visual Studio 2008\Projects" \\.psf\Home\Documents\Projects

What this simple command will do is create a symbolic to my Mac home folder for all Visual Studio projects. From Windows, it works like a normal folder.

Now, I can easily code side by side in TextMate and Visual Studio straight from OSX.

Zero to Synergy+ in 5 minutes

Synergy+ is most easily described as a software KVM. In reality, it is much more than that. It is more like having multiple monitors, except each monitor is actually attached to its own computer. Synergy+ is a fork of the original project, which hasn’t been updated since 2006.

Enough with the chit-chat, lets get it up and running on Windows in no time.

Install

Install – Done.

Configure – Server side

This is the confusing part. I will take you through the GUI, which doesn’t exist for the Mac or Linux as far as I could tell.

Start Synergy and select the Share this computer’s keyboard and mouse (server) option. Then click Configure.

From there, the next step is adding the screens, which represent the different computers you want connected. Click the + to get going.

First, enter your local computer information. Seems weird that it didn’t add it by default, but it doesn’t. Basically, all you need to enter is your computers name (which can be found/changed on the Synergy Info button on the main configuration screen).

Next, enter in the client computer’s names that you will be connecting.

From there you need to create links. Links tell Synergy how one screen should be linked to another (seems obvious huh). In our example we have two screens, so we need two links. One link will connect Screen 1 to Screen 2, while the other does the reverse.

Configuring the link is a mind trip, so much so that I can’t even describe how to do it. I suggest ignoring the size percentages, and create a sentence like left of Screen 1 of Screen 2. Then click +. After this, it becomes more obvious what you did (just trust me please).

Then the reverse.

Now just Start the server and your server config is basically done.

Configure – Client

The client really doesn’t require any configuration. Just select the Use another computer’s keyboard and mouse (client) option, then enter the server name and click Start

And now for my super sweet home-made video.

Next Steps

Read through the Synergy wiki, which will help you on more complicated setups on Mac and Linux.

I also noticed a couple things that didn’t work too well.

  • Mouse is sometimes laggy – I think this may be because my server is actually my oldest computer. The lagginess isn’t bad enough for me to not use it however.
  • Print Screen didn’t work too well, which made the capturing of the above screen shots a little cumbersome
  • If your computer locks automatically after a certain time and it isn’t the server, synergy can’t be used to unlock it.

Why the hell can’t I delete that folder?

The other day I heard a coworker cussing about the fact he couldn’t delete a folder. To give him credit, he dual boots Linux and Windows, and has just recently realized Windows is much better. But, Windows doesn’t have sudo rm -f (ignoring chattr +i which I didn’t know about until today).

The problem is easy to solve though.

  • Search for the path of the folder, and you see the process/executable holding onto the file.

Using Windows Live Writer to publish this post

I downloaded Windows Live Writer today and am using it to publish this post.

Why Live Writer and not the WordPress interface?  No real reason.  The nice thing about live writer is I get the benefits of using a desktop app instead of a web app.  It is faster, can work offline, and HTML editing is a bit easier (yes, I am a web developer but it is nice to work a layer above HTML sometimes). 

8-22-2009 11-17-08 AM

Some of the really cool things are it is pulling almost all my data from WordPress.  All my categories, tags, settings are here, which is nice. 

My only question is how is uploading this picture going to work?  If you are reading this, you already know whether it worked or not, unfortunately, I have no clue what is going to happen.

Why UAC sucks?

User Access Control is a good feature. Prohibiting implicit changes to administrative settings is good. Linux has done this for a long time with sudo. But Vista made a good thing annoying.

You have to click Ok every time instead of it realizing you know what your doing. Sudo can remember for a certain amount of time. Although I complain, I can actually live with this downside.

It is ugly and slow. I have a year old machine, that I think is fairly beefy. Even still, my entire screen turns black for a second while the UAC dialog loads. Very annoying.

Elevation is a pain. If I am running a program that needs to do administrative tasks, I usually have to restart. Yes, certain applications elevate easily, but Powershell and Visual Studio don’t. Why should I have to run them as an admin? Can’t I just elevate permissions as necessary?

I think that UAC solves a security problem but fails in the usability department. I love the concept. I love Vista. I haven’t had a chance to play with Windows 7, but I really hope they improve on some of these areas. Preventing malicious activity is a great thing, it just can’t hinder normal activity.