Docker.qcow2 corrupted? need data from one of the containers!

I was just bitten by the infamous docker for mac issue that breaks it in a way that it won’t start.

Diagnostics tells me: failure: Optional(“diagnostic: response is not valid JSON”)

I read I need to delete the Docker.qcow2 to get things started again, but before I do so, I did some vim coding in on of the containers and I badly need the code before I delete the qcow2 file and lose all my data.

Please share any ideas you have on how to extract my data from the file before.

I tried many things including

  1. the qemu-img trick to recompress it
  2. copy it to another mac and → the problem reproduced on the new mac as well
  3. just run docker inspect → but got Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I saw this post : http://www.vivekjuneja.in/tips/2016/12/02/docker-1.12.3-view-host-fs/
however it too requires the docker client to connect while on my setup when trying to run docker I get : com.docker.osx.hyperkit.linux failed to start
Exit code 1

Ideas?