docker-archive / toolbox

The Docker Toolbox
https://docker.com/toolbox
3.22k stars 1.23k forks source link

Docker toolbox script runs only from the icon #487

Open mehrotra-prateek opened 8 years ago

mehrotra-prateek commented 8 years ago

Hello, I am not sure if this is an issue but quite intriguingly after installation, if I use the shortcut on desktop all starts up fine. But at the same time if I take its startup command i.e.

"D:\Program Files (x86)\Git\bin\bash.exe" --login -i "D:\Program Files\Docker Toolbox\start.sh"

and run it from windows cmd, same git bash or cygwin bash then there is failure with below result

Docker Machine is not installed. Please re-run the Toolbox Installer and try again.
Looks like something went wrong in step ´Looking for vboxmanage.exe´... Press any key to continue...

This does look familiar to https://github.com/docker/toolbox/issues/473 and also https://github.com/docker/toolbox/issues/484.

I would agree with request of change in #484 if I could understand the reason behind this.

fariazz commented 8 years ago

It seems start.sh only works if you run it from the folder C:\Program Files\Docker Toolbox. If you look at the desktop shortcut that works, it has that folder in "Starts in". If you run it from command line, you have to cd to that desktop to make it work (in my case at least).

I created another desktop shortcut icon which is the same as the automatically created one, but uses git-bash.exe, which is a bit nicer IMO. The Target value I entered in the shortcut properties is "C:\Program Files\Git\git-bash.exe" start.sh, and for it to work, "Starts in" C:\Program Files\Docker Toolbox

fresheneesz commented 7 years ago

I had the same problem. I can confirm that running start.sh from C:\Program Files\Docker Toolbox does the trick (initiates installation of virtualbox and initializes a docker command prompt).

BartGo commented 7 years ago

Adding cd "/c/Program Files/Docker Toolbox" as the first operation in the start.sh solved the problem for me.

strarsis commented 6 years ago

Apparently the DOCKER_TOOLBOX_INSTALL_PATH variable is not set in the start.sh script.

Additionally, the backslash in start.sh caused an issue in WSL (Bash on Windows):

DOCKER_MACHINE="${DOCKER_TOOLBOX_INSTALL_PATH}\docker-machine.exe"

to

DOCKER_MACHINE="${DOCKER_TOOLBOX_INSTALL_PATH}/docker-machine.exe"

And DOCKER_TOOLBOX_INSTALL_PATH environment variable has to be set before start.sh in .bashrc:

export DOCKER_TOOLBOX_INSTALL_PATH='/mnt/c/Program Files/Docker Toolbox/'

Maybe WSLENV could re-use these existing Windows environment variables?