crazy-max / docker-samba

Samba Docker image
MIT License
474 stars 49 forks source link

Can't rename/move/delete files over SMB on macOS Ventura #50

Open rowatt opened 1 year ago

rowatt commented 1 year ago

Behaviour

I have set up the container on an Intel Mac (macOS Ventura 13.2), and I am able to share a folder (public) to other macs on the network. However, while a client (macOS 13.2 or macOS 10.15) can mount and write to files, they cannot move or rename files (in Finder or from terminal) and when copying files from Finder, an error is generated resulting in a zero bytes file of the correct name (which can subsequently be opened and written to).

If I have the shared folder within the docker container itself, then the share works as expected and I can rename/move/delete files as expected.

Is this container expected to work when running on a macOS host?

Steps to reproduce this issue

  1. start Docker container on server
  2. mount share public on client mac
  3. go to /Volumes/public in terminal on client mac
  4. touch test.txt; mv test.txt test2.txt

Expected behaviour

File test2.txt should be created in public share.

Actual behaviour

File test.txt is created and error given: mv: rename test.txt to test2.txt: Operation not supported

Configuration

docker-compose.yml:

version: '3.5'
services:
  samba:
    image: crazymax/samba 
    container_name: samba
    ports:
      - 139:139
      - 445:445
    volumes:
      - ./data:/data
      - ./public:/samba/public
    environment:
      - TZ=Europe/London
      - SAMBA_LOG_LEVEL=1
    restart: always

config.yml:

auth:
  - user: mark
    group: mark    
    uid: 501
    gid: 501
    password: test

global:
  - "log level = 3"
  - "fruit:aapl = yes"
  - "fruit:resource = xattr"
  - "fruit:nfs_aces = no"
  - "min protocol = SMB2_10"
  - "max protocol = SMB2_10"
  - "ea support = yes"

share:
  - name: public
    path: /samba/public
    browsable: yes
    readonly: no
    guestok: no
    writelist: mark

Docker info

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.10.0)
  compose: Docker Compose (Docker Inc., v2.15.1)
  dev: Docker Dev Environments (Docker Inc., v0.0.5)
  extension: Manages Docker extensions (Docker Inc., v0.2.17)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.23.0)

Server:
 Containers: 5
  Running: 2
  Paused: 0
  Stopped: 3
 Images: 7
 Server Version: 20.10.22
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.842GiB
 Name: docker-desktop
 ID: PS4U:WDPK:GI5T:OULQ:7ZPB:2CFA:ZAHE:2EIN:ET6N:D4AX:OFJS:GFHN
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false
toondaey commented 1 year ago

Hello! Were you able to solve this?

rowatt commented 1 year ago

No. In the end I installed SMB directly via Homebrew which has worked great, and much more reliable than native macOS file sharing had ever been for me.