ESXi Hard Disk Boo-Boo… and fix!

Running ESXi 4.1 in freebie mode, I accidentally created an XP virtual machine with an 8GB hard disk (instead of the intended 80GB). Inevitably, I failed to notice this until after I’d spent the best part of a day upgrading the thing to Kingdom Come and configuring large amounts of software. Starting from scratch with a new VM and a correctly-sized disk was, then, out of the question. But how, then, do you increase the size of an existing virtual hard disk?

With great difficulty, in a nutshell!

If you Google around a bit, you’ll see various people suggesting you can get yourself into the host machine’s “Tech Support Console” and run the command vmkfstools -X 80G ./name-of-disk-file.vmdk. However, when I tried this, I was told that the relevant file was not a valid virtual disk file… so, end of experiment with that technique. (I believe you can get this error message if the virtual machine has snapshots. Also if the file is corrupt!)

Anyway, here’s what I ended up doing instead to resolve the issue (and it’s not exactly pretty!)

First, shut down the virtual machine if it’s not already. Then right-click and Edit Settings. Add a second hard drive, this time sized correctly. Once that’s added, reboot the virtual machine.

Next, from within the virtual machine, visit and download the zero-cost HD Clone utility for Windows (the .exe is fine, no need for the .zip). Run that and install the software. If necessary, reboot once more.

Third, run the HD Clone utility. Select the Cloning option, and allow it to detect the two hard disks. Follow the prompts to clone the small original disk to the larger new one. Let it do its stuff (it took about 7 minutes to clone an 8GB drive). When prompted, allow it to automatically resize the finished clone, and do whatever else it feels needs to be automatically adjusted.

When the clone is complete, shut down the virtual machine. Go back to the right-click-edit-settings option and assign the first hard drive (the original boot disk) to IDE controller 1:1 (it started off on 0:0, which is what made it the first -and boot- hard disk). This frees up the 0:0 location for the second, larger hard disk you’ve just created, so now you click that and assign it to the just-freed-up 0:0 IDE interface (making it the new boot disk). Lastly, you click the original hard disk and click the Remove button (if you’re not feeling brave, select the option to remove the disk from the virtual machine without deleting the files off the physical host!).

This little game of deckchair shuffling means the new, larger hard disk ends up occupying the same position in the IDE chain of command as the original, smaller, one did. So when you now power on the virtual machine, it should correctly boot from the new hard disk. Windows XP certainly did, first time of asking -and then promptly went into that ‘new hardware has been detected, you must reboot for it to work properly’ routine. One further reboot later, therefore, and I finally ended up with an XP machine running on an 80GB virtual hard disk rather than an 8GB one.

I have read that you might need to jiggle the boot flags on the new hard disk, but I didn’t have to. If you do, you’ll have to alter the VM so that its CD/DVD Drive is pointing to an ISO of Gparted. That will let you set the new hard disk to be bootable, and then you should be good to go. Happily for me, HD Clone seems to take care of this by itself, so as I say, I never had to do this further bit of fiddling.

If all has gone well, you can use the ESXi Browse Datastore option to remove the physical file associated with the original virtual hard disk if you weren’t brave enough to physically delete it originally. You can also uninstall HD Clone from within the virtual machine, since you won’t (presumably) be needing it again. HD Clone works fine in Windows 7, by the way, so the same basic technique should apply to any vaguely-recent version of Windows, not just XP.

R.I.P. Rachel

First glimpsed at the crack of dawn from inside my study, on my birthday, January 7th 2006, this was my first-ever close-up Swamp Wallaby:

We called her Rachel, after the name of the young daughter of a web-friend of mine on the Oracle groups… and I soon upgraded to a monitor that was about 10,000 times thinner!

Rachel then did what all good wallabies do and started “begatting”. I’m afraid we didn’t keep great records, but I’m pretty certain she begat Jefferson, Milhous, Franklin and a good few others.

She never came in the house, and never even quite managed to get used to us coming out of the house to put food out (though she’d never hop off too far and would soon be back), but she turned up practically every day and became something of a fixture around these parts:

(That’s her with Milhous)

Sad, then, to report that we haven’t seen Rachel since late September. They are always prone to going ‘missing’ for a couple of days, sometimes more. But for her not to turn up for, now, getting on for 8 weeks… well, I fear we must conclude that Rachel has departed for good.

The maximum lifespan of a swamp wallaby is, allegedly, about 15 years. I’d guess she was 2 years old from that original photograph, which means she only managed around 6 or 7 years… not very long, then, and I suspect the local foxes as a result. But we’ll never know.

Happily, we still get a mob of around 4 to 6 wallabies every night, including the ever-intrepid Chandler:

Long may they continue to come… but Vale, Rachel.

Gill Sans and Linux (part 956)

Any reader (assuming I still have any) with a long memory will know that I have a thing about Gill Sans, the font.

Actually, I have a thing about Eric Gill, the guy who designed it in the late 1920s. He was a very strange fellow indeed! By all accounts a devout Catholic, he nevertheless found time to have an affair with his sister, sex with his dog and do a bit of child abuse on the side. Regardless, he was a great sculptor, type face designer and all-round artist. When I was in London last month, I was able to take a quick trip to Broadcasting House in Portland Place, which is graced by a great sculpture and a couple of bas-reliefs of his:

That’s Ariel between Wisdom and Gaiety, the latter of which I suspect Eric to have been overly familiar with!

Anyway, I digress.

The point is, if you’re running Linux and you want the Gill Sans font, how do you get it, because it’s certainly not baked-in to any distros I know of?!

Well, the method I’ve always used in the past is to visit the Microsoft website and download the Euro fonts update for Publisher 98 (my, how long ago that seems!) in an XP (virtual) machine and copy the relevant TTF files across to the Linux box, because that font is included for free in that update. (Similarly, you get Frutiger Linotype -another nice font, this time designed by Adrian Frutiger in the early 1970s- for nothing if you install ye ancient Microsoft Reader).

This approach is, of course, completely in breach of the license for those fonts and thus A Very Bad Thing To Do (though it works). So don’t do it (even though you can). And I haven’t done it for ages as a result of having seen the licensing light, honest!

So that option is really (morally) out of the question these days.

So what else can you do? Well, why not instead visit this website and download the blighters with, apparently, no licensing restrictions at all?! Good question… As far as I know, it is actually impossible to produce a Gill Sans font that is legal and legitimate, because the font is copyrighted up to its ears, never mind licensing restrictions. So, I don’t know where those downloads come from originally, and I’m pretty sure that they are not entirely kosher -though I could be wrong and I would hate to cast aspersions. So, download them and use them as your conscience dictates.

I suppose you could always buy the thing, too, if you really felt like it (and had the better part of $1000 to spare!)

Either way (and here comes the technical stuff for the benefit of my forgetful brain): To install fonts in bulk (at least on Debian 6, ‘Squeeze’): copy them to the .fonts folder in your home directory (e.g., /home/hjr/.fonts), and then issue the commands:

su - root
fc-cache -f -v

If there isn’t a .fonts folder already in your home directory, just create one.

Or, you can install them individually by double-clicking the downloaded/copied/purchased ttf file and hitting the Install Font button. The downloaded files can be deleted afterwards, because this process copies the font files to your /home/<name>/.fonts file.

Squeeze and VMware Workstation

If you’re running Debian Squeeze (x64) and trying to install VMware Workstation (7.1), you may run into difficulty post-installation where it perpetually warns you about not being able to find kernel headers and the like. Here’s the fix for that.

First, if you haven’t already, become root and issue this command:

aptitude install gcc make binutils

Next, make sure you’re fully updated (aptitude update will take care of that) and that you have rebooted after the update. That way, you know for certain that you’re using the latest kernel. Finally, issue this command:

aptitude install linux-headers-`uname -r`

Those are ‘back ticks’ around the “uname -r” bit (usually found, on US keyboards at least, above the tab key, and left of the ’1′ key in the main part of the keyboard). They cause the command uname -r to be executed and the value it generates to be passed back to the rest of the aptitude install command. This way, you ensure you’re installing the version of the kernel headers which precisely matches the version of the kernel you’re actually using.

After that, just run Workstation as normal and it should detect everything normally and offer to compile some kernel modules -and once that’s been done, the thing should run fine.

Another year…

Once again, it’s time to celebrate the birthday of Benjamin Britten (he would have been 97 today).

Unfortunately, I must do my celebrating confined to bed, since I have the muscle aches and gripes one usually associates with influenza (but which is probably just a 24-hour niggle-thing).

Anyway, at least I get to listen to plenty of the master’s music this year! So, happy birthday, Ben!

Change number of Virtual Desktops

Debian 6 (“Squeeze”) only uses two virtual desktops by default -which means, if you enable the Desktop Cube, you actually end up enabling the Desktop Plane!

In the old days, you’d solve this problem by right-clicking the virtual desktops applet in the bottom panel, click Preferences, and change the number of virtual desktops there (to four, if you want a proper cube back!):

As you can see here, however, you now only get an option to adjust the number of rows the virtual desktops are displayed in, which isn’t the same thing at all, and which has no effect on the number of virtual desktops which exist in the first place. So that option’s not on these days. Where else can you do the deed, then?

Well, if you want desktop cubes, you are presumably running Compiz desktop effects. And, if you have any sense, that means you’ll have installed the CompizConfig Settings Manager (System → Preferences → CompizConfig Settings Manager menu options if so). At the very top of that application is an item for General Options -and that, in turn, has a tab for Desktop Size. Click that, and bump the Horizontal Virtual Size up to 4:

Job done: