windows icon indicating copy to clipboard operation
windows copied to clipboard

[Bug]: File synchronization exception in shared folder

Open MKLhusky opened this issue 8 months ago • 3 comments

Operating system

archlinux

Description

I generated an Excel file in the Java program of the podman container on the host computer and placed it in the/home/example directory. This directory corresponds to the \ \ host.lan \ Data directory, but sometimes it can be synchronized quickly or slowly in the \ \ host.lan \ Data path inside the Windows container. I tried refreshing it by pressing F5 in the \ \ host.lan \ Data directory, but the corresponding file did not appear until after a while, about 1-2 minutes

Docker compose

sudo podman run --rm -it --name windows \
  --net=bridge \
  --cap-add=NET_ADMIN \
  --cap-add=NET_RAW \
  --device=/dev/kvm \
  --device=/dev/net/tun \
  --sysctl net.ipv4.ip_forward=1 \
  -v "${PWD:-.}/windows:/storage" \
  -v /home/example:/data \
  -p 8006:8006 \
  -p 8000:8000 \
  --stop-timeout 120 \
  dockurr/windows

Docker log

sudo podman run --rm -it --name windows \
  --net=bridge \
  --cap-add=NET_ADMIN \
  --cap-add=NET_RAW \
  --device=/dev/kvm \
  --device=/dev/net/tun \
  --sysctl net.ipv4.ip_forward=1 \
  -v "${PWD:-.}/windows:/storage" \
  -v /home/example:/data \
  -p 8006:8006 \
  -p 8000:8000 \
  --stop-timeout 120 \
  dockurr/windows

Screenshots (optional)

Image

Image

MKLhusky avatar May 10 '25 03:05 MKLhusky

I have also encountered the same problem. Have you solved it?

fu7100 avatar Jul 08 '25 06:07 fu7100

Try with version v5.00 of the container, it has a bit newer version of Samba, maybe that fixes the issue.

kroese avatar Sep 18 '25 18:09 kroese

Pissed me off too...

Solved by adding a key in the Windows container registry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
"DirectoryCacheLifetime"=dword:00000000

References: https://woshub.com/slow-network-shared-folder-refresh-windows-server/ https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/ff686200(v=ws.10) https://learn.microsoft.com/en-us/windows-server/administration/performance-tuning/role/file-server/

The default value is said to be 10 seconds, but it's definitely not the case (somebody at MS mixed up seconds and minutes ?). However, with the value set to 0, we now get instant updates.

Would be great to see this included within the unattended install xml.

Edit : The new files took minutes to appear in a Tiny11 23H2 container, which led me to investigate and test the abovementioned registry setting with success. But, on Tiny11 25H2, the new files appear quickly out of the box. (Seems that the default 10 seconds value is properly applied here)

stncrn avatar Oct 16 '25 09:10 stncrn