All Products
Search
Document Center

Cloud Storage Gateway:Access Cloud Storage Gateway from a Windows client

Last Updated:Mar 09, 2026

This topic describes how to mount and access an SMB protocol share using a Windows system.

Prerequisites

  • An SMB protocol share is created. For more information, see Create a share.

  • You have created an ECS (Windows) instance. For more information, see Create an ECS instance.

    Ensure port 445 is open. SMB protocol shares communicate through port 445. If port 445 is not open, you must add a security group rule for port 445 in the security group of the target ECS instance. For more information, see Using security groups.

Note
  • A file gateway deployed on Alibaba Cloud can have up to 16 SMB shares. The maximum number of SMB shares supported by different types of gateways varies due to differences in CPU and memory specifications. For more information, see Specifications.

  • After shares are mounted, the displayed maximum capacity of file systems varies based on the file gateway specifications. For more information, see the recommended file system capacity provided in the Specifications of cloud file gateways table.

  • Starting from V1.0.35, if no user is configured for an SMB share, a client accesses the SMB share as a public user by default. If you have configured users, you must grant them read and write permissions or read-only permissions before they can access the SMB share. For more information, see Configure an SMB share.

  • After changing SMB user permissions, run the net use /delete <share path> command to clear client information in the Windows system. Do not restart the client.

Step 1: Prepare the environment

Perform the following steps only once when you first mount each Windows server. Do not repeat them for every mount operation.

  1. Connect to an ECS instance.

  2. For the following system versions, configure the client to allow anonymous access.

    1. For Windows Server 2016 and later, execute the following command.

      REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters /f /v AllowInsecureGuestAuth /t REG_DWORD /d 1
    2. For Windows Server 2025, also perform the following operations to disable SMB signing:

      1. Open CMD as an administrator and execute the following command:

        REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v RequireSecuritySignature /t REG_DWORD /d 0 /f
      2. Restart the computer for the changes to take effect.

  3. Enable the Workstation service.

    1. Select All Programs > Accessories > Run or use the keyboard shortcut Win+R. Enter services.msc to open local services.

    2. Find Workstation in Services. Confirm its status is Running and its startup type is Automatic.

      Normally, the Workstation service is enabled by default.

      Workstation

  4. Enable the TCP/IP NetBIOS Helper service.

    1. Open Network And Sharing Center, and click on the network the host is connected to.

    2. Click Properties, double-click Internet Protocol Version 4, and then click Advanced.

    3. In the Advanced TCP/IP Settings dialog box, select WINS > Enable NetBIOS Over TCP/IP.Enable NetBIOS over TCP/IP

    4. Select All Programs > Accessories > Run or use the keyboard shortcut Win+R. Enter services.msc to open local services.

    5. Find TCP/IP NetBIOS Helper in Services. Confirm its status is Running and its startup type is Automatic.

      Normally, the TCP/IP NetBIOS Helper service is enabled by default.

      TCP/IP NetBIOS Helpe

Step 2: Mount an SMB protocol share

SMB protocol shares support both manual and automatic mount methods. Manual mount is for temporary mounts. Remount the share after each server startup or restart. Automatic mount is for persistent mounts. You do not need to remount the share after each server startup or restart. To prevent mount information loss and ensure visibility of mounted file systems after a server restart, configure automatic mount after a successful manual mount.

Manually mount an SMB share

  1. Connect to the ECS instance.

  2. Open a CMD command line window and execute the following command to mount the SMB share.

    net use Z: \\gateway_ip\share_name

    Parameter

    Description

    Z

    The target drive letter to mount on the current Windows system. If conflicts occur or multiple SMB shares are mounted, assign drive letters in descending alphabetical order.

    gateway_ip

    The Cloud Storage Gateway IP address. Replace it with the actual value. In the Cloud Storage Gateway console, find the target Cloud Storage Gateway. View the mount target on its Shares page. The default is an IPv4 mount target.

    Note
    • Only the China (Hohhot) region supports IPv6 mounts. The Virtual Private Cloud (VPC) and vSwitch used by the gateway must support IPv6.

    • Before using IPv6 mounts, ensure the ECS client has an IPv6 address configured.

    • If an existing gateway's VPC and vSwitch support IPv6, enable IPv6 in the gateway's operation list. The second row of mount targets will then display the IPv6 mount target by default. Gateways newly created in this VPC support IPv6 by default and do not require explicit enabling.

    share_name

    The SMB share name.

  3. Confirm the SMB protocol share mounted successfully.

    • Execute the command: net use

    • Example output

      If a command output such as the following example appears, the SMB file system is mounted. After an SMB share is mounted, you can access the SMB share in the same way that you access a local directory. If you have write permissions on the SMB share, you can write data to the SMB share. If you have read-only permissions on the SMB share, you can only read data from the SMB share. For more information, see Manage Shares.

      image

(Optional) Automatically mount an SMB share

Configure the c:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\auto_mount.bat file on your Windows ECS instance to automatically mount SMB protocol shares when ECS restarts.

  1. Open a CMD command line window. Execute the following command to configure the `auto_mount.bat` script.

    echo %HOMEPATH%\mount.bat > auto_mount.bat
  2. Execute the following three commands to configure `auto_mount.bat` to run automatically after a user logs on, and set read and execute permissions for others.

    MOVE auto_mount.bat "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
    icacls "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\auto_mount.bat" /grant everyone:rx
    REG ADD HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run /f /v MyMount /t REG_SZ /d "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\auto_mount.bat"
  3. Execute the following command to configure the `mount.bat` script.

    Mount without identity verification

    For cases that do not require identity verification, use the following command:

    echo net use z: \\gateway_ip\share_name > "%HOMEPATH%\mount.bat"

    Replace the drive letter z, gateway IP gateway_ip, and share name share_name with actual values.

    Mount with identity verification

    • To mount an SMB protocol share using an SMB user, execute the following command to configure the script.

      echo net use z: \\gateway_ip\share_name /user:username password > "%HOMEPATH%\mount.bat"

      Replace the drive letter z, the gateway IP gateway_ip, the share name share_name, the SMB username username, and the SMB user password password with their actual values.

    • To mount an SMB protocol share using a domain user identity other than the Windows logon user identity, execute the following command to configure the script.

      echo net use z: \\gateway_ip\share_name /user:username@domain password > "%HOMEPATH%\mount.bat"

      Replace the drive letter z, gateway IP gateway_ip, share name share_name, domain username username@domain, and domain user password password with actual values.

  4. Restart the ECS server.

    After the user logs on again, execute the net use command to verify the mount result.

    Important

    Restarting the Elastic Compute Service (ECS) instance interrupts services. Restart the ECS instance during off-peak hours.

If you encounter other issues when you mount a share, see Troubleshoot mount failures.

Uninstall a share

Important

Before you perform the uninstall operation, check the upload status of the share. We recommend that you perform the operation when the share is in the Upload Complete state to prevent data loss. For more information, see Why does the sync status of the share always show 'Upload incomplete'?.

  1. In the command line interface, enter the following command:

    net use Z: /del

    Note

    Here, Z is the drive letter. Replace it with the actual value.

  2. In the command line interface, enter net use to verify if the share uninstalled successfully.

More operations