Tag Archives: windows

Change Docker images location in Windows

One of the things I wish I knew before using Docker for Windows, is that configuring where images and containers are stored is not really straight-forward. Here how to change the default location from C:\ProgramData\Docker to whatever drive and folder you like. In my case I like to keep the same structure, but in D:, like this: D:\ProgramData\Docker

To change the location via UI, from your system tray, right click on the docker (the whale) icon:

Note, this assumes that you are using Docker from the “stable” channel. With “edge” I think you may not have the “Daemon” option as in the screenshot, then keep reading to change the file manually.

Then from the menu, select “Settings…” > “Daemon” > click on the “Advanced” switch > Add (notice that every backslash is escaped with another backslash), feel free to change the location to your desired one:

"graph": "D:\\ProgramData\\Docker"

The result should look like this:

Click “Apply”, docker will restart and you are set.

Alternatively you can edit the C:\ProgramData\Docker\config\daemon.json file and add the “graph” property with your favorite text editor, then save and restart the docker service.

To restart docker: right click on the docker icon > at the bottom click on “Restart”.

Unluckily, the old images will stay in the old location and it’s up to you to manually delete them after restarting docker. They are inside C:\ProgramData\Docker\windowsfilter

I’m not sure if you can simply move them to the new location. I didn’t bother. I tried to copy the files from windowsfilter but got some errors and saw that some links were not copied correctly, so I gave up and simply built my docker files to generate a new, clean images and containers from scratch.

SQL Management Studio – Export to Excel 2007

In SQL Management Studio I tried to export some data in Excel 2007 format and got this error:

the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine

To fix it I installed 2007 Office System Driver: Data Connectivity Components then I retried and it worked like a charm.

Note: to export big amount of data, e.g. a table with half a million records you need to export to Excel 2007 (XLSX) format, thus you need the OLEDB 12 provider installed.

Note March 2019: I tried to install Microsoft Access Database Engine 2010 Redistributable (x64) and it didn’t work, I had to install the 2007 version listed above and it worked.

Resize virtual disk VHD file

The easiest way to resize a VHD file is via command line. Check this blog post on technet.com.

Note: maybe you googled for VHD Resizer (or vhdresizer) and could not find the download.

If you need VHDResizer, check this blog post on burksy.net (it contains a working download link).

Note: I used BitLocker to password protect my virtual disk. After executing “extend” I had no feedback. This because I forgot to unlock my drive. After unlocking it I could extend the partition as wished.