Use WebDAV to create an environment to access Linux files in the USB memory from Windows Explorer.
I think that it is common to use samba when you want to access Linux files on a virtualized PC with Windows Explorer, but it seemed to be extremely troublesome to set due to port numbers etc., so I decided to use WebDAV.
Probably there is no official container due to demand, so basically enable WebDAV with default disabled based on Official Apache using httpd container It seems that the theory is to create a Dockerfile that makes various settings.
It's a hassle, so use bytemark / webdav. As of August 2020, it seems that the most used WebDAV container is devised so that necessary items can be set with environment variables.
If you want to create your own Dockerfile, this article may be helpful.
Assuming that a server is set up on Linux in a USB memory So, in the direction of ignoring the security gun.
ANONYMOUS_METHODS: ALL enables anonymous access without authentication for all methods. Even so, if you do not set the authentication method to Digest and set the user name and password, it seems that an error will occur even if you access from Windows.
If you set [Arbitrary directory]: / var / lib / dav / data in volume, [Arbitrary directory] will be the root folder when accessed by WebDAV.
webdav:
image: bytemark/webdav
restart: always
ports:
- "80:80"
environment:
AUTH_TYPE: Digest
USERNAME: user
PASSWORD: abcdefgh
ANONYMOUS_METHODS: ALL
volumes:
- /root:/var/lib/dav/data
Doing this in a directory somewhere on Linux docker-compose -up will start the WebDAV server.
If there is no problem with the setting, in the address bar of Explorer
\\localhost@80\DavWWWRoot
Then you should see the files and folders on the Linux side.
SUBST allows you to assign a WebDAV folder to any drive letter without administrator privileges.
Even software that does not work with the above UNC path may work if you assign a drive letter.
subst Z: \\localhost@80\DavWWWRoot
In fact, Visual Studio Code doesn't work when I try to open a folder with a UNC path (it opens a completely unrelated folder), but assigning a drive letter works.
The title bar shows a disconnected network drive, but it seems to be connected.
Recommended Posts