Unable to share C drive on Docker for Windows - docker

I am running Docker Desktop for Windows on Windows 10 Enterprise. I get the following:
PS C:\Users> docker run --rm -v c:/Users:/data alpine ls /data
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error
response from daemon: C: drive is not share it in Docker for Windows
Settings.
From Docker settings in the Shared Drives tab, I see that the C drive is there, but it is not checked. When I check it and press Apply, I am prompted for my password. Upon entering it successfully, the C drive is still not checked.

There are different problems that people face with sharing. But the common one is a non-english character based password or a password with spaces.
If you can change your password and remove spaces/special non-english characters then it should work.
Other workaround that you can try is create a local user and give it access to C: and then when sharing C:\ in docker settings, using this local user credentials

The user account supplied also needs to have admin permission. Seems obvious but Docker doesn't return an error message when it fails (Version 18.06.1-ce-win73 (19507)). Remember to subsequently run PowerShell as that admin account in order to access share.

Related

VS Code log into container as specific user

I built a Debian 10 sandbox container where I could play with my code bases. I added a user to maintain a permission wall between sudo commands typed too quickly with
USER ELDUDE
in the Dockerfile. However, when I build the container with that user as default login option VS Code fails to connect to the container with
Error: stream ended with:124 but wanted 1128865906
This is the initial error that brought me down this path.
If I do not specify the default user in the Dockerfile I can connect fine but VSCode server in the container runs as root. Now, that becomes a mess with file permissions etc if I start working on stuff.
Any idea what is going on? Can I set user names when I log into a container?
I also thought of enabling SSH on the container and connect through VS SSH but that failed thus far...

How to login remotley to windows from alpine docker image without GUI or SSH

I need to achieve to get an user actively logged into several windows virtual machines from a docker alpine container. I can't use remote desktop, as I have no GUI. I also don't think to really control the Virtual Machines at all, I just need a local user of the virtual machines to be logged in.
How do I achieve that without overcomplicating stuff?
For everyone reading this in the future:
I just activated the autologin feature of Windows 10. In that way, I ensure that my machine always automatically logs in with provided credentials.
To acieve that do the following steps:
Open your registry editor
Navigate to the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon
If one of the following doesnt exist, just create them:
Edit "DefaultUserName" to the user you want automatcally to log in
Edit "DefaultPassword" to the password of the user you want to log in
Edit "AutoAdminLogon" and change value from 0 to 1
Restart your computer

What is the default username and password for the administration console of the payara full app server when booted from the official docker image?

I'm using the official docker image for payara full, the 5.183 version, here is my setup.
I've tried admin/blank, admin/admin, admin/changeit, nothing works.
I could not find any documentation on the payara site about this and the blogs I've found related to this did not help.
The credentials for all Payara Server docker images are admin/admin for the username and password. You can find this out in the README in the GitHub repositories (also available in Docker Hub):
https://github.com/payara/docker-payaraserver-full/blob/5.183/README.md
...the admin interface is secured by default (in both the default domain1 as well as payaradomain), accessible using HTTPS on the host machine: https://localhost:4848 The default user and password is admin.
You can also see this is the case from the actual Dockerfile at line 34:
https://github.com/payara/docker-payaraserver-full/blob/5.183/Dockerfile#L34
ENV ADMIN_PASSWORD admin
If this isn't working for you, then something else is probably going on.
I tested this myself using docker run -it -p 4848:4848 payara/server-full:5.183 and found I could log in with admin/admin. For reference, here is the exact image I was using:
REPOSITORY TAG IMAGE ID CREATED SIZE
payara/server-full 5.183 b216dd970898 3 months ago 973MB
Check that your ID matches to verify that it is the same image.
I have been in a similar situation - the difference was that it wasn't a docker image - I had only to execute asadmin change-admin-password from the ...\payara-5.2020.5\glassfish\bin folder and when prompted for the current admin password (eg. "Enter the admin password>") just leave blank and continue with the next steps of setting it.
So, basically, what I have learnt from this is that the password is not yet set and you have to use the CLI to set it before using the console.
Note: I have taken the summary above from here. You may also check if the full scenario from there fits you better.

IoT Edge : device can't download my module from Azure Container Registry but it can from dockerhub

I followed this azure example to develop my module connectedbarmodule in python for Azure IoT Edge. Then , I followed this link to deploy my module in my device (raspberry pi 3). However, my module can't be downloaded. Then, I executed the following command on my device :
sudo docker logs -f edgeAgent
I have the following error:
Error calling Create module ConnectedBarModule:
Get https://iotedgeregistery.azurecr.io/v2/connectedbarmodule/manifests/0.0.1-amd64:
unauthorized: authentication required)
This is an url regarding my Azure Container Registry where the image of my module is stored. I don't know how to get the credentials for iotedge to download my module.
I tested the case to pu the image not in the Azure Container Registry but in my dockerhub account and it works, my device can download the module.
If someone has an idea, this would be very kind.
Thank you in advance.
Your Azure Container Registry is private. Hence, you need to add the credentials for it in order for the edgeAgent to be download images from private registries:
Through the Azure Portal: In the first step of "Set Modules"
When done through deployments in Visual Studio Code:
"In the VS Code explorer, open the .env file. Update the fields with
the username and password values that you copied from your Azure
container registry." (https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#add-your-registry-credentials)
For your issue, you can use the command docker login -u <ACR username> -p <ACR password> <ACR login server> which shows in the example you posted. About the authentication of Azure Container Registry, there are two ways you can choose.
One is that use the user and password which shows in your ACR on the Azure portal.
Another is that you can use the Azure Service Principal, you can set the permission for the user. Follow document Azure Container Registry authentication with service principals. I would suggest this way much more than the first because it's safer.
It's just an advice. Hope this will help you and if you need more help please show me the message.

Error while sharing local drive(volume) with docker for windows

I am getting below error when I try to share local drive(volume) with docker for windows
docker run --rm -v c:/Users:/data alpine ls /data
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: C: drive is not shared. Please shar
e it in Docker for Windows Settings.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
I tried sharing the folder from the docker settings and provided my username and password but no luck and getting same error
I had a similar issue with the error message "docker: Error response from daemon: Drive sharing failed for an unknown reason."
I opened the docker settings > Shared Drives > checked on C drive > Click Apply
and re-started docker to resolve the issue
I was facing a similar issue when starting containers with docker-compose. I got an error:
A firewall is blocking file sharing between Windows and the containers.
Then I checked settings for Docker and under Shared Drives section I tried to check the checkbox for C: drive, but after hitting apply checkbox unchecked itself.
Then I copied the line docker run --rm -v c:/Users:/data alpine ls /data into Powershell, ran it and got the error:
Drive sharing failed for an unknown reason.
But after this error, I decided to just try restarting Docker. After the restart, I tried to check the checkbox in the Shared Drives section once again and now it stayed checked and everything is working as it should.
I was using Docker Stable version.
At the moment at Creators Update (1703) Samba shares are not working. There are a lot of tickets in official repo:
For example: #662, #669, #756
There is workaround described here:
The same started happening for me after installing the Win 10 Creators Update (Build 15063)
Firewall rules are not the issue, those are correct
for some reason, after a reboot, I cannot access any local SMB shares on the DockerNAT interface (10.0.75.1)
I am able to fix this temporarily by disabling and & re-enabling the"File and Printer Sharing for Microsoft Networks" component on the virtual "DockerNAT" network interface.
afterwards, I am able to browse \10.0.75.1
disable & re-enable the shared drive in Docker settings and it works - until next reboot
I was dealing with similar issue during setup.
I couldn't share my directories with Docker because I was using my Azure AD login credentials. You need to create a local admin user. If the local admin doesn't appears right away you would need to reinstall Docker under local admin user.
I hope this helps someone struggling with similar issue.
Like Shweta Gupta was saying, if you are using an AzureAD user, you'll need to create a local account on your machine, and use that to give Docker permissions to the drive.

Resources