Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running docker on Ubuntu 18.04.2 LTS (WSL Enabled) #4385

Closed
Kundan22 opened this issue Aug 7, 2019 · 15 comments

Comments

@Kundan22
Copy link

@Kundan22 Kundan22 commented Aug 7, 2019

Copied from Issue#468

tried running sudo /etc/init.d/docker start, it shows [Ok] but after that docker run command returns following

Please suggest

~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              fce289e99eb9        7 months ago        1.84kB
~$ sudo docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:303: getting the final child's pid from pipe caused \"EOF\"": unknown.
ERRO[0002] error waiting for container: context canceled
@Drakota

This comment has been minimized.

Copy link

@Drakota Drakota commented Aug 7, 2019

Can you run wsl.exe -l -v and share the output? I suspect you're using the version 1.0 of WSL which does not work out of the box with Docker.
You should see something like this.

PS C:\Users\jbouchard> wsl.exe -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2
@Kundan22

This comment has been minimized.

Copy link
Author

@Kundan22 Kundan22 commented Aug 7, 2019

wsl.exe -l -v doesn't run on my terminal. it just shows how to run run command with options

but following command gives

$ wsl.exe --list 

Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)
@Drakota

This comment has been minimized.

Copy link

@Drakota Drakota commented Aug 7, 2019

Can you press Win Key + R, write winver and share a screenshot?

@Kundan22

This comment has been minimized.

Copy link
Author

@Kundan22 Kundan22 commented Aug 7, 2019

image

is there any other way to check if which version WSL2 or WSL1 is installed?

@Kundan22

This comment has been minimized.

Copy link
Author

@Kundan22 Kundan22 commented Aug 7, 2019

~$ sudo /etc/init.d/docker start
[sudo] password for user:
 * Starting Docker: docker                                                             [ OK ]
~$

when I ran the above command it shows [ OK ] but then

~$ sudo docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
@Drakota

This comment has been minimized.

Copy link

@Drakota Drakota commented Aug 7, 2019

I'd suggest you install the Insider Preview build of Windows and follow this tutorial https://docs.microsoft.com/en-us/windows/wsl/wsl2-install

@Kundan22

This comment has been minimized.

Copy link
Author

@Kundan22 Kundan22 commented Aug 8, 2019

I tried on 3 different machines but every time I got the same result. on all machine wsl.exe -l -v doesn't return anything.. something is not correct.

@Drakota

This comment has been minimized.

Copy link

@Drakota Drakota commented Aug 8, 2019

Please note that you'll need to be running Windows 10 build 18917 or higher to use WSL 2

Have you done this step?
Follow the procedure to enroll in the Windows Insider Program and select the "Fast" ring updates.
image image

@lucasctd

This comment has been minimized.

Copy link

@lucasctd lucasctd commented Aug 8, 2019

Try build 18932, I am using this one and it works with the same commands you have used.

@Kundan22

This comment has been minimized.

Copy link
Author

@Kundan22 Kundan22 commented Aug 8, 2019

Alright!!! After following above step getting latest build and wasting 35gb of space...

and running below commands. WSL2 is running docker on ubuntu...

PS wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

PS C:\WINDOWS\system32> wsl --set-version Ubuntu-18.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\WINDOWS\system32> wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-18.04    Running         2

Thanks for suggestions @Drakota & @lucasctd @mscraigloewen

@lucasctd

This comment has been minimized.

Copy link

@lucasctd lucasctd commented Aug 8, 2019

@Kundan22 yw. Keep in mind it may be slow if you access the windows file system as stated in #4387 and #4197

@lucasctd

This comment has been minimized.

Copy link

@lucasctd lucasctd commented Aug 8, 2019

I am downloading build 18956, if WSL2 performance is better on that one, I will post it here.

@craigloewen-msft

This comment has been minimized.

Copy link
Member

@craigloewen-msft craigloewen-msft commented Aug 8, 2019

Closing this issue as the original problem is resolved. Thanks for filing!

@Kundan22

This comment has been minimized.

Copy link
Author

@Kundan22 Kundan22 commented Aug 9, 2019

After upgrading to 18956 there is windows.old folder (~35 GB). Is it safe to delete it?

@lucasctd

This comment has been minimized.

Copy link

@lucasctd lucasctd commented Aug 9, 2019

Yes, but you will not be able to rollback to the build you were in case something gets wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.