Category Archives: Troubleshooting

Expanding and compacting a virtual disk of a VirtualBox machine

Today I suddenly got errors due to low disk space in my VirtualBox virtual machine. It appeared that I only had a few bytes of free space left on my dynamically expanding hard disk of 60 GB, so I was getting into trouble!

To solve this, I closed all programs, removed unneeded data and applications on the virtual hard disk (by deleting or uninstalling them manually and then using the disk cleanup utility):


After that I was able to free up 3 Gb, but of course this was not enough. It appears you have to do a number of additional things in order to really shrink the hard disk – and maybe at the same time make it a little bigger.

The next thing to do was to run defragmenter. In my case however the disk was not fragmented, so this step was not really necessary.

Then I downloaded a tool called sdelete and executed it in the virtual machine in an elevated command prompt (run as administrator), as follows:


This tool zeroes out unused bytes, which is needed before actually compacting the disk. After this, I shut down the virtual machine.

Now because the format of my virtual disk was VMDK, I had to download a tool called CloneVDI, which enables you to clone a virtual hard disk and at the same time compact and expand it. Cloning is also a safer method because if something goes wrong, you don’t screw up your original hard disk and so you can still go back and try again:


Note that I also checked the ‘Keep old UUID’, as I want the exact same machine (otherwise windows would have to be reactivated). If the new size is bigger, make sure to also check the ‘Increase partition size’ (alternatively you can extend the partition later in disk management of windows 7).

The clone process may take a while to complete:


The end result however is a virtual disk in native VDI format. Now it was just a matter of creating a new virtual machine and selecting the new VDI hard disk for it. But before that you can do this, you have to remove the original hard disk from the Virtual Media Manager, otherwise it will complain that a disk with the same UUID already exists:


After this, starting the new virtual machine resulted in a blue screen. The reason is that the hard disk was added under SATA controller, so I removed it and added it again under IDE controller:


After that it worked as expected.


Toad for Oracle freeware corruption

After an out of disk space on my virtual hard drive in VirtualBox, starting the schema browser in Toad for Oracle resulted in a Stream Read Error. Uninstalling and reinstalling Toad did not resolve the issue. What did help was resetting Toad for Oracle, which you can do as follows:

  • Close Toad for Oracle.
  • Go to ‘c:\users\[user name]\AppData\Roaming\Quest Software\Toad for Oracle’ and rename the existing Toad folder, in my case I renamed ‘11.0 freeware’ to ‘_old_11.6 freeware’.
  • Start Toad for Oracle again.

You have to add your connections again, but as the corrupted user data is now gone, the error will also be fixed.

Sharepoint integration with IE 9

A while ago I set up a Sharepoint Services 3.0 site, which was working fine. However, lately two annoying problems appeared. It I tried to edit text using the rich text editor, I got exception:


Trying to edit a document from a document library resulted in:


I searched for days to find the reason for this, and to my surprise there was actually nothing wrong with Sharepoint or Office, but with the fact that I used Internet Explorer 64 bit. All editions of IE 64 bit have only limited support, which caused all of these issues! If I use the 32 bit version of IE, there were no problems.

Switching from VMWare to VirtualBox

I have been using VMWare for a couple of weeks now. Unfortunately it was not a very good experience. Once in a while it crashed during startup or shutdown of the virtual machine, after which I manually had to remove the lock file in order to be able to use it again:


But the most annoying issue was that in NAT mode the internet connection worked but I experienced several network related problems, and in bridged mode I simply had no internet connection. Trying to fix it with several solutions I found with google resulted in no solution.

Then I tried to quickly create a virtual machine with VirtualBox. After a few minutes I noticed that everything just worked out of the box, in NAT and bridged mode. So the decision was taken to move to VirtualBox.

I found that this does not mean that all of my virtual machines should be recreated, because VirtualBox also supports the VMWare hard disk format (vmdk)! It requires only some small manipulations to get this working.

First, power up the original virtual machine with VMWare, uninstall the VMware tools and shut down the machine:


Start VirtualBox, create a new machine.


Click next.


Now copy all of the original VMWare hard disk files into the created folder:


Click next to continue the creation of the virtual machine, and select the main vmdk file:


Click create. Do not start the virtual machine yet!

Select the virtual machine and click settings:


In storage, remove the SATA controller:


In IDE controller, uncheck ‘Use host I/O cache’ and click the ‘add hard disk’ icon:


Choose the existing hard disk file:


That’s it! Start the virtual machine. Windows will now update its drivers accordingly, and a couple of restarts may be needed. Eventually, your virtual machine will be up and running in VirtualBox. Then, select ‘Install guest additions’ in the Devices menu, so that you unlock the full power of VirtualBox:


After an hour of work, my four virtual machines were converted successfully:


Accessing network machine by name in VMWare Player

For each customer I have a separate VMWare virtual development machine. This allows me to separate all environments, as for each of them I have other software and frameworks installed, and mixing these may cause compatibility issues. And if something happens with my laptop, I don’t loose my virtual machines and can simply use them on another laptop.

I was having one issue though: from within a virtual machine I could not access the internal network, for example, pinging a machine in the network resulted in an error:


First solution

VMWare Player’s network adapter was configured to use NAT; and internet connection was working fine. Then I looked up the IP address of the network machine, and tried to ping that one:


And this worked. So it meant that it could not resolve the machine name.

To solve this, I added the mapping between IP address and machine name in the hosts file:


After that, I could access the machine by its name without a problem:


Second solution

I was not very happy with the first solution. But then I found that without these entries added to the hosts file, I could still access the machine if I used its name suffixed with the domain extension:


So, a better approach would be to somehow make the virtual machine automatically add the domain suffix with each call.

Indeed, if I did a ipconfig /all, it showed that DNS suffix Search List was localdomain:


To change this, go to ‘Control Panel\Network and Internet\Network and Sharing Center’, and click the connection. Then click properties, select the ‘Internet Protocol Version 4’, and click properties. Click the advanced button. In the DNS tab, add the required DNS suffix:


Now an ipconfig /all reveals that the DNS Suffix Search List now is the actual domain:


So now, if we ping the machine with just its name, it works:



Third solution

And then it seems there is yet another way of solving this. Right click ‘Start/Computer’ and click properties. Click ‘Change settings’ next to the computer name, and then click the ‘Change’ button, then the ‘More’ button, and fill in the Primary DNS Suffic of this computer:


It has the same effect, but also changes your default domain.

But, unfortunately…

…after a reboot, it stopped working again. With NAT mode I had internet connection but network did not function properly, with bridged mode network worked but I did not have internet connection. I tried every solution that I found on the net but none of them worked. So I decided to give VirtualBox a try… and there everything worked immediately, out of the box! See my post about that.