vdsm / virtual-dsm

Virtual DSM in a Docker container.
MIT License
2.73k stars 364 forks source link

No auto-discovery (WSD) #661

Open inuites opened 8 months ago

inuites commented 8 months ago

Hi everyone, I've set up my vDSM with a MacVLAN network. It's working fine; the vDSM has its own IP address (192.168.1.241), and I can manually access the shares in Windows by entering the share path, for example, \192.168.1.241\share1. Unfortunately, SMB discovery isn't working, even though WS-Discovery is activated in the DSM configuration panel. Is there anything else I could do to resolve this issue?

macVLAN settings

docker network create -d macvlan \
    --subnet=192.168.1.0/24 \
    --gateway=192.168.1.1 \
    --ip-range=192.168.1.240/28 \
    -o parent=enp6s18 vdsm

docker-compose.yml:

services:
  dsm:
    container_name: dsm
    image: vdsm/virtual-dsm
    environment:
        RAM_SIZE: "8G"
        CPU_CORES: "4"
        DISK_SIZE: "16G" # system disk
        ALLOCATE: "N" # growable disk
        DISK_FMT: "qcow2" # growable disk
        DEVICE2: "/dev/vdb" # data disk
        DHCP: "Y"
    devices:
        - /dev/kvm
        - /dev/vdb #passthrough proxmox virtual disk to docker
        - /dev/vhost-net
    networks:
      vdsm:
        ipv4_address: 192.168.1.240
    device_cgroup_rules:
        - 'c *:* rwm'
    cap_add:
        - NET_ADMIN
    volumes:
        - /var/dsm:/storage # location of local DSM
    restart: unless-stopped
    stop_grace_period: 1m

networks:
  vdsm:
    external: true

Thank you very much

kroese commented 8 months ago

Maybe the DSM firewall is activated and needs an exception for WSD discovery. You could try if it makes any difference when disabling the firewall temporarily.

inuites commented 8 months ago

Thank you for your response. This is a fresh install, and the DSM firewall is off by default. Activating or deactivating the firewall doesn't seem to make a difference. For additional context, DSM is running in a Debian VM hosted on Proxmox. Is anyone else experiencing this issue?

inuites commented 8 months ago

Using nmap it seems that port 3702 used for WS-Discovery is closed on vDSM. I tried also without macvlan and forcing port mapping 3702:3702 but still not working :/ image image

kroese commented 8 months ago

The port 3702 with WSDD is UDP and not TCP. So I am not sure if nmap will detect it, because it seems it can only scan TCP ports.

inuites commented 8 months ago

Yes you're right. I've just tested my real synology and 3702 is closed too so it means nothing

GreatApo commented 7 months ago

Just commenting for anyone that ends up here due to macvlan setup issues:

  1. Using macvlan is required if you want to share folders at the same port with vDSM shares (e.g. Samba shares). It is also better if you do so when sharing drives from the host to the vDSM through mount remote folders.
  2. If you use portainer, do not setup the macvlan network through it. Instead use the given command.
  3. If you don't know you parent network card (e.g. eth0), you can use the following command (debian): find /sys/class/net -type l -not -lname '*virtual*' -printf '%f\n'
inuites commented 7 months ago

Actually even using ports mapping without Macvlan I can't manage to auto-discover Samba shares with WS Discovery feature. So it looks like that Macvlan has nothing to do with it.

docker compose

services: dsm: container_name: dsm image: vdsm/virtual-dsm environment: RAM_SIZE: "4G" CPU_CORES: "4" DISK_SIZE: "16G" # system disk ALLOCATE: "N" # growable disk DISK_FMT: "qcow2" # growable disk devices:

Note: If I setup an official virtual DSM on true synology device, then WS discovery is working correctly.

@kroese Do you manage to see virtual DSM in windows networks for instance ?

Thank you for your help

kroese commented 7 months ago

@inuites You mapped 3702 as a TCP port, but for UDP I think it should look something like: - 3702/udp:3702/udp I guess.

I don't have a Windows network at my house and I am not using the container for any file sharing myself (but for Surveillance Station), so I have no easy way to test it. But as nobody ever mentioned this issue before, I just assumed it worked, otherwise I would have expected more people complaining about it.

So maybe someone else who reads this can comment if it works for them or not.

pandamelive commented 4 months ago

我也遇到这个问题,正在寻找解决办法

emkookmer commented 2 months ago

@inuites, Did you enable promiscuous mode on proxmox ?

inuites commented 2 months ago

Thank you for the suggestion. I enabled it as you recommended, but unfortunately, it doesn't seem to have made a difference.

Have you encountered this issue as well? I can't determine whether it's affecting everyone or just a few users. Understanding this could help me figure out whether I should focus on the host side, Docker settings, or the container itself to find a solution..

emkookmer commented 2 months ago

Yes, I've encountered similar issues when running AdguardHome as Docker container with macvlan