Skip to content
The Chat Archive
gemma-3-27b-it· Google LMArena Human Preference 140K

i have a problem sharing videos from my pc to my phone via samba and vlc player. i did…

  1. User

    i have a problem sharing videos from my pc to my phone via samba and vlc player. i did create share of a external HDD (usb) and it is properly displayed in the vlc player (on the phone) but when i try to connect to it, the vlc player always ask for user credentials multiple time even thou i check the "remember password" checkbox. it also ask for the credentials for each directory i try to open (in vlc on the phone). any idea what is the problem?

  2. Assistant

    Okay, this is a common issue with Samba and VLC on mobile. Here's a breakdown of potential causes and solutions, covering Samba configuration, VLC settings, and troubleshooting steps. I'll try to be thorough.

    1. Samba Configuration (PC Side - Most Likely Culprit)

    • Guest Access (Simplest, but Least Secure): The easiest fix, if security isn't a huge concern on your local network, is to allow guest access to the share. This bypasses the need for usernames and passwords. However, understand the security implications before doing this.

      • Edit your smb.conf file (usually located in /etc/samba/smb.conf on Linux, or you can access it through the Samba Server settings in Windows).

      • Find the share definition for your external HDD. It will look something like this:

        [MyExternalHDD]
        path = /mnt/your_hdd_mount_point  # Or the drive letter on Windows
        valid users = your_username
        read only = no
        
      • Change it to:

        [MyExternalHDD]
        path = /mnt/your_hdd_mount_point
        guest ok = yes
        read only = no
        browseable = yes
        public = yes
        
      • Important: After making changes to smb.conf, restart the Samba service. On Linux: sudo systemctl restart smbd and sudo systemctl restart nmbd. On Windows, restart the "Server" service.

    • User Permissions (More Secure, Recommended): If you want to use usernames and passwords, ensure the user you're using on your phone exists as a Samba user and has the correct permissions.

      • Create a Samba User: Even if the user exists on your PC, you need to create a Samba password for them. On Linux:

        sudo smbpasswd -a your_username
        

        (Replace your_username with the actual username.) You'll be prompted to enter a password. This password can be different from your PC login password.

      • Verify User in smb.conf: In your smb.conf share definition, make sure valid users = your_username is correct. You can specify multiple users separated by commas (e.g., valid users = user1, user2).

      • File System Permissions: The user needs read (and write, if desired) permissions to the files and directories on the external HDD at the file system level. This is separate from Samba permissions. On Linux:

        sudo chown -R your_username:your_username /mnt/your_hdd_mount_point
        sudo chmod -R 755 /mnt/your_hdd_mount_point  # Read/execute for all, write for owner
        

        (Adjust permissions as needed. 777 is overly permissive and generally not recommended.) On Windows, right-click the drive/folder, go to Properties -> Security, and add the user with the appropriate permissions.

    • Security Level: Samba has different security levels. Sometimes, a higher security level can cause authentication issues. Try lowering the security level temporarily to see if it resolves the problem. In smb.conf:

      • security = user (This is the most common and generally recommended setting.)
      • security = share (Less secure, but can sometimes help with compatibility.)
      • security = domain (Used in domain environments.)

      Restart Samba after changing the security level.

    2. VLC Player (Phone Side)

    • Clear Credentials: VLC sometimes caches incorrect credentials. Try clearing the saved credentials within VLC. The exact location of this setting varies slightly depending on the VLC version and platform (Android/iOS), but look for something like:
      • Android: Settings -> Network Access -> Clear Credentials
      • iOS: Settings -> Network Access -> Clear Credentials
    • Network Protocol: In VLC's network stream settings (where you enter the Samba URL), try different protocols. Sometimes, one works better than another. The URL format is usually something like:
      • smb://your_pc_ip_address/MyExternalHDD
      • smb://your_pc_username:your_password@your_pc_ip_address/MyExternalHDD (This should work, but VLC's handling of embedded credentials can be flaky.)
    • VLC Version: Make sure you're using the latest version of VLC on your phone. Older versions might have bugs related to Samba authentication.
    • Network Stability: A flaky Wi-Fi connection can cause intermittent authentication failures. Ensure your phone and PC are on a stable network.

    3. Troubleshooting Steps

    • PC IP Address: Make sure you're using the correct IP address of your PC. It can change if your PC is using DHCP. On Windows, open a command prompt and type ipconfig. On Linux, type ifconfig or ip addr.
    • Ping Test: From your phone (using a terminal app if necessary), try to ping your PC's IP address to verify network connectivity.
    • Simple Share: Create a very simple share with a single, small file to test. This helps isolate whether the problem is with the share itself or with the files/directories.
    • Firewall: Ensure your PC's firewall isn't blocking Samba traffic. You might need to add exceptions for ports 137, 138, 139, and 445 (TCP and UDP).
    • SMB Version: Samba supports different SMB versions (SMB1, SMB2, SMB3). Sometimes, compatibility issues arise. You can try forcing a specific SMB version in your smb.conf file. (This is more advanced.)
      • server min protocol = SMB2 (Try this first)
      • server max protocol = SMB3
    • Windows Networking Service: On Windows, ensure the "Function Discovery Resource Publication" service is running. This helps with network discovery.

    To help me narrow down the problem, please provide:

    • Operating System of your PC: (Windows 10/11, Linux distribution)
    • Samba Version: (You can find this by running smbd --version on Linux, or checking the Samba Server properties in Windows.)
    • Phone Operating System: (Android, iOS)
    • VLC Version on your phone:
    • The exact Samba URL you're using in VLC: (e.g., smb://192.168.1.100/MyExternalHDD)
    • A snippet of your smb.conf share definition: (Redact any sensitive information like passwords.)

    Let me know the results of these steps, and I'll do my best to help you get it working! Start with the Samba configuration (especially guest access or user permissions) as that's the most common source of these issues.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.