Linux drivers for HyperV guests

If you've never had to run Linux under HyperV you'll know that it runs, although it could be better. You'll also be aware that Microsoft supply drivers via connect, in a binary state with official support for only a few distros.

So you can imagine how I felt when I saw the announcement on the LKML. Drivers for Linux guests, in the kernel. Ok, so it's not in the mainline yet, but it is the start of good and great things.

To all those involved, I salute you!

My 4 hours of netbook fun, and Sysprep under Safe Mode

I use my work Macbook Pro for personal stuff as well, and quite frankly if you don't want kids in the future, it's the laptop to use on your lap. And deity forbid that you want to use a demanding program; you might as well forget about using your legs for a week afterwards. To combat this I've been toying with getting a netbook for over a year now, and since last week was my birthday, I got myself a Compaq 702EA as a present.

Sadly I wasn't impressed with the 702EA. I knew going into it that it would be low powered. That was what I wanted. Sadly I wasn't prepared for just how poor the performance was of the unit. At minimum I expect a laptop of the current generation, to be able to cope with a "standard" flash banner and scrolling the webpage. Sadly this wasn't the case under XP or any flavour of Linux (current versions of fedora, ubuntu and ubuntu netbook remix) or Solaris (nexenta and opensolaris) that I tried. Having used MBPs for the best part of 2 or so years, I fear that I've become somewhat spoilt.

Having decided to return the device I was faced with the prospect of returning it to factory defaults. Fairly simple with a normal laptop, but as this was a netbook, not so much. In the end I ended up cheating, resizing the partition back, using the XP Home safe mode to remove the users and data I'd added and using sysprep on the provided disk to reseal the Windows installation. Interestingly until now I wasn't aware that sysprep needs to run in Safe Mode with Networking in order to function. If you run without networking it states that the version of sysprep doesn't match the version of Windows.

So will I be joining the netbook revolution again? Given the cost of netbooks, no. The only reason I'd gone for the 702EA was because it was available for £200 from ebuyer. All other netbooks are too near the cost of a regular laptop and I can't jusify it, quite frankly.

The crunchpad still looks interesting though.

Backing up HyperV Virtual Machines

We use HyperV a lot at work, and for small scale Windows Server platform deployments I actually quite like it as our chosen virtualisation tech. However, backing up any virtual machine, regardless of platform, can be "fun" sometimes. We actually use a script that I put together using diskshadow (VSS) and a set of batch scripts, which works really well. However I hadn't actually really put much thought into what was happening and although I've done test restores for Windows machine I'm yet to do one for a *ix box.

How exactly does the virtual machine get to a state where it *knows* that it's being backed up? After all the last thing you want is a restore and the VM to believe it's the time when the backup occured (which would leave it in an inconsistant/messy state).

I went looking and came across a video from TechNet which, about half way through, has a high level technical explanation of what happens when you use VSS to backup VMs, and what happens when the guest OS isn't VSS aware. Certainly interesting and potentially worrying stuff.

Windows Server 2008 DNS Server occasionally returns SERVFAIL

We've got a few customers at work, including ourselves, who use Windows Server 2008. But only one was experiencing this problem. A "good" (i.e. quick) workaround was simply clearing the DNS cache. However, it was obviously not a decent solution.

After more investigation it looked like it only affects servers using root hints, in some form. If a server was using recursive queries more, then the problem wouldn't reoccur as often. As it was only happening every few weeks we didn't look into it too much. But, after quite some time since we came across it and finally resorting to periodically casting an eye over technet's blogs it looks like setting the DNS Max TTL to 2 days or so stops the problem from occuring (nice...).

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters\MaxCacheTtl=dword:2A300

Mass importing users with Powershell

I've got a bit of a love-hate relationship with Powershell, but in this case it's turned into a bit of love. Importing users with Powershell is relatively easy to do when combined with ActiveRoles Management Shell for Active Directory, from Quest, which adds a handful of rather useful functions. PSCX supposedly has something similar, but I'm obviously missing them completely.

  1. Get someone to provide a spreadsheet with all users that they want for their new install (or export from an existing AD using CSVDE)
  2. Fiddle with the file, remove any crap you don't want, add anything you might, and convert to a CSV. For a new install we tend to set the inital password to something based around the user's name (which you can automate creating with an Excel formula). My finished format is something like this: givenname,middlename,surname,company,displayname,samaccountname,password
  3. Install Quest's ARM, and fire up the shell that it adds in your start menu
  4. Now it's simply a case of running the following, replacing my.domain/Path/To/OU/Users with your actual domain and the path to where you want the users placed (you can, obviously, make this part of the CSV, if you want)import-csv C:\Path\To\Users.csv | foreach-object { New-QADUser -FirstName $_.givenname ` -LastName $_.surname ` -SamAccountName $_.samaccountname ` -ParentContainer my.domain/Path/To/OU/Users ` -displayname $_.displayname ` -name $_.displayname ` | ` Set-QADUser -UserPassword $_.password | Enable-QADUser }
  5. Grab yourself a cuppa, or a beer, and tell the boss that you've been slaving all night (optional, of course)

Just to add an SBS 2008 twist to it, if you create your users in this manner you'll find that they show up in Active Directory Users and Computers, but not the SBS Console. The reason for this a special attribute on the object which doesn't get set. There's a nice article over at the SBS Blog which explains it for groups, but it's also applicable for users.

What it doesn't tell you is that for users, you can simply head into the SBS Console > Users, run the Change User Role for Accounts wizard, select Standard User, select your users (you'll need to select the checkbox to show all users), and then let it do it's magic. It'll setup your users Exchange mailboxes and shared folders in a jiffy.