HowTo: Compact Virtualbox VDI images

I just ran into an issue while trying to compact my Virtualbox hard drive images. On virtual NTFS filesystems I usually run defrag twice, then rely on a tool called sdelete (download page) to zero the free space within the image. Afterwards I use vboxmanage to reduce the image size.

This time either zeroing the free space or the shrinking process seemed to fail. The supposedly compressed images needed even more space than before. It took me a while to figure out what happened – the parameters of sdelete had changed:

C:\>sdelete

SDelete - Secure Delete v1.6
Copyright (C) 1999-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

usage: sdelete [-p passes] [-s] [-q] <file or directory> ...
       sdelete [-p passes] [-z|-c] [drive letter] ...
   -a         Remove Read-Only attribute
   -c         Clean free space
   -p passes  Specifies number of overwrite passes (default is 1)
   -q         Don't print errors (Quiet)
   -s or -r   Recurse subdirectories
   -z         Zero free space (good for virtual disk optimization)

It feels like 99% of the tips concerning zeroing the free space (by calling sdelete -c, the old option for zeroing) seem to be outdated. Even worse: the “clean free space” feature shows the same output as “zero free space”.

So this should (currently) be a working procedure:

  1. On the guest system: Run the Windows “defrag” tool twice.
  2. On the guest system: (Download and) run “sdelete -z” to zero the free space.
  3. On the host system: Use vboxmanage “modifyvdi IMAGE.vdi –compact” to reduce the image size.

What happens when heating amber chunks in an oven

In 2004, my girlfriend wife and I went on holidays to Lithuania. Among other places, we visited Klaipeda (Memel) to spend a few days at the Curonian Spit (Kurische Nehrung). It is a famous UNESCO world heritage site. We were lucky, the Baltic Sea was rough and during a morning walk we discovered something glittering in the seaweed: Amber chunks.

In Klaipeda, street vendors offered pretty much any kind of amber “collectibles”. Most of them were counterfeits in egg-shape, with inclusions of wasps or scorpions. But they also had really nice jewelry made of processed amber. A friendly vendor described the manufacturing process: Most amber findings have a milky white or yellow color. They are too shabby for jewelry. These chunks are carefully cooked in sand to gain a clear honey-like color. Back from our vacation, I had to try this out. 🙂

The first picture shows a few pieces of yellow amber, lying on baking paper. They have a diameter of about 3-5 millimeters.After half an hour at about 250°C their color noticeably changed to the typical brown.After an hour their tone was even darker, but did not significantly change anymore.

D-Link DI-614+ Router – Firmware modding

This is a summary of the firmware modification I had made ​​some years ago. The router does not exist anymore and the modifications are no longer maintained. But some people still seem to be interested in the old postings…

Warning: all modifications on your router may void your warranty. I do not claim any responsibility for any form of damages that may result out of the use of the modified firmwares. These firmwares only work with the DI-614+ Rev.A router (two antennas).

Second warning: increasing the output power also results in a higher processor temperature. Additional cooling by adding a heat sink and/or fan to the router might be necessary. I mean it! I think I blew my router that way…

[2004-11-11] a new modded firmware version is available: di614_fw233k1.zip (and untested: di614_fw233k2.zip)

This modified firmware is based on the original firmware v2.33 which is available on the D-Link website. The DDNS problems are now fixed by the official release, the modified version has the following additional changes:

Powerhack (19dBm)
Wireless LAN channel 1-14 support
Increased log readability

[2004-05-05] modified firmware di614_fw230k1d.zip

Just a minor fix compared to the other changes. I modified the ‘Status->Log’ tab a bit. Now all entries a displayed in a grid. This increases the readability of the log.

[2004-04-30] modified firmware di614_fw230k1c.zip

I was told that the DDNS firmware settings were still not working, although they were saved now. Comparing the older firmware version (v2.20) to the newer one I found out that D-Link used different names for the fields of the DDNS entries. I exchanged the new field names with the ones from the older firmware ,et voilà, I get a wonderful ‘DDNS: good .xxx.yyy.xxx.zzz’ in my logs now.

[2004-04-29] modified firmware di614_fw230k1b.zip

Just added another feature to the 2.30 firmware, the so called ‘power hack’. As I was told this seems to be something cool others are waiting for, so I looked at an interesting page about a software hack on the DWL-900AP. Thanks to that hacked firmware I’ve been able to modify the DI-614+ firmware as well. The option ‘Max. 19dBm’ is now available. I have not validated the power gain yet but will do so as soon as possible.

[2004-04-28] modified firmware di614_fw230k1a.zip

Shortly after repairing the DDNS form yesterday I recognized that another feature I liked was missing in the original v2.30 firmware, the wireless LAN channels 12, 13 and 14 (I never had 14 before ;-)). I found out that these channels are not deactivated in the router, they are just hidden from the user. So I modified the firmware once again and added the missing channels in the user interface. I have successfully tested the channels up to 13 using NetStumbler, channel 14 was not found (well, it’s not that widespread anyway).

Known side effects:
Sometimes the channels 12 and 13 appear twice in the drop-down list. You can select either, this has no effect on the routers functionality.
After enabling the wireless LAN with channel 12 or 13 for the first time the router jumps back to channel 6. Reselecting the channel 12 or 13 will fix this. (Verify the channel by selecting ‘status’ in the router configuration.)

[2004-04-27] modified firmware di614_fw230k1.zip

I have modified the firmware version 2.30 from D-Link and corrected the malfunctioning dynamic DNS form. Although I am currently running it on my own router and it seems to work fine, I do not guarantee for anything.

You can use the flash binary converter tool arj2bin.tar.gz to create valid firmware files on your own.

If something goes seriously wrong…
…the D-Link DI-614+ factory default reflash procedure:

The DI-614+ has a tiny flash program saved in the boot sector of the flash that cannot be overwritten. You can restore your flash eeprom by doing the following:

  • Get an original firmware from the D-Link website
  • Power off the router and remove all but the network cable to your computer
  • Give your computer the static IP address 192.168.0.100
    (It might be necessary to remove all other settings, e.g. gateway, DNS, …)
  • Push and hold the reset button down with a paper clip or something similar
  • While holding the reset button down plug the router back in and keep holding the reset button down for 10 seconds
  • Open a browser and go to http://192.168.0.1

You should see a simple web page with an edit box, a browse button and a send button. Use this to flash your router with the D-Link firmware and all should be well again.