WinMac – The Ongoing Adventure of Running Windows Server on a Macbook Pro
I posted last week on my decision to ditch the Tablet PC platform and switch to a Macbook Pro. Unlike many others who run some flavor of Windows in conjunction with the Mac OS, I have absolutely no interest in using OS X, Y, Z or any other flavor of Jobsian operating systems. My primary reason for buying a Macbook Pro was to get the most powerful machine possible in the smallest form factor. After much research I determined that the Macbook Pro fit this bill better than the Lenovo T61P or any of Dell’s offerings (that, and the constant harping from Andrew Connell and Spence Harbar, pushed me into the Mac camp).
So I went forth into the bold unknown, reformatted the hard drive, and proceeded to install Windows Server 2008 (gotta have that Hyper-V; Virtual PC and VMWare are so last year). This is where I hit my first challenge – the Windows installer disk options kept giving me grief about not being able to install on a GPT partition. I’ve been living in SharePoint for so long I didn’t have a clue what GPT was so I had to go do some research on that; come to find out, I just needed a bit of help from the diskpart utility to clean things up and get back to an MBR partition that would make Windows happy. Thanks to a wicked fast processor and x64 bits, I had Win2k8 up and running in less than 20 minutes.
The BootCamp drivers helped get all the various hardware pieces playing nice with each other but it took me a few days to realize that they needed to be updated. The nVidia control panel wasn’t recognizing external displays and the function keys were a bit tempermental; I expected the BootCamp update utility to find a new version automatically and fix things up for me but it was not to be. I had to download the 2.1 version (236MB? Does it really need to be that big?) then all was good. Well, sort of.
I know there are legions of Mac fanboys (and girls) who think that the minimalist layout of the Macbook keyboard is the ultimate expression of notebook Zen but they’re just plain wrong. The PC guys definitely have the leg up here – keyboard shortcuts for simple tasks like enabling/disabling wireless and switching external displays can be found on every PC notebook keyboard in the world. But not on a Macbook. I guess ’cause that would lead to an unbalance in the universe and throw the earth off its axis, causing another Ice Age or something; I don’t know what the excuse is but it’s just plain stupid. And so is the ultimate expression of Fruity idiocy – a single mouse button. C’mon guys, it’s 2008 not 1984. Get with the times and give us a two-button mouse. Did I mention that there’s no "Delete" key on the Macbook Pro (or, l should say, the Delete key doesn’t do what it’s supposed to – it’s a Backspace, not a Delete. Ugh.)?
So step one is to download SharpKeys and get to remapping a few keys. F12 now functions handily as a Delete key so I can get back to work without cursing this peculiar lack of functionality. The Control key is also in the wrong place, just like the old Toshiba keyboards, but I suppose I can live with that rather than remap it and have all my external keyboards get messed up. What really stumped me was enabling/disabling wireless to save power. How in the world did this simple task overlooked? Maybe it works by some sort of Jedi mind trick in OS X but I couldn’t find any way to make it happen in Windows. I tried PowerShell, which did a fine job of disabling the wireless network adapter but that wasn’t good enough – I needed to disable the actual device to stop the power consumption (and I want to turn off Bluetooth at the same time). I looked into writing a C# app to do the work but I quickly lost interest in dealing with all sorts of driver level manipulation and the Setup API. After some searching, I found the devcon utility but I couldn’t get the old download link to run on the x64 version of Win2k8. After some poking around I found the correct version of the utility on the Windows Server 2003 ISO under \SUPPORT\TOOLS in the support.cab file.
So I whipped up two quick batch files to enable and disable wireless devices:
REM Disable WLAN and Bluetooth
c:\download\microsoft\devcon\devcon.exe [disable][enable] *VEN_14E4*
c:\download\microsoft\devcon\devcon.exe [disable][enable] *PID_820F*
c:\download\microsoft\devcon\devcon.exe [disable][enable] *VEN_11AB*
NOTE: If you use the scripts, make sure you first get the correct version of devcon.exe (x86 or x64) then get the hardware ID’s from Device Manager. Use the status switch to find the right combination of hardware ID text to isolate the call to a particular device. The first line of the script is for wifi and the second is for Bluetooth (the ID’s may be different on your machine). I also chose to disable/enable the built-in Ethernet to save just a little more power; this may or may not work well for your configuration.
I then created a shortcut for each script and assigned a key mapping to run each one – CTRL + F4 for Disable, ALT + F4 for Enable. Not exactly what I wanted (a single Fn + Key would be ideal) but it was the best I could come up with in a short period of time. If anyone has a better answer for this I’m all ears.
I still haven’t found a solution for switching displays. The new nVidia drivers added a link to the desktop preferences menu to bring up the control panel to manage external displays but that’s a crappy workaround. Why can’t I just have a function key that toggles through the display options like every PC notebook keyboard? I guess that’s too much to ask. It would also be nice if some genius at Microsoft hadn’t decided to completely remove the Mobility Center from Win2k8. What in the hell is that all about? What, are they going to sell fewer OS licenses because people can install it on their notebooks and use it as a workstation? We can get it to look like Vista and do just about everything else on a notebook but heaven forbid we have access to that demonic Mobility Center – that would ruin EVERYTHING. Just once I’d like to sit in on the meetings where these kinds of decisions are made with a low-power Taser so I can shock middle managers back to reality every time they arrive at boneheaded conclusions that they think are in somebody’s best interest other than the actual user of the product.
As for battery life, I’m not so impressed on that front. Even after my tweaks to turn off non-essential hardware I still can’t get the Windows battery meter to show any more than 3.5 hours on a full charge. I’m guessing it has something to do with the graphics card, which is a rather big beast compared to the integrated Intel graphics I’m used to, but it’s going to be a real bummer on long flights. AC says he gets 4 hours out of his; maybe he knows some secret I don’t or he’s working in Vista and not in a server OS. Either way, it would really be nice if we had some additional options to tweak the power profiles to get more juice. Anyone know of a way to adjust power settings for the nVidia GeForce 8600M GT?
On a final note (at least until I discover a few more things that drive me nuts), Hyper-V screams like a banshee with its ass on fire. My VM’s are running happily with absolutely no lag whatsoever; working inside a full-screen VM is just like working natively on the desktop. And the ability to spin up a VM automatically on startup is beyond cool; just open up the Hyper-V manager or RDP into the VM and I’m ready to lay down some SharePoint code in a full MOSS environment in seconds. Since that’s what I bought the machine for I’d have to give it a solid A-. Great form factor, great performance, some lack of attention to detail on small productivity issues.
Stay tuned for more adventures in the ongoing saga of running Windows Server 2008 on a Mac platform. I think I need a drink now…
I’m definitely in agreeance with you. I love the Macbook pro that I just purchased. In my case, I’m triple booting into vista, win2k8 and macosx… so its not that bad.
Look forward to reading about more utitlies and tricks that you find useful to share.
Damn dude.. you know, I was totally excited about getting one of these, but the whole keyboard thing is freakin me out now. F12 as your Delete button?? Thats kinda funcky
I’m doing similar, but running OSX 10.5 and then doing SP/.Net dev in VM’s running under VMWare (along with LAMP in a CentOS VM and native Cocoa OSX/Iphone apps).
(on my MBP 17″ F7 toggles external displays)
When you setup your SP VM’s, how are you doing it?
I’m brand spanking new, really, to all this .Net and SP stuff. But after working my way through a Farm install (definitely not the most fun thing to figure out how to do), I’ve now come to a conclusion that the dev VM should really be Win2k3SVRSP2R2 w/ SQLSVR2005SP2, Visual Studio 2005, Tortoise SVN and Powershell; then configure 2k3SVR as an AD, add the AD users that SP uses, and install SP2k7.
If you have any tips for VM setups, or even automating any of that, I’d love to hear them.
First off, I’d like to mention on macbook “fn + delete” = forward delete (del key on pc), by default. not sure if you already knew that or not. no need to remap to f12 unless you don’t want to have to hold down fn.
anyway, I made a vbs script which basically does the same ting as your batch scripts, but better, it only requires you make one shortcut (for keyboard shortcut), as the script has a toggle built in. In my case though I just toggle the wifi and bluetooth, not the Ethernet .
Anyway, here’s my script:
‘ save as toggleWireless.vbs
Const TemporaryFolder = 2
Set objshell = wscript.CreateObject(“wscript.shell”)
Set fso = CreateObject(“Scripting.FileSystemObject”)
tempfile = fso.GetTempName
path = fso.GetSpecialFolder(TemporaryFolder)
tempfile = path & “\” & tempfile
objShell.run “cmd /c devcon status *PID_820F* >” & tempfile , 0 ,true
arResults = Split(fso.OpenTextFile(tempfile).ReadAll,vbcrlf)
fResults = join(arResults,vbcrlf)
if(InStrRev(fResults, “No matching”)) then
elseif(InStrRev(fResults, “running”)) then
objShell.run “devcon disable *PID_820F*”, 0, true
objShell.run “devcon disable *DEV_4328*”, 0, true
objShell.run “devcon enable *PID_820F*”, 0, true
objShell.run “devcon enable *DEV_4328*”, 0, true
Also, as far as shortcuts go, I’d suggest using Input Remapper which can be downloaded from here: http://www.olofsson.info/
it allows you to pretty much remap any key whatever way you like, and has macbook support built in.
I mapped, “fn + f4” to “shift + control + alt(option) + f4”. Then I made a desktop shortcut for the togglewireless.vbs, and set that combo as the keyboard shortcut, I also checked the hidden attribute for the shortcut, So I didn’t have to see it sitting on my desktop (keyboard shortcuts from shortcuts only work within certain directories in windows, desktop being the only one I can remember (and know of in vista).
please note, you still need devcon in order for this to work, im sure theres a way to enable/disable devices without it via vbs, but I’m actually a newbie to VBscripts this is actually my first script.
I hope to maybe add an overlay notifier, kinda like the mac does for all the other fn key shortcuts, that is if it is even possible with vbs. if anything, I could just rewrite the script in c++ and do the overlay with that instead.
Had any troubles with your mac going to sleep? Mine does sometimes and then doesn’t sometimes.