techslap – Change your vhd UUID – virtualbox

techSLAP – A very fast (2 Min) post


You copied a VHD file, from a lovingly sysprepped VHD for virtualbox on windows. You create a new virtual machine, but shock horror!
It errors with an error like the one below:

Failed to open the hard disk E:\VMs\Clone.2008R2.Sysprepped.vhd.

Cannot register the hard disk ‘E:\VMs\Clone.2008R2.Sysprepped.vhd’ {c6b1de25-8790-4677-8135-15ed116da569} because a hard disk ‘F:\VMs\DC01.vhd’ with UUID {c6b1de25-8790-4677-8135-15ed116da569} already exists.

Result Code: E_INVALIDARG (0×80070057)
Component: VirtualBox
Interface: IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}


Navigate to your C:\Program Files\Oracle\VirtualBox directory (default) and open up a command shell there.

You should find the vboxmanage.exe file. Issue the command

VBoxManage.exe internalcommands sethduuid e:\VMs\DDC01.vhd
UUID changed to: ec59d8c5-5fd4-465d-9d7c-201bc1c4b674

Note, you'll have to do this also if you change the name of the VHD file.

I'm still a bit of a virtualbox noob. I like it because it's free, fast and works pretty well as a type2 hypervisor on windows. It also has great USB support, a nifty shared folders feature, and rich virtual networking. Next time I'll use the vboxmanage.exe clonehd command! I think I can already feel some powershell coming on...

Where did all my 1′s and 0′s go? – fun with Storage Spaces

There’s an amazing sense of clarity in that moment of terror when you begin to realise that you might have just lost a bunch of data that wasn’t just a commodity. The Kübler-Ross model kicks in and your brain frantically scrambles to both discover the extent of the loss and what your options are.

Fortunately, in my case, I never made it past the fourth stage of Kübler-Ross when I found the secret sauce. I’m writing this down in case I need to refer to it in the future, or it helps someone else not end out as stressed as I was.


You have a Windows 8 Beta Server. This might be the same with 2012, I haven’t tested it yet.

You have a non-primordial Storage Pool with N+1 physical disks attached.

You have some virtual disks defined within that storage pool.

After moving the disks to another operating system instance, they show up, but you can’t access them or interact with them in the GUI (server manager).

The “By Design” behaviour, when importing disks that are recognised by the operating system as being in a pool, is to start with the pool in read only mode, and not to mount or connect any of the virtual disks. This is a really good idea, but means you need to use the following process to re-attach your volumes.

To reattach your volumes the process is:

  • Fire up PowerShell ;)
  • Set the Storage Pool to Read-Write
Set-StoragePool -FriendlyName <your pool name> -IsReadOnly $false
  • Set the Virtual Disks to be not manually attached.
Set-VirtualDisk -FriendlyName <your virtual disk name> -IsManualAttach $false
  • Connect the Virtual Disk
Connect-VirtualDisk -FriendlyName <your virtual disk name>
  • Bring the disk online from within MMC
  • Assign Drive Letter
  • Access your data!

The story as it goes, was that I built a Windows 8 Server Beta server using the HP N36L that I have come to lovingly refer to as “HPMICRO”. One of the newest features that was announced in the next version of Windows Server was the Storage Spaces feature. “Cool!” I thought, “Finally Windows Server will have a ZFS-like disk parity mechanism and I can go back to using it for my server”.

Aside from pretty lame write performance (which I chalked up to being a beta), the server has gone pretty well. I created a new “Pool” containing all my physical disks, created some new virtual disks (Not VHDs and disks not attached to virtual machines, silly nomenclature Microsoft), assigned letters and all that jazz. Copying to the disks over the network from windows 7 and svr 2008 yielded a speed of about 3/5mbs which I was unimpressed with, but being that it’s not final production code, I chalked it up to beta, dedupe, network, drivers or any other number of things I couldn’t be bothered to investigate. For a while things were really good.

Then Server 2012 RP was released! They changed the darkness of the blue in the operating system (kind of almost looks Azure don’t you think) and added a slew of other features. Unfortunately my move to install server 2012 and uninstall server 8 was a bit too hasty and I couldn’t verify my pool working in my server 2012 instance before I went back to windows Server 8. The beauty of multiple HDDs and the SATA interface.

Because information is still a bit thin on the ground around what (if any) changes to storage spaces are present between Server 8 and Server 2012, I’m pulling all the data off now in Server 8 while it’s accessible. I’m going to recreate the entire pool from within Server 2012 natively to see if it fixes the write slowness that I have faced before and I’m also going to try this method from within Server 2012 (once the data is off the drive) and see if it’s accessible between Server 8 Beta and Server 2012 first.

An Unexpected Error Has Occurred – Diablo 3

If you are trying to launch Diablo 3, and it crashes immediately with “An Unexpected Error Has Occurred”, check the following.

Make SURE that \Diablo III\Data_D3\PC\MPQs and every directory underneath it only contains MPQ files from when you installed it.

I was running the beta, and because my internet is  so bad, I thought I might be able to cheat and use the beta mpq’s in these directories. Turns out the installer does NOT recognise these foreign files, and diablo 3 seems to load everything with a .mpq extension in these directories.

I discovered this these MPQ’s were referenced in my \Diablo III\D3Debug.txt file;

2012.05.18 18:52:07.623826100    OpenMpq – Warning: Data_D3\PC\MPQs\base\d3-update-base-7170.MPQ, not in manifest
2012.05.18 18:52:07.626906800    OpenMpq – opening cache mpq success: Data_D3\PC\MPQs\Cache\base\patch-base-7170.MPQ
2012.05.18 18:52:07.629924100    OpenMpq – opening update mpq success: Data_D3\PC\MPQs\enUS\d3-update-enUS-7170.MPQ

You should remove any MPQ files that read like this Warning: Data_D3\PC\MPQs\base\d3-update-base-xxxx.MPQ, not in manifest

Hopefully this will help you get it working too :)

Elegently compact

NAS Build Guide – HP N36L MicroServer with Nexenta & Napp-IT

I had been researching NAS options for some time and most of my research had turned up a few truths;

1) High Performance NAS options are expensive (eg, starting price of $1000+ with no drives)

I wanted something that would take 4 drives and give me a bit of redundancy without sacrificing either write performance (RAID5) or capacity (RAID10) and could be have volumes carved up for iSCSI, SMB and whatever else I needed.  I wanted at least 100mb/s write and 200mb/s read for my virtualisation host. I wanted this as well as capacity available for my media storage for photos, music and videos. I really wanted ZFS after reading more about it. I had basically convinced myself it was the coolest filesystem on earth and the only thing that would fit my needs.

2) Software support for turnkey solutions was tied to a hardware vendor (eg, thecus/synology/netgear etc)  which meant that disk compatibility research was required for a any disk purchasing decisions.

I had heard some anecdotal stories from my workmates about the HDD support for various NAS vendors including a friend of mine who has lost an entire shared volume, seemingly at random, during a BIOS update. The same friend also complained that his NAS did not have a fast enough CPU to adequately do iSCSI and RAID5 in tandem.

It seemed I was going to have to build my own. I would need a hardware platform and an OS. I became enamored with Nexenta  after I read this excellent AnandTech writeup called ZFS – Building, Testing, and Benchmarking by Matt Breitbrach about a custom built SAN made from consumer grade hardware. If you’re at all interested in this I highly recommend you read this article.  The OS was chosen.

As luck would have it an opportunity came to purchase an HP N36L MicroServer for an incredibly good price. After reading that this system was compatible with Nexenta I snagged this one up with a view to use it as the NAS system I had always ‘been meaning’ to build.

Inside the MicroServer

I have worked with HP hardware for a while in the enterprise server space and they are my preferred choice for any sort of x86 compute platform if you can afford it.  I find the attention to detail that HP put into their engineering makes managing and maintaining these servers simple; components are modular, easily identified and  simple to replace (assuming you’re under an HP Carepack agreement! :)) Their free management software is also fully featured and allows you as an administrator to quickly drill into the health of all components of your platform.

Surprisingly this MicroServer is actually from the ProLiant hardware family and is designed for up to 10 users in a SoHo environment.

HP MicroServer







The inside of the MicroServer was elegantly arranged for such a compact system. Stats for this system below from HP’s website

  • Processor:
    • AMD Athlon™ II NEO N36L
    • AMD RS785E/SB820M chipset
  • Memory:
    • Two (2) DIMM slots
    • 1GB (1x1GB) Standard/8GB Maximum, using PC3-10600E DDR3 Unbuffered (UDIMM) ECC memory, operating at max. 800MHz
  • Storage Controller:
    • Embedded AMD SATA controller with RAID 0, 1
    • Embedded AMD eSATA controller for connecting external storage devices via the eSATA connector in the rear of the server
  • Storage Drive Support:
    • 4 Internal HDD Support
    • Maximum internal SATA storage capacity of up to 8.0TB (4 x 2TB 3.5″ SATA drives)
  • Network Controller:
    • Embedded NC107i PCI Express Gigabit Ethernet Server Adapter
  • Expansion Slots:
    • Slot 1: PCI-Express Gen 2 x16 connector with x16 link
    • Slot 2: PCI-Express Gen 2 x1 connector with x1 Link
    • Slot 2-2: PCI-Express x4 slot for optional management card
  • USB 2.0 Ports:
    • Seven (7) USB 2.0 ports: 4 front , 2 rear, 1 internal (for tape)
  • Power Supply:
    • 150 Watts Non-Hot Plug, Non Redundant Power Supply
  • Management:
    • Optional MicroServer Remote Access Card
  • Operating System:
    • Supports Windows and Red Hat Linux
  • Form Factor:
    • Ultra Micro tower

Here’s a picture taken from my galaxy tab 10.1v that shows the inside of it.

Elegently compact

The only downside of this system is that it does not support the Suspend to Ram (S3) power option. I will not be using this feature so it does not concern me.

Hardware Loadout

In addition to this I added the following hardware;

4x WD20EARX Caviar Green 2TB HDDs with 64mb cache and 4k Sectors. I wanted to do 7200 Caviar black drives but N36L doesn’t support SATA 3 and at almost $200 a pop they weren’t totally price friendly.

1x Patriot inferno 60gb SSD for the system drive. I wanted this for speed and it was the cheapest one they had. Could probably have gotten away with a 16 or 8gb SSD instead, or even a USB stick if you’re feeling game.

2x4GB ProLiant N36L MicroServer 4GB DDR3 PC3-10666 ECC from MemoryStock is still waiting to be delivered. There is 1GB of ECC RAM that comes with the server which I have in there currently.

Nexenta does not yet support installation from anything BUT Optical drive. No USB stick build yet (why?!) I learned this the hard way and purchased an external Samsung DVD-RW for the system install.

High level build

The high level steps I needed to do:

  1. Install hardware
  2. Update BIOS and install hacked Russian BIOS
  3. Set all WD20EARX drives to relax the aggressive default spin-down timings by using wdidle3
  4. Install Nexenta
  5. Install Napp-IT for easy web configurability
  6. Create a ZPool using a modified version of the zpool binary to account for the 4kb sector size.

When I started this build I was completely unaware of the requirement for steps 2, 3 and 6. I’ll explain them all out as I go so others can lean from my mistakes.

Install Hardware

Pretty straightforward. Screws for the HDD caddies are stored in the door at the bottom. One gotcha was the SAS connector can be tricky to pull out of the board. Squeeze hard and pull gentle. I didn’t have a case for the SSD so I left it sitting in the 5.25 bay with a bit of tape for now.

This IcyDock bay is a serious contender for the 5.25 drive bay as it allows you to put 4 x 2.5 SSDs in the space of 1 optical drive and another SATA controller card.

IcyDock MB994SP-S

IcyDock MB994SP-S


Update BIOS and install hacked Russian BIOS

The HP BIOS for N36L does not support anything but legacy IDE emulation on the internal ODD SATA port and the external eSATA port. This is a problem for Nexenta which can detect false disk errors when using the ODD drive on emulated IDE mode. Luckily an unknown Russian hacker somewhere has modified the BIOS to allow AHCI mode on both the internal and eSATA ports. I have always said, “Give the Russians two weeks and they will crack anything” and usually that has held true. Huge thank you to whomever has modified this BIOS given HPs complete failure to do so.

I have enabled this with good results. The main one being no emails from Nexenta informing you that the syspool has moved to a degraded state when it actually hasn’t :)

You need a USB stick with at least 512mb free (maybe less) that you don’t mind formatting.

BIOS update 17/01/2011 (A) 27 Feb 2011 from HP – This is used to create the USB stick for the BIOS flash. Don’t download the newer version – it’s unknown if the hacked BIOS is a patch or a complete replacement. Safer to make sure you download SP52016.exe (2.6 MB) which is the BIOS the hack is designed for

Hacked BIOS with AHCI support – This file goes on the USB  stick also.

The summarised instructions below originally come from user GMCinema from the this thread;

  1. Execute the HP install file and let it prepare your USB stick – follow the instructions on the web page that pops up after it installs.
  2. Copy the unzipped O41_AHCI.ROM file (after extracting from the zip file) to the same USB stick
  3. Copy the “flash.bat” file onto itself in the same directory and rename to “ahci.bat”
  4. Open “ahci.bat” in a text editor and replace the ORIGINAL.ROM filename with the O41_AHCI.ROM filename, save (should look like this: kbd /”flash O41_ahci.rom -r 100000,10000 -r 1e0000,10000;q”)
  5. Put the USB stick in and boot from it (you’ll need a monitor and keyboard obviously)
  6. Restart server – it will auto execute the first HP BIOS update automatically
  7. At the command prompt enter ahci.bat and press return to flash the patched BIOS
  8. Remove USB stick
  9. Restart the machine and enter BIOS with F10 and load defaults. Save and restart.
  10. Enter BIOS with F10
  11. Go to the Chipset Menu > Southbridge Configuration > SB SATA Configuration (New Menu!)
  12. Enable OnChip Sata Channel, OnChip IDE Type to IDE, Sata ID Combined Mode to Disabled and SATA ESP and SATA Power on all PORT to Enabled.
  13. While you’re in BIOS, ensure that video memory is set to 32mb to save your ram getting eaten by a video card you aren’t using.


(Optional) Set all WD20EARX drives to relax the aggressive default spin-down timings by using wdidle3

With the first build of this NAS before the current incarnation I had issues where disks would randomly report themselves as failed within Nexenta. This was quite distressing at first as I’d just bought this hardware was convinced it wasn’t to blame yet. Some digging on forums around the place uncovered a post about the default spin down time on these drives being set to 8 seconds by default which causes Nexenta to have ATA timeout errors. To counteract this I used a utility available from WD that can set the disk timeout value. I set these using the /d flag, which on the WD20EARX drives sets the spin down value to 62 mins – this value is never reached and thus produces no errors in Nexenta. If I was some Solaris guru I’d work out how to get Nexenta to talk to the disks and spin them down when there was no I/O but doing that is breaking the law for me.

You need the USB stick you created previously (easy) or another way to boot into DOS.

If you use the same USB Stick that you created last time remember to edit the Autoexec.bat file and remove the line with flash.bat (that re-flashes your BIOS to the HP standard)

WDIDLE3 Download

  1. Edit the autoexec.bat file on the USB stick to remove the flash.bat entry – otherwise you’ll have to re-run AHCI.bat again and reconfirm your BIOS settings
  2. Download and unzip the file onto the usb stick
  3. Boot into Dos
  4. Execute wdidle3.exe /r to check the current timings
  5. Execute wdidle3.exe /d to set the timings to disabled.
  6. Execute wdidle3.exe /r to check the current timings are set to high values..

This will set the timing settings across all WD drives that it can – If you have non WD drives they should not be affected but probably doesn’t hurt to remove them beforehand.

Install Nexenta

This turned out to be super easy, a very next, next, next install. Grab it from here, burn to a DVD and pop it into your USB DVD drive. Here’s a link to the Napp-IT Mini HowTO.

After install  don’t forget this line if you’re using DHCP. It caught me out first time! It enables the NetWork Auto Magic (NWAM)

sudo svcadm enable nwam

Install Napp-IT for easy web configurability

Super easy. I had to run two lines of perl instead of one as per the PDF. Just make sure your n36l has a valid IP and is connected to the net.


sudo perl nappit

Napp-IT will do the rest. Before you reboot, be sure to re-enter your root password for SMB. Use the command

sudo su
passwd root

and then follow the instructions below

Create a ZPool using a modified version of the zpool binary to account for the 4kb sector size on newer disks.

If you’ve got drives that use “Advanced Format” or 4k sectors you’ll need to snag this modified binary version of the zpool command. This is because the version of zpool that comes with nexenta has a 512 byte sector offset hardcoded into the binary. Napp-IT uses this binary by default so any pools you create within the Napp-IT interface will have the wrong sector size for your disks. This leads to sub-optimal performance and it’s generally not good long term.

Grant Pannell has come to the rescue with the following blog post. He goes into some excellent detail and provides some before and after benchmarks with numbers that describe the difference between proper sector alignment and not and optimal numbers of drives per RAIDz types here.

I’ve condensed the instructions below – what this does is replaces the default system binary with the one modified by Grant.

from a terminal session on the NAS;

sudo mv /sbin/zpool /mv/sbin/zpool.old
sudo mv ~/zpool-12 /sbin/zpool
sudo chown root:bin /sbin/zpool
sudo chmod ugo+rx /sbin/zpool 

You can create your zpools with the web gui now but beware if you change or add disks that use non-4k sector aligned drives.


DD Test writing a 10GB file:

write 10.24 GB via dd, please wait...
time dd if=/dev/zero of=/stuffpool/dd.tst bs=1024000 count=10000

10000+0 records in
10000+0 records out
10240000000 bytes (10 GB) copied, 60.8555 seconds, 168 MB/s

real     1:00.8
user        0.0
sys        16.3

10.24 GB in 60.8s = 168.42 MB/s Write

read 10.24 GB via dd, please wait... time dd if=/stuffpool/dd.tst of=/dev/null bs=1024000 10000+0 records in 10000+0 records out 10240000000 bytes (10 GB) copied, 40.8021 seconds, 251 MB/s real 40.8 user 0.0 sys 11.2 10.24 GB in 40.8s = 250.98 MB/s Read

All in all it’s been a fun build with a lot of learning along the way. I’m keen to see what bumping up the ram from 1gb to 8gb does to the DD results.





To reopen this blog I’d like to thank a fellow blogger and friend of mine David Klemke.

Dave writes an excellent blog predominately about Space/Tech/Finance over at The Refined Geek. I’d like to thank Dave for giving me some excellent technical recommendations for WP plugins to bring this blog-press-thing into the 21st century.  Also, for providing some inspiration to write more regularly for pleasure aside from just writing professionally. Cheers Dave!

While expect my writing to be rubbish to begin with I hope that I can bring a smile to a face I’ll never see somewhere and share my technical experience with those of you who are always learning.

Hopefully I can save someone stuck somewhere, as thousands of blogs have helped me in the past.