Docker Toolbox Error: Looks like something went wrong in step 'Setting env' - docker

I had Docker Toolbox installed on my Windows 7 PC and I wanted to upgrade my Docker installation to the most recent version. To do that, I decided to delete Docker Toolbox from my system and reinstall it. I uninstalled Docker Toolbox, uninstalled VirtualBox, and removed all instances of both in my files (such as files in AppData). After reinstalling Docker Toolbox and launching the Quickstart Terminal, I ran into the following error:
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this vi
rtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env defau
lt
Looks like something went wrong in step 'Setting env'... Press any key to contin
ue...
So it seems like it failed when "setting env". I'm not sure what that means in this context and I wish there was a way to check some extended logs to get more detail. I tried following the Docker documentation pointing the location of daemon logs in AppData, however, I could not find anything relevant. Something I did find was a file called "no-error-report", though it was empty.
I tried uninstalling everything again and reinstalling with the attribute NDIS5 network type checked, I've ran the Quickstart Terminal as admin, and I still ran into the same exact error.
Any suggestions on how I may approach this issue?

I got this same issue.
I fixed this by doing the below procedures.
I changed the below lines in start.sh
STEP="Setting env"
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}" | sed -e "s/export/SETX/g" | sed -e "s/=/ /g")" &> /dev/null #for persistent Environment Variables, available in next sessions
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}")" #for transient Environment Variables, available in current session
Changed --no-proxy to --http_proxy since I am using http proxy

Related

`docker-credential-gcloud` not in system PATH

After the latest updates to gcloud and docker I'm unable to access images on my google container repository. Locally when I run: gcloud auth configure-docker as per the instructions after updating gcloud, I get the following message:
WARNING: `docker-credential-gcloud` not in system PATH.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
gcloud credential helpers already registered correctly.
Running which docker-credential-gcloud returns docker-credential-gcloud not found.
I have no other gcloud-related path issues and for the life of me can't figure out how to install/add docker-credential-gcloud to path. Here's what I have installed (shown via gcloud version):
Google Cloud SDK 197.0.0
beta 2017.09.15
bq 2.0.31
container-builder-local
core 2018.04.06
docker-credential-gcr
gsutil 4.30
I also have Docker CE Version 18.03.0-ce-mac60 (23751).
Here's my $PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I also ran source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc on original gcloud install.
Notice: All docker-credential-gcr below can be replaced with docker-credential-gcloud. I think it is just different versions of gcloud, I might be wrong.
I used Homebrew Cask to install gcloud too. I installed docker-credential-gcr with
$ gcloud components install docker-credential-gcr
And then like you said, which docker-credential-gcr doesn't gave you anything.
So I ran which gcloud to find there is a symlink to gcloud in /usr/local/bin. This symlink is created by Homebrew when you installed gcloud at first place. Now docker-credential-gcr wasn't installed by Homebrew but by gcloud itself, so there isn't a symlink.
I called readlink /usr/local/bin/gcloud and found out gcloud is installed in /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/.
Then:
$ ls /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin
There you should see docker-credential-gcr listed there.
I simply linked it to /usr/local/bin:
$ ln -s \
/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/docker-credential-gcr \
/usr/local/bin/
Then run:
$ docker-credential-gcr configure-docker
It should succeed.
Just had the same issue on Windows, running Docker with Linux containers, Docker engine v19.03.8. Using docker compose. I do not use gcloud for my dockerfiles...
DT1001 dockerpycreds.errors.InitializationError:
docker-credential-gcloud not installed or not available in PATH
Option 1: Edit the docker configuration file and remove all gcloud entries from there.
Windows c:/Users/<your account>/.docker/config.json
Linux & MacOS ~/.docker/config.json
Option 2: Go to Troubleshoot -> Reset to factory defaults.
After this my docker compose was creating containers and running the images without any issues.
On MacOS
Step 1:
Install gcloud and docker-credential-gcr,
following this tutorial
Step 2:
$ ln -s /usr/local/google-cloud-sdk/bin/docker-credential-gcr /usr/local/bin/docker-credential-gcloud
Step 3:
$ rm -rf ~/.docker
Step 4:
$ docker-compose build --pull
Finished!
Never found a way to directly resolve the docker-credential-gcloud issue, but the following got me up and running again. WARNING: the following will delete all your existing docker images and install a bunch of gcloud utilities:
gcloud components install docker-credential-gcr,
Restart the terminal completely
docker-credential-gcr configure-docker.
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
umount /var/lib/docker/overlay2
rm -rf /var/lib/docker
Restart the terminal completely.
The new version of google-cloud-sdk has only docker-credential-gcr but not docker-credential-gcloud anymore. On the other hand one of my python packages always requested docker-credential-gcloud.
The solution was to symlink docker-credential-gcloud to docker-credential-gcr:
ln -s /path/to/google-cloud-sdk/bin/docker-credential-gcr /usr/local/bin/docker-credential-gcloud
ls -l /usr/local/bin | grep docker should now print:
...
docker-credential-gcloud -> /path/to/google-cloud-sdk/bin/docker-credential-gcr
...
Usually, this error indicates that your $PATH variable has been clobbered by a package or program you have recently installed so that the Google Cloud SDK can't be found.
$PATH is altered by many programs when they install by altering ~/.profile, ~/.bash_profile or ~/.bashrc or their non-bash equivalents. With a bad $PATH, Google Cloud SDK is configured in docker but can't be seen as executables so we get this error. This assumes you have used the Google Cloud SDK in the past, but if gcloud is configured with your docker then you probably have. Don't reinstall gcloud or disable it, you already have it on your system and that is fine.
The solution then is to fix your $PATH, not to install anything.
echo $PATH
This should be a pretty long : delimited list of directories that your files are in. Do you see a google-cloud-sdk/bin in the string? Is the string way too short given all the trouble you've gotten into in your life on this computer? You use NVM but it is missing? Use Homebrew but it is missing? Try brew from the command line, does it work?
If the answer is "no" to any of the above, inspect the files above to see if there are any new entries at the bottom of each that might have broken things. Did you just install anything new?
Something is clobbering your $PATH and you need to figure out what that is. For me it is usually something to do with Anaconda Python via the conda init command. For you it might be nvm or something else. Figure out what it is and fix the problem. Don't start over with a new $PATH and install the same stuff over again or disable gcloud authentication.
It really seems to be something with the Homebrew Cask. I uninstalled the cask and then reinstalled the Google Cloud SDK by manually downloading the tar ball and running the packaged install script as described there.
Now docker-credential-gcloud is in my path:
$ which docker-credential-gcloud
/Users/moritz/google-cloud-sdk/bin/docker-credential-gcloud
I can't figure out what Google is trying to achieve here. On Linux there is docker-credential-gcloud and on Windows there is docker-credential-gcr.exe, and then there is docker-credential-gcloud.cmd which calls gcloud auth docker-helper. This is kind of a nightmare if you're trying to write portable build scripts or gradle rules because not everything seems capable of finding and calling docker-credential-gcloud.cmd when you exec docker-credential-gcloud... it might work from the dos prompt, but in general doesn't work.
After a ton of fooling around with .bat scripts, cygwin scripts, .cmd scripts and so forth, I found the best solution was to go into the gcloud installation and just copy docker-credential-gcr.exe docker-credential-gcloud.exe ... not a very satisfying solution, but is the only thing I found that would do the trick.
I got the issue when I tried to SSH from Google Cloud Build into an Engine VM Instance, so I had
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['compute', 'ssh',
'--project', '$PROJECT_ID',
'--zone', 'asia-southeast1-b',
'--strict-host-key-checking=no',
'username#instance-1',
'--command' ,'sh start.sh'
My start.sh
#!/bin/sh
echo "Started: $(date --iso-8601=seconds)"
docker pull gcr.io/aaa/bbbc/cccc
echo "Finished: $(date --iso-8601=seconds)"
The issue was How to set PATH when running a ssh command?
https://unix.stackexchange.com/questions/332532/how-to-set-path-when-running-a-ssh-command
So I just faced the same problem where I am trying to pull an image from GCR to an GCP instance and want to share my solution.
I ran gcloud auth configure-docker and got the warning:
WARNING: `docker-credential-gcloud\` not in system PATH.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
I applied the accepted answer for this thread and ran gcloud components install docker-credential-gcr and got a long error:
ERROR: (gcloud.components.install) You cannot perform this action because this Cloud SDK installation is managed by an external package manager.
Please consider using a separate installation of the Cloud SDK created through the default mechanism described at: https://cloud.google.com/sdk/
When no solution was working, I uninstalled the Google provided google-cloud-sdk package that was installed via snap and instlled with distro specifice package manager, for me that is apt-get as instructed in the Installing Google Cloud SDK: Installation options page and re-ran the gcloud auth configure-docker and this time it solved my problem.
In my case the problem was due to how WSL 1 works with Docker on Windows. At first I only installed and initialized gcloud in WSL Ubuntu, not in Windows. However as Docker daemon is actually run by Windows, you need to install gcloud for Windows as well (and don't forget to run all of the inits and authorizations there).
On Windows 10/11, you need to ensure that C:\Users\USERNAME\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\ is added to your system $PATH environment variable. It may not have been added if the Google Cloud SDK was not able to add it during GCloud installation. So add it manually like this:
Windows Task Bar βž” Press the search icon πŸ” or the search bar
Type "environment" βž” and click on "Edit the System Environment Variables" (ensure that you have Administrator access)
At the bottom of the dialog, click the Environment Variables... button
System Variables βž” click Path βž” Edit... βž” New βž” paste in C:\Users\USERNAME\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\ (replace "USERNAME" with your username)
Close and restart any open Command Prompt windows.
Then verify on the Git Bash for Windows console:
Optional: Note that the AppData folder is hidden by default, so you may want to unhide AppData first, to see its contents.
Restart the Git Bash Terminal window
echo $PATH βž” This should print a long string that contains: :/c/Users/USERNAME/AppData/Local/Google/Cloud SDK/google-cloud-sdk/bin
where docker-credential-gcloud βž” This should print C:\Users\USERNAME\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\docker-credential-gcloud.cmd

Windows doesn't recognize Docker command

I already installed Docker for windows. when I type docker --version command in Command prompt, it doesn't recognize it at all.
The message will be this:
'docker' is not recognized as an internal or external command,
operable program or batch file.
Did I miss something ?
I had installed Docker 18.06.1-ce version on my Windows 10 machine and faced the similar issue, even though the docker was added the Windows %PATH%.
I moved the docker path to the bottom and that solved my problem.
I restarted the system, it worked, maybe we can say that a restart is required.
You need to start the docker first if you have not and then open powershell.
In the powershell, try to run docker commands.
I installed docker Docker version 19.03.13 build 4484c46d9d, in Windows 10 pro 1903.
I was facing the same issue, then I just renamed 'com.docker.cli' to 'docker' and set the environment variable to 'C:\Program Files\Docker\Docker\resources\bin'
Problem Resolved.
Refer the image:
https://drive.google.com/file/d/1sZwx4udOzJeITV2RDGQKlsOt_TF4Wq2N/view?usp=sharing
https://drive.google.com/file/d/1DpW2DR2n_jCGezwrXuhNtXpSTBWmEDJk/view?usp=sharing
Renaming 'com.docker.cli' to 'docker' helped me finally get windows powershell and cmd terminals to recognize the docker command.
Add docker to PATH variable & refreshenv to keep using the same command prompt
If you've installed using docker toolbox the install path "C:\Program Files\Docker Toolbox"
Manually using Environmental Variable > Path (add docker path here)
Using Command Line
For temporary use set PATH=%PATH%;C:\Program Files\Docker Toolbox
Make sure to take a back up of PATH by echo %PATH% before doing this
For permanent change setx PATH=%PATH%;C:\Program Files\Docker Toolbox
docker: command not found
Windows 7: Just set the path of docker in system variable
Step:1
[Click on path -> edit-> paste the docker location]
Step:2 [Paste the docker location]
In my case C:\Program Files\Docker Toolbox.
now check $ docker version
Make sure the docker.exe path (C:\Program Files\Docker\Docker\resources\bin) is added to the PATH variable.
You can check it as follows:
ECHO %PATH%
The docker path had to be appended at the end of the PATH in my case. After that docker cmd was recognized.
Run as administrator worked for me, both powershell and bash on windows. I did not need to restart.
I checked environment variables and noticed that docker path is as the following path in which "R" in resources uppercase. I fixed the case and everything worked as expected
Path: "C:\Program Files\Docker\Docker\Resources\bin"
Just Restart the system, it is always good practice to restart the system when you install or uninstall any application. Hope this works :)
For those who are facing docker issue on VS Code
I was trying on VS Code Terminal after installation. Restarted and was still facing issue.
Then I tried with fresh terminal of Command Prompt -- it worked!
After that it also working fine on vs code.
In VS Code - close all terminals and open fresh terminal
and try test command:
docker --version
2022 - Windows 11
Add these paths to the PATH variable.
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
Docker PATH variable Windows 11:
You need to restart the system after installation. It worked for me.
Try to install GIT bash and then run this command on it for Windows:
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
mkdir -p "$HOME/bin" &&
curl -L $base/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" &&
chmod +x "$HOME/bin/docker-machine.exe"
Click Here.
there is some issues with PowerShell or new version of docker due to which I was facing the same issue but then I went to this page and got way to run it.
PS: GIT bash is required.
If you have installed Docker Toolbox in your windows, go and add the environment variable.
PATH = "location of folder that contains docker-machine"
I also face a problem with the installation and running docker. I'm not sure you how did you install docker. I tried this way. I've downloaded the docker toolbox (https://github.com/docker/toolbox/releases) which comes up with docker,docker-machine. Oracle Virtual box which is pretty much enough to start docker locally.Please make sure you have git bash installed in your local. Once the toolbox installation is done click the icon generated on the desktop . Make sure this icon target to your Git bash.exe (you can verify this by right click on icon and find target). and verify docker version
For me, I had to ensure the check box Enable Hyper-V Windows Features is checked as I was installing.
I just wanted to have client installed, without the engine. So earlier, as I was installing, I unchecked that option. And after successful installation, I get the error - windows does not recognize docker.
But now that reinstalled with the checkbox checked, things are working fine now.
I noticed that running docker commands before startup causes this issue, but ensuring that docker is running and executing the commands after, they are then recognised.
I facing the same issue when I try to run docker -v in Vscode Terminal after install it. I try to use cmd and git bash it work fine. Restart your vscode will solve it
Unfortunately, After many tries and restarts, I uninstalled docker and Re-installed it again, and I had to build all things again.
I faced the same problem, them I tried in Powershell which works someHo
Download "docker-machine-Windows-x86_64.exe" from: https://github.com/docker/machine/releases
Rename "docker-machine-Windows-x86_64.exe" to "docker-machine.exe".
Copy "docker-machine.exe" to path C:\Program Files\Docker\Docker\resources\bin.
just add this path in your "Path" inside env variables inside windows
C:\Program Files\Docker\Docker\resources\bin
then restart your gitbash or cmd or ...
everything goes well after that !
*just add in your environmental Path this syntax if you did like (install docker in c drive) me, most probably it would work, for me, this passed well.
(note: if you going to call RefreshEnv.cmd or RefreshEnv
through your CMC with Chocolatey, this path would not be created for you, and you have to do it manualy in Windows 10 operating system).
C:\Program Files\Docker\Docker\resources\bin
In my case, I switched to the windows command prompt instead of the VScode terminal.

Docker: Looks something went wrong in step Looking for vboxmanage.exe

I just installed Docker Toolbox on my windows 7 machine.
After installing I run the Docker Quickstart terminal which displays the following message:
Looks something went wrong in step nLooking for vboxmanage.exen... Press any key to continue....
Anyone here who knows how to solve this?
Regards,
The same thing happened to me. At this moment I am using Windows Home.
At least in my case, what happened was that the environment variables DOCKER_MACHINE and DOCKER_TOOLBOX_INSTALL_PATH were not created for the system.
I just had to add them and it worked.
Solved the problem by cleaning my .bashrc file.
More specific, i removed the cd , which makes perfectly sense.
For me, the problem was that the DOCKER_TOOLBOX_INSTALLPATH was only set for the user used to escalate priviligies at installation. When I run Docker Quickstart as my regular user, the DOCKER_TOOLBOX_INSTALLPATH variable is empty, producing the error.
Setting DOCKER_TOOLBOX_INSTALLPATH system wide solved the problem.
I'm Windows 8.1 user, I got the same problem when I installing the Docker Toolbox.
Because I have a previous version of VirtualBox installed, so I uncheck the VirtualBox install option in the Docker Toolbox installer.
After the install and I run Docker Quickstart terminal and get the same problem looks like something went wrong in step 'looking for vboxmanage.exe'.
Look at the file D:\Docker Toolbox\start.sh, there are some code fragment:
STEP="Looking for vboxmanage.exe"
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
The start.sh use $VBOX_MSI_INSTALL_PATH and ${VBOX_INSTALL_PATH} Environment Variables to locate the VBoxManage.exe.
And I find my system variables VBOX_MSI_INSTALL_PATH is
D:\VirtualBox
and then, I change it to
D:\VirtualBox\
It works fine!
Or maybe you miss the VBOX_MSI_INSTALL_PATH/VBOX_INSTALL_PATH Environment Variables.
This is my first answer on stackoverflow, I hope this will help you! Finally forgive my poor english ):
For me, it helped to start Docker Quickstart Terminal with admin privileges.
This works if you do not have admin rights:
> Setx DOCKER_MACHINE "C:\Program Files\Docker Toolbox\docker-machine.exe"
> Setx DOCKER_TOOLBOX_INSTALL_PATH "C:\Program Files\Docker Toolbox\\"
> Setx VBOX_MSI_INSTALL_PATH "C:\Program Files\Oracle\VirtualBox\\"
The double backslash in the end makes sure that the variable is saved with one backslash as last character, needed in C:\Program Files\Docker Toolbox\start.sh:
> echo %DOCKER_TOOLBOX_INSTALL_PATH%
C:\Program Files\Docker Toolbox\
Running docker as Administrator solved the problem for me.
I had the same issue.
Inside your toolbox installation folder you should be able to find the installers folder, there you'll find a setup.exe for a Oracle Virtual Box. Double click it, install it and you should be able to reopen the Docker Quickstart with no problems.
Hope this helps!
Cheers! :D
Simple solution: I thought I could just double click on it, but instead need to bring up a windows command prompt, CD to C:\Program Files\Docker Toolbox , and type
sh start.sh
Due to the relative DOCKER_MACHINE path definition on L10, it seems that start.sh will only run when you are inside its directory. I fixed it by modifying the target of the "Docker Quickstart Terminal" shortcut as follows:
C:\Tools\Git\git-bash.exe -c "cd /c/tools/docker; ./start.sh"
Substitute the paths to GitBash and Docker Toolbox to match your installations. If your paths contain spaces, be sure to wrap them in quotes as usual. For example:
"C:\Tools\Git Bash\git-bash.exe" -c "cd '/c/tools/docker toolbox'; ./start.sh"
For context, I had GitBash and VirtualBox already installed before installing Docker Toolbox, so I deselected those options during its install. I'm sure that if I went with the default options, this issue wouldn't have happened. That's probably why some folks on GitHub suggest uninstalling VirtualBox and re-installing Docker Toolbox. Don't do that, it's almost certainly unnecessary.
Do you know how good an open-source program is?
You can actually investigate the issue yourselve, which could be way more precise.
please scroll the quickstart terminal up and see which error message you have got
open C:\Program Files\Docker Toolbox\start.sh (Where you install docker toolbox) with text editer, e.g. sublime text
and see the codes
if it is in step "looking for vboxmange.exe", it should be before STEP="Checking if machine $VM exists" and there are only 50 lines to read
As of 2018-11-27, the only two error that could be given in this step is from these lines, so investigate and find your error in it:
which are:
if [ ! -f "${DOCKER_MACHINE}" ]; then
echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
exit 1
fi
if [ ! -f "${VBOXMANAGE}" ]; then
echo "VirtualBox is not installed. Please re-run the Toolbox Installer and try again."
exit 1
fi
In which:
DOCKER_MACHINE="${DOCKER_TOOLBOX_INSTALL_PATH}\docker-machine.exe"
And
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
So, check your environmental variables and echo it.
In my case, the reason is that DOCKER_TOOLBOX_INSTALL_PATH is an admin user variable:
So, run the quickstart terminal as admin user or put the variable under System variable would do the work
I personally solved this issue by adding the following property to my env (Windows Env variables):
DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox\
as pointed out by the start.sh script of the Docker Toolbox installation.
You can solve this reinstalling the VirtualBox, choosing repair mode.
C:\Program Files\Docker Toolbox\installers\virtualbox -> virtualbox.exe
enter image description here
After finished the process, restart you machine and smile!
For Windows 7 users:
Change value "C:\Program Files\Oracle\VirtualBox\" to "C:\Progra~1\Oracle\VirtualBox\" for VBOX_MSI_INSTALL_PATH system variable in environment variables.
If you are running docker from admin cmd then just try to scroll up and you will get the error message, and then you can solve the issue.
For me the the error "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
But unfortunately reinstall did not solve the issue.
I also had this problem on Win 10 Home and I tried probably every solution from this topic but nothing works, only thing that worked for me was hardcoding Path to VBOX in start.sh.
So in start.sh in this part:
STEP="Looking for vboxmanage.exe"
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
I did this:
STEP="Looking for vboxmanage.exe"
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
And this works very well.
I know that this solution(hardcoding path) isn't best possible but it's only one which worked for me, and I think that sometimes it's better to use bad solution which works than good one which didn't work
This happens when the user connects to some sort of secured networks using VPN, TLS machine certs gets messed up, upon restarting machine and regenerating TLS machine certs, docker toolbox is configured to use the default machine with IP 192.168.XX.XX
In windows 8.1, I solved the problem by just adding extra \ to the DOCKER_TOOLBOX_INSTALL_PATH environment variable.
Installer has created the user variable for admin as DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox
, but it should be
DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox\
For people that installed docker with chocolatey you need to install VirtualBox separately from docker with choco install virtualbox and set environment variables as this
DOCKER_MACHINE == "C:\Program Files\Docker Toolbox\docker-machine.exe"
DOCKER_TOOLBOX_INSTALL_PATH == "C:\Program Files\Docker Toolbox\"
VBOX_MSI_INSTALL_PATH == "C:\Program Files\Oracle\VirtualBox\"
don't forget to add \ at the end of the folders
I faced same issue on my Windows 7 machine and below steps has resolved the same
Went to C:\Program Files\Docker Toolbox\installers\virtualbox and doubleclick virtualbox.msi to install Oracle Virtual box. (Note : It will install andd ask permission for 3-4 more components, Grant them all)
Set up the Env Variables
DOCKER_MACHINE C:\Program Files\Docker Toolbox\docker-machine.exe
DOCKER_TOOLBOX_INSTALL_PATH C:\Program Files\Docker Toolbox
Restart the machine
Finally Open Docker Quickstart Terminal and give it some minutes (probably 5-10) to let it do the setup
I am having the same issue with the vboxmanage.exe upon running my docker toolbox.
I managed to solve the problem by installing virtualbox since I did not install virtualbox on my computer.
Might as well give it a try.
Docker Tool Box is not a standalone application. It has many other tools like Oracle Virtual Box, Git & docker engine itself.
./start.sh is seeking some existing configuration which might miss in the older version. I updated the GIT version from 2.0.x to 2.12.x & it works for me.

How to "Unlock Jenkins"?

I am installing Jenkins 2 on windows,after installing,a page is opened,URL is:
http://localhost:8080/login?from=%2F
content of the page is like this:
Question:
How to "Unlock Jenkins"?
PS:I have looked for the answer in documentation and google.
Starting from version 2.0 of Jenkins you may use
-Djenkins.install.runSetupWizard=false
to prevent this screen.
Accroding to documentation
jenkins.install.runSetupWizard - Set to false to skip install wizard. Note that this leaves Jenkins unsecured by default.
Development-mode only: Set to true to not skip showing the setup wizard during Jenkins development.
More details about Jenkins properties can be found on this Jenkins Wiki page.
Check https://wiki.jenkins-ci.org/display/JENKINS/Logging to see where Jenkins is logging its files.
e.g. for Linux, use the command: less /var/log/jenkins/jenkins.log
And scroll down to the part: "Jenkins initial setup is required. An admin user has been created ... to proceed to installation:
[randompasswordhere] <--- Copy and paste
Linux
By default logs should be made available in /var/log/jenkins/jenkins.log, unless customized in /etc/default/jenkins (for *.deb) or via /etc/sysconfig/jenkins (for */rpm)
Windows
By default logs should be at %JENKINS_HOME%/jenkins.out and %JENKINS_HOME%/jenkins.err, unless customized in %JENKINS_HOME%/jenkins.xml
Mac OS X
Log files should be at /var/log/jenkins/jenkins.log, unless customized in org.jenkins-ci.plist
open file: e:\Program Files (x86)\Jenkins\secrets\initialAdminPassword
copy content file: 47c5d4f760014e54a6bffc27bd95c077
paste in input: http://localhost:8080/login?from=%2F
DONE
Some of the above instructions seem to have gone out of date. As of the released version 2.0, creating the following file will cause Jenkins to skip the unlock screen:
${JENKINS_HOME}/jenkins.install.InstallUtil.lastExecVersion
This file must contain the string 2.0 without any line terminators. I'm not sure if this is required but Jenkins also sets the owner/group to be the same as the Jenkins server, so that's probably a good thing to mimic as well.
I did not need to create the upgraded or .last_exec_version files.
I assume you were running jenkins.war manually with java -jar jenkins.war, then all logging information by default is output to standard out, just type the token to unlock jenkins2.0.
If you were not running jenkins with java -jar jenkins.war, then you can always follow this Official Document to find the correct log location.
Open your terminal and type code below to find all the containers.
docker container list -a
You will find jenkinsci/blueocean and/or docker:dind if not than
docker container run --name jenkins-docker --rm --detach ^
--privileged --network jenkins --network-alias docker ^
--env DOCKER_TLS_CERTDIR=/certs ^
--volume jenkins-docker-certs:/certs/client ^
--volume jenkins-data:/var/jenkins_home ^
--volume "%HOMEDRIVE%%HOMEPATH%":/home ^
docker:dind
and
docker container run --name jenkins-blueocean --rm --detach ^
--network jenkins --env DOCKER_HOST=tcp://docker:2376 ^
--env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 ^
--volume jenkins-data:/var/jenkins_home ^
--volume jenkins-docker-certs:/certs/client:ro ^
--volume "%HOMEDRIVE%%HOMEPATH%":/home ^
--publish 8080:8080 --publish 50000:50000 jenkinsci/blueocean
run command
docker run jenkinsci/blueocean
or
docker run docker:dind
Copy and Paste the secret key.
One method to prevent the installation wizard is to do the following in $JENKINS_HOME:
Create an empty file named .last_exec_version
Create a file named upgraded
If left empty, a banner will prompt you to "upgrade" to 2.0 (which just means install a bunch of new plugins like Pipeline)
If the contents of that file is 2.0, you'll receive no banner and it will act like an regular old Jenkins install
Remember, this wizard is in place to prevent unauthorized access to Jenkins during setup. However, bypassing this wizard can be useful if, for example, you want to deploy automated installations of Jenkins with something like Ansible/Puppet/etc.
This was tested against Jenkins 2.0-beta-1 – so these instructions may not work in future beta or stable releases.
In the mac use:
sudo more /Users/Shared/Jenkins/Home/secrets/initialAdminPassword
I have seen a lot of response to the question, most of them were actually solution to it but they solve the problem when jenkins is actually run as a standalone CI without Application container using the command:
java -jar jenkins.war
But when running on Tomcat as it is the case in this scenario, Jenkins logs are displayed on the catalina logs since the software is running on a container.
So you need to go to the logs folder:
C:\Program Files\tomcat_folder\Tomcat 8.5\logs\catalina.log
in my own case. Just scroll almost to the middle to look for a generated password which is essentially a token and copy and paste it to unlock jenkins.
I hope this fix your problem.
Step 1: Open the terminal on your mac
Step 2: Concatenate or Paste
sudo cat **/Users/Shared/Jenkins/Home/secrets/initialAdminPassword**
Step 3: It will ask for password, type your mac password and enter
Step 4: A key would be generated.
Step 5: Copy and paste the security token in Jenkins
Step 6: Click continue
I found the token in the following file in the installation dir:
<jenkins install dir>\users\admin\config.xml
and the element
<jenkins.install.SetupWizard_-AuthenticationKey>
<key> THE KEY </key>
</jenkins.install.SetupWizard_-AuthenticationKey>
You might see it in the catalina.out. I installed Jenkins war in tomcat and I can see this in the catalina.out
The below method does not work anymore on 2.42.2
Create an empty file named .last_exec_version
Create a file named upgraded
If left empty, a banner will prompt you to "upgrade" to 2.0 (which just means install a bunch of new plugins like Pipeline)
If the contents of that file is 2.0, you'll receive no banner and it will act like an regular old Jenkins install
mostly jenkins will show you the path for initialAdminPassword if you dont find it there, then you have to check jenkins logs
in log you will see
05-May-2017 01:01:41.854 INFO [Jenkins initialization thread] jenkins.install.SetupWizard.init
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
7c249e4ed93c4596972f57e55f7ff32e
This may also be found at: /opt/tomcat/.jenkins/secrets/initialAdminPassword
Use a lil shortcut to get to the folder:
cmd + shift + g
then insert /Users/Shared/Jenkins
there u can see the secrets folder - probably shows that it's locked.
to unlock it: right click on the folder and click info + click on the lock at the bottom. now u can change the rights shown at the bottom of the window
hope that helped :)
Greetings, Stefanie ^__^
If unable to find Jenkins password in the location C:\Windows\System32\config\systemprofile\.jenkins\secrets\initialAdminPassword
by installing Jenkins generic war on Tomcat server, try below
Solution:
Set environmental variable JENKINS_HOME to your jenkins path say
JENKINS_HOME ="C:/users/username/apachetomcat/webapps/jenkins"
Place Jenkins.war in the webapp folder of Tomcat and start Tomcat,
initial admin password gets generated in the path
C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\jenkins\secrets\initialAdminPassword
Yet another way to bypass the unlock screen is to copy the UpgradeWizard state to the InstallUtil last execution version, add an install.runSetupWizard file with the contents 'false', and update the config.xml installStateName from NEW to RUNNING.
docker exec -it jenkins bash
sed -i s/NEW/RUNNING/ /var/jenkins_home/config.xml
echo 'false' > /var/jenkins_home/jenkins.install.runSetupWizard
cp /var/jenkins_home/jenkins.install.UpgradeWizard.state /var/jenkins_home/jenkins.install.InstallUtil.lastExecVersion
exit
docker restart jenkins
For reference, this is the command I use to run jenkins:
docker run --rm --name jenkins --network host -u root -d -v jenkins:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkinsci/blueocean:1.16.0
You will also want to update the config with the Root URL:
echo "<?xml version='1.1' encoding='UTF-8'?><jenkins.model.JenkinsLocationConfiguration><jenkinsUrl>http://<IP>:8080/</jenkinsUrl></jenkins.model.JenkinsLocationConfiguration>" > jenkins.model.JenkinsLocationConfiguration.xml
exit
docker restart jenkins
In case, if you installed/upgraded new versions of jenkins and unable to find admin credentials on server then, ...
if you are using old version of jenkins and on the top of it you are trying to reinstall/upgrade new version of jenkins then,
the files under "JENKINS_HOME", namely -
${JENKINS_HOME}/jenkins.install.InstallUtil.lastExecVersion
${JENKINS_HOME}/jenkins.install.UpgradeWizard.state
will cause jenkins to skip the unlock (or admin credentials screen) and webpage directly ask you for username and password. even on server you will not able to find "${JENKINS_HOME}/secrets/initialAdminPassword".
In such case, don't get panic. just try to use old admin user creds in newly installed/upgraded jenkins server.
In simple language, if you have admin creds as admin/admin in old version of jenkins server then, after upgrading jenkins server, the new server won't ask you set password for admin user again. in fact it will use old creds only.
I have found the password in C:\Program Files\Jenkins\jenkins.err. Open jenkins.err text file and scroll down, and you will find the password.
Go to C:\Program Files (x86)\Jenkins\secrets
then with notepad ++ open file initail Admin Password and paste its content.
thats it
-->if you are using linux machine, then login as root user: sudo su
-->then go to the below path: cd /var/lib/jenkins/secrets
-->just view the IntialAdminPassword file ,you can see the secret key.
-->paste the secret key into jenkins window,it will be unlocked.
https://issues.jenkins-ci.org/browse/JENKINS-35981
Try this %2Fjenkins%2F instead of %2Fjenkins in the browser
Open the terminal on your mac and open new window (command+T)
Paste sudo cat /Users/Shared/Jenkins/Home/secrets/initialAdminPassword
It will ask for password, type your password(i gave my mac password, i haven't check if any other password would work) and enter
A key would be generated.
Copy the key and paste it where it asks you to enter admin password
click continue
The problem can be fixed in latest version: mine is 2.4. The error comes because of %2fjenkins%2f in URL. The previous version was coming with %2fjenkins and the same error used to come. They have resolved the issue, but the URL has been changed from %2fjenkins to %2fjenkins%. So as a summary in the URL currently %2fjenkins% is coming. before passing the admin password change it to %2fjenkins. Along with that add a .last_exec_version empty file.
If someone chooses running Jenkins as a Docker container, may face the same problem with me.
Because accessing-the-jenkins-blue-ocean-docker-container is quite different,
Common problem is /var/lib/jenkins/secrets: No such file or directory
You need to access through Docker, the link Jenkins provide is quite helpful.
Except <docker-container-name> maybe not specified, then you may need to use the container ID.
After
docker exec -it jenkins-blueocean bash
or
docker exec -it YOUR_JENKINS_CONTAINER_ID bash
The /var/lib/jenkins/secrets/initialAdminPassword would be accessible.
The password would be there.
I have setup Jenkins using Brew, But when I restarted Mac Jenkins was asking for initialAdminPassword(The screenshot attached in question)
And the problem was it was not generated under sercret directory.
So I'd found the Jenkins process which was running on port: 8080 using: $ sudo lsof -i -n -P | grep TCP and killed it using $ sudo kill 66(66 was process id).
Then I downloaded the latest jenkins .war file from: https://jenkins.io/download/
And executed command: $ java -jar jenkins.war (Make sure you are in jenkins.war directory).
And that's it everything is working fine.
This works well when you are stuck with Docker on Windows and are using Git-Bash
Presuming something like:
# docker run --detach --publish 8080:8080 --volume jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins:lts
Execute to get the Container ID, for example "d56686cb700d"
# docker ps -l
Now tell Docker to return the password written in the logs for that Container ID:
# docker logs d56686cb700d 2>&1 | grep -A5 -B5 Admin
2>&1 redirects stderr to stdout
-A5 includes 5 lines AFTER the line with "Admin" in it
-B5 includes 5 lines BEFORE the line with "Admin" in it
Output example:
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
47647383733f4387a0d53c873334b707
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
I found it under below directory. Full issue detail https://github.com/jenkinsci/ibm-security-appscansource-scanner-plugin/issues/2
C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Jenkins\.jenkins
Open jenkins.err file in C:\Program Files\Jenkins\.
In that file check for a hash key after this line
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
And paste it there in the jenkins prompt. Worked for me.
To solve this problem for docker container in Ubuntu 18.04.5 LTS (Bionic Beaver) - Ubuntu Releases
1- connect to your docker server or ubuntu server witch ssh or other method
2- run sudo docker ps
3- copy the container name parameter ("NAMES")
4- run sudo docker logs "your_parameters_NAMES_VALUES"
5- Find the folowing sentence "Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:" and copy the password

Getting Rsync 3.0.9 to work on Vagrant VM box through Cygwin on windows 7

My vagrant VM box is super slow when I try to run my Rails app on it, and I'm guessing it's due to the shared folder problem.
I am trying to use rsync to circumvent the problem.
I installed Cygwin and necessary packages, put C:\cygwin64\bin; as PATH environment variable
and then changed my Vagrantfile to
config.vm.synced_folder ".", "/vagrant", type: "rsync"
When I run vagrant up, I Get this error message
$ vagrant up Bringing machine 'default' up with 'virtualbox'
provider... "rsync" could not be found on your PATH. Make sure that
rsync is properly installed on your system and available on the PATH.
What's going wrong here?
Thank you so much ... if there's any other way to run Vagrant VM box smoothly and faster on Windows 7, I would love to hear it too.
This turned out to be a bunch of brick-walls you have to circumvent when installing Rsync and setting it up correctly for Vagrant on Windows 7.
First of all, the error "rsync" could not be found on your PATH. Make sure that rsync is properly installed on your system and available on the PATH. was due to the fact that
1) Environment variable for Cygwin was placed in the latest order in the PATH, I changed it to the beginning of the path
2) During installation of Cygwin and Rsync, I installed individual "subpackages" instead of installing everything, thinking that it would be okay. Turns out I was wrong. I installed everything in the Admin package and Net package (not the SRC but just the bins), and then it started working. I suggest you set-up Cygwin again and really try to download everything if you see that error.
(I found these solutions through this post on SO cygwin + rsync)
Now, I could go into CMD and type rsync, and it would show up correctly. But then when I ran vagrant up it gave me another error saying
There was an error when attempting to rsync a synced folder. Please inspect the error message below for more info.
Host path: /c/Users/xxxxx Guest path: /vagrant
Command: rsync --verbose --archive --delete -z --copy-links
--chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyCh
/c/Users/xxxx / vagrant#127.0.0.1:/vagrant
Error: cygwin warning: MS-DOS style path detected:
C:/Users/xxxxxxx Preferred POSIX
equivalent is:
/cygdrive/c/Users/xxxx CYGWIN
environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of
known hosts. rsync: change_dir "/c/Users/xxxxxxx"
failed: No such file or directory (2) rsync error: some files/attrs
were not transferred (see previous errors) (code 23) at
/usr/src/ports/rsync/rsync-3.0.9-1/src/rsync-3.0.9/main.c(1052)
[sender=3.0.9]
I googled solution to this error and found this site. https://github.com/mitchellh/vagrant/issues/3230
Then there's a bug with Vagrant and cwrsync that I mentioned in #3086.
For now, just edit
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.5.1\plugins\synced_folders\rsync\helper.rb
and add hostpath = "/cygdrive" + hostpath to line 74. It's a terrible
solution but quick and simple.
Editing that helper.rb file and adding hostpath at line 74 (just made some blank lines right there and pasted it in) and now it works perfectly!!!!
Rsync makes the shared folder soooooo much faster on Rails!!!! I think it is worth the pain of setting it up correctly. Try it!!
It's not clear from your message, but I think you installed rsync on your machine (the host), while it needs to be installed on the virtual machine you bringing up (the guest).

Resources