docker assigned an ip I can not find ipconfig but it exists - docker

On Windows 7 I installed docker which brings up a headless VM. For the first test I built the largest nginx and ran 8080:80, but then I could not browse it on my Windows.
Attempts by localhost:8080 failed.
Then I performed:
docker inspect [MY-CONTEINER-ID]
I tried to use the ip I found there as 172, obviously another fail
Further I used ipconfig on Windows and I found 192.168.99.1, but it also failed. Eventually after hours, I accidentally browsed 192.168.99.100:8080 and it worked!
Could you please let me know that how I could find where this 192.168.99.100 is assigned, what the logic is and by which command I could reveal it?

Using the comments by Matt Clark it solved!
I commanded
docker-machine ls
and I got the ip I was confused about. Thank you.

Related

"Docker Desktop Starting..." forever on Windows

I have installed Docker Desktop version 4.4.4 and it is not running. It only displays "Docker Desktop Starting ..." but never starts running.
I have tried so many ways but didn't solve:
Allowing the following files in windows firewall C:\program files\docker\docker\resources\vpnkit.exe, C:\program files\docker\docker\com.docker.service C:\program files\docker\docker\resources\com.docker.proxy.exe
Removing 'Docker' and 'Docker Desktop' folders from AppData/Roaming and AppData/Local
Uninstalling and reinstalling Docker with different versions including 4.5.1
The main problem is WSL2 does not auto install the kernel when WSL2 installs, yet Docker Desktop expects it already installed. So, fully close & stop Docker as other answers have said, then run this cmd as admin:
wsl --update
Now open Docker Desktop & it should start up ok.
I've found out another symptom leading to the solution is also related to WSL.
On one side, Docker service won't start throwing this error:
error during connect: This error may indicate that the docker daemon
is not running.: Get
"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open
//./pipe/docker_engine: The system cannot find the file specified.
And on the other, WSL is unresponsive. Attempting to run a WSL Distro or WSL command directly on CMD, won't return any output at all. It will just hang in there.
So the solution is common to WSL and Docker.
I've found in a question regarding the WSL issue, that the LxssManager Windows service is staled (it may show under services.msc as Stopping and all the buttons are greyed out, or I've even seen it Running apparently, but with the Docker and WSL issues above, so something is wrong with it still.)
First, we have to get LxssManager PID in order to kill it. Using an elevated shell, we can get it this way:
sc queryex LxssManager
Having the PID, we can kill the process but beware I wasn't able to kill it using kill or taskkill commands. I was getting the following error:
ERROR: The process with PID XXXXX could not be terminated.
Reason: Access is denied.
To effectively kill the process, do as following:
wmic process where ProcessID=XXXXX delete
Replace XXXXX with PID, of course.
Having done so, start the LxssManager service:
net start LxssManager
A word of warning:
I've noted in some cases this is not enough for unknown (to me) technical reasons even if LxssManager service is shown as Running.
Just repeat the above steps! Sometimes it works doing this once, sometimes doing it twice for some reason.
TL;DR
Kill LxssManager Windows service using wmic+PID.
Start LxssManager service.
Repeat twice or more if issues persist.
Docker and WSL issues are solved.
Here i am using Windows platform, I faced this issue.
And to resolve this issue follow the below steps.
Just delete the temporary files from the following.
C:\Windows\Temp
C:\Users{yourAccountName}\AppData\Local\Temp
C:\Windows\Prefetch
then
Uninstall Docker Desktop
Restart computer
before installing docker, make sure you have Ubuntu WSL(download from Microsoft store)
[optional] If you need Terminal Preview(multi-terminal) download from Microsoft Store. Great Terminal
Install Docker Desktop Again
Thanks
For me, it was a problem with WSL. When I tried:
wsl --install -d Ubuntu
in a command window, after a few minutes I got error 0x80370114
The fix was to do:
Exploit Protection > System Settings > Control Flow Guard
turn on
restart computer
Then reinstall/restart Docker Desktop, and it works!
Hope this helps someone else
I was facing same code for for Docker version 4.*. For me it was Visual Studio code,
Stopped WSL form Task manager
stopped Docker which was showing "Docker desktop is starting" form Task manage
stopped Visual Studio code form Task manager
Started Docker again
These steps placed my Docker in Running state in 30 seconds
Hope this helps someone!
Solved this issue with #Alvi answer
Docker forever in "Docker is starting.." at Windows task
I guess you are using wsl2 features. In that case, open PowerShell or command prompt and type: optionalfeatures.exe
scroll down and uncheck
Windows Subsystem for Linux
apply the changes and restart your computer.
After restart follow the previous steps again and check
Windows Subsystem for Linux
and restart again. Hopefully now your docker will run
My fresh install was experiencing the same symptoms. Also wsl --list showed "no installed distributions". I tried many reinstallations and restarts of Docker and WSL, but eventually found the steps:
In Task Manager, kill all processes related to Docker & Docker Desktop
Run Docker Desktop as administrator
Got it working on on Windows 11 Enterprise.
for me it worked in windows (docker desktop):
to uninstall the docker
reinstall as administrator
don't select the part with wsl
As wrote here, you need to do:
wsl --update
But after that it doesn't fix my issue until I did restart to my pc.
What worked for me was to log in into the Docker (upper right corner), but when I first clicked on login, it said "exec: "rundll32": executable file not found in %PATH%" - I search and found that I need to check environmental variable in PATH that I have "C:\WINDOWS\system32" there - (and in my case I really had it broken somehow - don't know why, but I missed backslash between Windows and system32). So I fixed to correct path, restarted PC. Then I was able to login. And immediately "Docker Desktop Starting..." was gone.
I use Docker with PyCharm. I ran into this problem when I launched PyCharm and Docker Desktop at about the same time.
On my machine Docker Desktop starts automatically when I boot. I can avoid the problem by waiting for Docker Desktop to finish starting. And then start PyCharm.
I was also having the same problem, just a few minutes ago.
Platform:
Windows 10 Pro - 22H2 - Build 19045.2486
Windows Updates newly installed: KB5022282, KB5020876, KB5012170
What i did was: Activating the Windows Hypervisor Platform
And it did solve the problem, atleast for now
In my case it helped me to enable the CPU SVM (Support Vector Machine) function in my BIOS settings.
Also, if you have this feature disabled, you will not be able to use Virtual Box either.
SVM in BIOS
got to services and stop Docker desktop service and start again
reopen Docker desktop it will work
wsl -v
if it show version then linx is install
search windows programer feature in your laptop
enable virtulization
wsl --set-default-version 2
restart laptop and then start docker and wait for 2 minutes your docker will start working
I am running windows 11, visual studio 2023 and had this issue.
First, open a command prompt and type
wsl.exe --list --online
Then enter following
wsl.exe --install Ubuntu-20.04
Then type in the prompt sudo apt update to update the distribution. Lastly, start up Docker desktop and log in (you can register at their site). That fixed Docker on my pc.

Problem in creating host only adapter in windows 10 docker

I am wanted to use docker toolbox but the VM is causing problems as host only network adapter is not being created.(I am new using docker toolbox and VM, plus I got two 2 VM in VMware,does this affect?)
enter image description here
I have tried rebooting after installation, running it as admin, but it still left me banging my head.
Also there is exclamation mark on host-only-network adapter in device manager and it is not visible on network connections.
Please help this poor soul.
As told within the description of the docker toolbox is a not more supported legecy project.
Maybe upgrade to Docker for Windows now?

Minishift - cannot start - Error starting the VM: Error getting the state for host: machine does not exist

I ran Docker applications locally in an environment of Windows 10 Home, Oracle Virtualbox, The extension pack, Docker toolbox and Minishift.
Restarting after a few months, I get all kinds of errors. When I re-run minishift, I get a bunch of "OK's" and finally I get this message:
Starting Minishift VM .... FAIL E0807 20:29:20.950373 672
start.go:428] Error starting the VM: Error getting the state for host:
machine does not exist. Retrying.
The command is: $ minishift start --vm-driver=virtualbox --memory=3G
First, I start docker via the Docker Quickstart terminal. Because I can work with docker (and openshift) I know the environment is correct.
How can I get minishift run again?
Clean up using the following command:
minishift delete --clear-cache
Restarting minishift will recreate all necessary stuff.
It is possible that Minishift config contains wrong data. Reasons can be many, one them, for example, is that the VM got deleted via VirtualBox GUI and thus the Minishift has data about VM which does not exist. During the startup Minishift then asks for the status of VM, but VirtualBox cannot provide any information about it as it does not exist. In cases like this my workflow is:
Delete the VM (if there is any) using the hypervisor - for example VirtualBox GUI or KVM's virsh command,
Delete the Minishift home directory, located at %userprofile%\.minishift in case of Windows or ~/.minishift for Unix systems,
Try to start Minishift.
Please note that this is rather destructive way of getting over the problem and if you have valuable data on the VM then you might consider more gentle approaches.
I had the same issue. First clean up minishift cache:
minishift delete --clear-cache
Then launch minishift from its folder (do not use a path env). In my case:
d:\progs\minishift-1.34.2-windows-amd64\minishift start --vm-driver virtualbox
If you get stuck (minishift delete --clear-cache is not working) with the virtual switch applied, type the following to deactivate whatever is set in minishift config view
minishift config set save-start-flags false
Then continue what you started: e.g. minishift start --vm-driver virtualbox
I had the same problem.
My ubuntu machine is running as a VM in windows 10 host.
The below did not work because nested virtualization is by default not allowed in machines running as a guest.
minishift delete --clear-cache
After enabling virtualization engine in the vm settings, I was able to start minishift(after clearing cache ofcourse)
Try to start you virtual machine in you Hyper-V Administrator.
My error was minishift reserve 4Gb of Memory and my system hasn't enought.
Right click over your minishift virtual machine, configuration and get down the memory reserved.
I came to this issue trying to run minishift against an existing VM
Worked with the first VM, deleted that then attempted with a new VM, kept getting this problem and was not able to start the cluster even though it worked first time.
Had to delete the entire ~/.minishift folder and then it started with no issues ¯\_(ツ)_/¯

Running Docker locally in browser on Windows10: Error - IP Not Found

Ok, so here's my background first. I'm a noob in the world of commandline interfaces, but have been building websites off and on for a long time (10 yrs) using GUI's. So, I'm trying to make the switch to CLI's while also learning Docker.
Right now I'm stuck at trying to get Docker to load anything into my browser window. Here's what I've done successfully:
Installed Docker CE on my Windows 10 Machine
Setup a new virtual switch in Hyper-V Manager per these instructions and restarted the computer.
Created a new machine using this line of code docker-machine create -d hyperv --hyperv-virtual-switch "Primary Virtual Switch" manager1
Now here's where things get a little interesting. When I run the above function (I've done it twice now) it stalls on the line: Waiting for host to start...
I waited for five minutes to see if it would do anything, before killing the operation. (oh, did I mention I'm running PowerShell in Adminstrator Mode - right click on the icon to "run as administrator").
So when I re-open PowerShell to check if the new "manager1" machine has been created it comes back affirmative, but with this:
PS C:\WINDOWS\system32> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
manager1 * hyperv Running Unknown IP not found
As far as I can tell these are the steps that I need to take to get Docker to run locally in my browser window, but for the life of me, I'm lost!
Oh, I did downgrade my docker-machine version per a suggestion that I read in a git forum comment, but that was to remedy an issue with the docker-machine create command. Part of me wonders if I'm doing too much. But I honestly don't know what to do next.
UPDATE:
I don't know that this is progress, but in the Virtual Switch Manager, I did switch the external network device from the "Ethernet Connection" to the "Dual Band Wireless" option. Then I restarted my machine. Now I'm showing that the state of the machine is "Timeout". I've also started and stopped my "docker-machine manager1". It sites on the (manager1) Waiting for host to start... line for about half a minute, then proceed to the Waiting for SSH to be available... where it just sits. Here's another screen shot that captures this:
Ok, my confusion was a result of looking beyond the documentation and getting a little confused. I still don't have this fully figured out but everything I was attempting to accomplish is detailed in this getting started with Windows 10 pro article.

Docker Toolbox and Terminal error

I'm brand new to Docker and to containers or anything ops related at all, and am playing with this tool in order to start learning. Mostly I work with Django and Frontend, so please help me understand any answer posted. Thanks.
I installed the Docker Toolbox on my Mac (OS X) and am getting what seems to be a very common error in my terminal after I quickstart it from the Launchpad:
Error getting IP address: Something went wrong running an SSH command!
command : ip addr show
err : exit status 255
output :
docker is configured to use the default machine with IP
For help getting started, check out the docs at https://docs.docker.com
I tried running docker-machine ip and got an error which said:
Error getting IP address: Something went wrong running an SSH command!
I've seen some broad explanations for how to fixing this, but steps and some explanation would be very helpful. Thanks.
Docker, as it turns out, has fantastic customer service. They had me reinstall the toolkit, and then retry all the steps. The first time I quickstarted the terminal, I got a time out, but it worked fine the second time. Slow wifi may have been the problem initially.

Resources