Creating a Joyent SDC Sysprep’d Windows 8 Dataset

These instructions are based off the Joyent 2008R2 guide, posted here. Get the bulk of your info there, and adapt the following considerations for Windows 8.

As a note, these adaptations also apply to anybody wanting to sysprep Windows 8. So, keep reading if you’re stumbling with the issue where Windows demands a user be setup via the console.

Creating a Dataset for Windows 8 is the same as for Windows 2008R2 in most ways. The 2008R2/7 VirtIO drivers will work fine. I’ll note only the discrepancies here so that you can get a sysprep’d Windows 8 Dataset ready for deployment.

* Create your VM, install your OS, then install SDC-guest tools.

* Install your virtio net drivers, and get your OS ready for sysprep.

Now, Windows 8 differs in regards to sysprep in these ways:

* SetupComplete.cmd
- This won’t run from c:\smartdc\sysprep\ folder like it did in 2008
- Create the “Scripts” folder and move this to %windir%\Setup\Scripts\SetupComplete.cmd

* Windows 8 needs a default user defined.
* If you don’t define one, Windows will interrupt the Sysprep process to ask you to register a Microsoft account, or to create a local user. A workaround is to define a local user in your unattend.xml. Then later, as part of your SetupComplete.cmd, delete that dummy user. To leave it in would be a security risk. So, to that end:
- Create a dummy user “Dummy” in the “oobeSystem” pass using the “Microsoft-Windows-Shell-Setup” component.
– Check out an example.
– As an aside, you should be using WSIM.
- Add “NET USER Dummy /DELETE” to %windir\Setup\Scripts\SetupComplete.cmd. SetupComplete.cmd, as one might presume, runs after setup completes, and Windows 8 is happy that a dummy user exists.

And that does it. Kick off sysprep with “c:\windows\system32\sysprep\sysprep /generalize /oobe /shutdown /unattend:c:\smartdc\sysprep\unattend.xml”.

Congratulations, now you’ve got a deploy-ready Windows 8 image.

Ruby One-Liner: Figure out what awk column to use

Handy to identify how awk will interpret ‘{print $whatever}’

ruby -e ‘`head /var/adm/messages -n 1`.split(” “).each_with_index do |x,v| print “#{v+1} #{x}\n” end’

Ruby pad IP address with zeros

Not sure why this was so difficult to figure out, but the Googs failed me when I tried to look this up. So here it is for my fellow lazy sysadmins who want IP fields to line up nice and pretty.

# For pretty printing, align text with equal char length of IPs

def pad_ip_with_zeros(ipString)
  arr = ipString.to_s.split('.')
  barr = []
  arr.each {|octet|

  return barr.join('.')
end #def pad_ip_with_zeros(ipString)

# Undo pretty printing of IP address

def unpad_ip_with_zeros(ipString)
  arr = ipString.to_s.split('.')
  barr = []
  arr.each {|octet|

  return barr.join('.')
end #def pad_ip_with_zeros(ipString)

reportreader.rb – puppet CLI report reader

So I wrote this tool on account of I searched The Almighty Google for a CLI puppet report reader but couldn’t find any. Please use if you find useful, or make suggestions for improvement. =D

Configuring a Solaris 11 DNS client

Oracle, you are seriously harshing my squee.

You must use SMF to configure name resolution.

Next Page »