Docker restricting access to WSL in file explorer - docker

So I made sure by installing a fresh windows install to make sure that it really is Docker.
As you install WSL2 you can access the OS's files through Windows explorer as seen:
accessing WSL
As I install Docker Desktop my access to the WSL folder is denied as seen:
docker denying access
I am able to access the folder through using the address: \\wsl.localhost\ubuntu but not just \\wsl.localhost
Is there any way to allow access to \\wsl.localhost again?
edit:
I found a workaround, sadly microsoft is just stupid again.
The address now is \\wsl$ probably because of an update.
I had to go into regedit:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}\Instance\InitPropertyBag
And change the ResName from \\wsl.localhost to \\wsl$
For that i had to take full ownership of the {B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6} folder and give me full access rights so i could change ResName. Now it's working fine.

Related

Docker not starting on Windows 11 with WSL 2

I'm trying to setup docker with WSL 2 to run a Dockerfile. I downloaded Docker Desktop, and when I tried to follow the quick start guide, I got the following error:
docker: error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%d2Fdocker_engine/v1.24/containers/create?name=repo": open //./pipe/docker_enginer: The system cannot find the file specified.
I set com.docker.service to run in the Task Manager, and have run:
“c:\Program Files\Docker\Docker\DockerCli.exe” -SwitchDaemon
I have also quit Docker Desktop and reopened it in admin mode, and I still get the message that Docker Desktop has stopped.
Please let me know if there's any other options, thanks!
I managed to solve the problem in this way:
delete config file AppData/Roaming/Docker/settings.json
start Docker Desktop (it will create new default settings.json)
You need to re-configure settings, so it is also good idea to save the old settings.json and compare settings with the new one.
If you are running Docker Desktop for Windows 4.5.0 then you should be aware of an existing issue where the default backend selected after installing is not the correct one.
You can switch to the correct backend manually by editing the file located at: %AppData%\Docker\settings.json (full path: C:\Users\%UserName%\AppData\Roaming\Docker\settings.json) and at the bottom of the file change the value for the wslEngineEnabled field to true. After that Docker Desktop should start correctly.
Similar issue and solution is mentioned here by the user mccaa25.
latest version 4.5.0 It won't work for me too, for me downgrade to 4.4.4 it worked. It may be problem with the latest version
for released note and older version Here
Note: You can install an older version and update to latest version 4.5.0
Wow! I spent multiple days trying to get Docker for windows 11 to work. What finally did it was downgrading to version 4.4.4 as #GinglrBell recommended. Here's a link Docker version 4.4.4.
Make sure WSL is installed and virtualization is enabled. If you try to open WSL and you get an error telling you to enable virtualization in BIOS, run this command as Admin in powershell: bcdedit /set hypervisorlaunchtype auto (Docker src). Then restart your PC.
I hit this issue today, and the steps below are what worked for me - the gist is that I needed to install WSL 2 beforehand. Most of my steps were derived from here:
open powershell as admin
wsl -l -v # Windows Subsystem for Linux has no installed distributions
install linux kernel update from here # in my case, x64-based
wsl --set-default-version 2
wsl --list --online # shows several linux distributions, I picked a recent one
wsl --install -d Ubuntu-20.04 # then create default linux user name and password
install windows docker desktop from here # now starts successfully
Manged to switch to Windows Containers. (Docker v4.9.0)
What I did was to change the following in the settings.json:
"useWindowsContainers": true,
"wslEngineEnabled": true,
Also set security on folder:
C:\ProgramData\Docker (I set "Everyone" full control.)
After that I used the "Switch to Windows Containers"-feature from the task-bar icon content menu
I tried Janne Rantala's method.
But the same problem occurs again after several days.
My final solution is to uninstall Docker Desktop, then download and run the installation file as an administrator.
Then the problem no longer appears again.
I was able to resolve this issue on my machine by installing the Linux kernel update package as described in the Microsoft guide
I have been having some Docker setting up troubles for a fair amount of time. I think I had to just make sure I removed all references of Docker. After buying Windows 10 pro I still had issues, I did have to look into the following folders:
C:\Users\%UserName%\AppData\Local\Temp\Docker
C:\Users\%UserName%\AppData\Roaming\Docker
I also deleted the Docker file in my programfiles folder
Navigated to said file and deleted Docker files.
Used the docker installer, checkboxes (to use wsl2).
I was faicing the same issue and resolved. I have just open Microsoft Store application and after that opened the docker and its working fine. This is wired but sharing this so it might helps someone.
I solved this issue by enabling the windows feature "Windows Hypervisor Platform" and restarting my computer.
I installed Docker Desktop v4.16.2

Docker - Was trying to move Docker off my C: drive, messed something up now I can't reinstall it (Windows 10)

I was trying to move Docker off my C: drive using the guidance below:
https://forums.docker.com/t/how-could-i-install-docker-for-windows-on-drive-e-my-ssd-c-is-full/52347/12
I completed the final step: sc.exe config com.docker.service binPath=“D:\Program Files\Docker\com.docker.service” and it seemed to work. But when I went to run Docker, it wouldn't run, so I deleted it off my E: drive.
But now, when I try to reinstall it, it says Docker is already installed. I go to Apps & Features to uninstall it, but it gives me:
Windows cannot find 'C:\Program Files\Docker\Docker Desktop Installer.exe'. Make sure you typed the name correctly, and then try again.
Having had Docker removed from my PC and running into the same issue while reinstalling, the only way that worked for me was looking up the Docker application within the Windows Registry Editor and deleting it from there.
You would need to open up Registry Editor or use Run and type in regedit, and within this path look for anything mentioning "Docker", "Docker Desktop" or the path that windows "cannot find":
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
source from when I had issues: https://github.com/docker/for-win/issues/1371#issuecomment-347926743

How do I uninstall Docker or remove the Docker directory?

I am trying to learn Docker and have installed it on my laptop. I have tried to uninstall it and delete the Docker directory as Administrator, but keep getting the error message "The action cannot be completed because the file is open in Docker Desktop service". But Docker Desktop Service is not open, and does not appear whenever I open Task Manager. When I try to reinstall Docker, it says it it up to date, when clearly it is not. I would appreciate any help getting a fresh installation of Docker.
Here is the Docker directory C:\Program Files\Docker\Docker.
Here is the error message.
If you have access to the windows machine, through UI, you can:
Go to Start -> Services, and search for the Docker (probably is called Docker Desktop or something similar) service and
Manually Stop. You can also set the service to start Manually, not Automatically, give a restart and
Now Docker is completely stopped and
You can uninstall safely.
User azbarcea answered the question.

Docker Desktop 3.1.0 installation issue - access is denied

I am trying to install Docker Desktop to my Windows 10 Professional Build 19042 and receive an installation error even when trying to install as 'Administrator'.
Error: Component CommunityInstaller.ServiceAction failed: Failed to start service: Access is denied ...it is not clear to me what specifically Docker cannot access.
Curious to see if anyone has a solution to this issue.
You may need to add your account to the "docker-users" group. See
https://github.com/docker/for-win/issues/785, especially nfunky response on Aug 10, 2020. I used the following command and it resolved that problem for me where "username" is your Windows username:
net localgroup "docker-users" "username" /add
According to the documentation, first you should control the requirements based on your operating system. Next, uninstall the older versions. For example if you are using windows OS, look at this picture
and make sure these items are active in advance.
plus, make sure Hyper-V is installed and working (check the link above).
Finally, if you have this error message while opening the docker desktop:
You are not allowed to use Docker. You must be in the “docker-users” group
you should add your user to docker-users named group created under Computer Management/user and groups/groups. look at this link

How to change file permissions in localhost Windows 10 pro/docker/ddev container for Drupal site?

I have installed a drupal 8.8 site using Composer on a Windows 10 pro system and docker and ddev as the development environment.
The drupal site seems to be functioning normally: I see no errors in the drupal log nor when I run ddev describe.
The only exception: Drupal gives me a warning that sites/default/settings.php needs to be write protected. In the past I have done this on a live site using Filezilla, but this is a development only site and it seems Filezilla does not apply permissions on local files--at least, when I right-click the file locally, I do not find a command for changing permissions.
I tried changing the write permissions with Windows 10 itself, but that did not seem to have any effect--I suspect for windows those are different kinds of permissions.
I poked around online and saw something that made me think I could use phpmyadmin to change permissions. Got caught up in that and struggled with it, until getting some help here (How to access phpmyadmin on DDEV Windows 10 pro localhost with SSL record too long error) but it turns out you can't change file permissions with phpmyadmin, apparently.
I tried to use the address that connected me to phpmyadmin in my browser to connect with Putty, but Putty tells me the host does not exist.
So the help I am looking for: how can I change file permissions for sites/default/settings.php in Windows 10 pro localhost running docker/ddev development environment for my drupal site?
Thank you!
I assume you're talking about this warning?
First, you can ignore this warning completely. You're on a local development environment, and so you shouldn't have any concerns about the permissions of settings.php.
Unfortunately, in a Windows environment, you can't make simple permissions changes as Drupal 8 is suggesting that you do.
Note that settings.ddev.php explicitly provides the skip_permissions_hardening option, $settings['skip_permissions_hardening'] = TRUE; to tell Drupal 8 not to try to change permissions on sites/default and sites/default/settings.php because it's just a dev environment and because when Drupal does these things it just makes things harder.
However, to make most things easier on Windows (doesn't solve that problem)...
Use nfs_mount_enabled
I see there are loads of problems with the new "official" Drupal 8.8.0 composer build on Windows. Most of them are due to the composer build making some assumptions about the ability to set time and ownership, but the docker mount used by default (CIFS) has everything owned by root, so the container can't change permissions (even thought they're wide open).
I found that I could get by all of these things by using NFS to mount into the container, and you'll also find it improves performance quite a lot. Set up for NFS by following the instructions at https://ddev.readthedocs.io/en/stable/users/performance/#windows-nfs-setup

Resources