How to Mount Windows 11 Shares on Ubuntu Linux
Mounting a Windows share allows you to access files stored on a Windows computer directly from your Ubuntu desktop. This is useful for moving files between systems or working on shared projects. When you are done, you can easily access, edit, and save files on the remote Windows machine as if they were stored on your local hard drive.
Enable Network Discovery in Windows 11
Shares must be visible for other devices to connect. In Windows, Network Discovery must be turned on to advertise your folders.
To get to System Settings, use the Windows key + I shortcut or click Start ==> Settings.

In Windows Settings, click Network & Internet, then select Ethernet.

Under Network profile type, choose Private. This allows devices on your network to see your computer.

Turn on Public Folder Sharing in Windows 11
Click Start and type Control Panel.

Select Network and Internet.

Select Network and Sharing Center.

Select Change advanced sharing settings.

Under Private, select Turn on file and printer sharing.

Note: You may need administrator privileges to change these settings. You can also run these commands in an administrator Command Prompt:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
How to mount Windows shares on Ubuntu Linux
First, install the cifs-utils package. This provides the tools needed to use the CIFS protocol.
sudo apt update sudo apt install cifs-utils
Create a folder to act as your mount point:
sudo mkdir /mnt/Windows_Share
Mount the share using the mount command:
sudo mount -t cifs -o username=<Windows_UserName> //WindowsPC_IP/<ShareName> /mnt/Windows_ShareExplanation of terms:
- -t cifs: Tells Ubuntu to use the CIFS/SMB protocol.
- username: Your Windows login name.
- //192.168.1.5/ShareName: The network path to your Windows folder.
- /mnt/Windows_Share: The folder on Ubuntu where files will appear.
Advanced Mount Options and Security
For better security, do not type your password in the terminal. Create a hidden credentials file instead.
nano /home/user/.smbcredentials
Add these lines to the file:
username=generic_user password=your_password domain=WORKGROUP
Protect the file so only you can read it:
sudo chown root: /etc/credentials sudo chmod 600 /etc/credentials
Use this command to mount using the file:
sudo mount -t cifs -o credentials=/etc/credentials //WindowsPC_IP/<ShareName> /mnt/Windows_ShareHow to auto-mount with /etc/fstab
To mount the share automatically when you turn on your computer, add an entry to the /etc/fstab file. This requires administrator privileges.
sudo nano /etc/fstab
Add this line to the bottom of the file:
//WindowsPC_IP/ShareName /mnt/Widows_Share cifs credentials=/etc/credentials,file_mode=0755,dir_mode=0755 0 0
The _netdev option ensures the system waits for the network to be active before trying to mount the share.
Summary Table
| Method | Persistence | Best For |
|---|---|---|
| Manual Mount | Temporary | Quick, one-time file access |
| /etc/fstab | Permanent | Automatic access at startup |
Summary
Mounting Windows shares on Ubuntu allows for easy file sharing. By enabling Network Discovery on Windows and using the cifs-utils package on Ubuntu, you can connect systems securely. Use the /etc/fstab file for permanent access, and always use a credentials file to keep your passwords safe.
Why am I getting a ‘Permission Denied’ error when mounting?
Permission denied usually happens if the Windows username or password is incorrect, or if the Windows folder does not have sharing permissions enabled for your user account. Double-check your credentials and ensure the user has ‘Read/Write’ access in the Windows folder properties under the ‘Sharing’ tab.
How do I mount a Windows share that requires a specific SMB version?
If the connection fails, you may need to specify the SMB version. Add the ‘vers’ option to your mount command or fstab entry. For example, add ‘vers=3.0’ or ‘vers=2.0’ to the options list. This forces Ubuntu to use a specific version of the protocol compatible with your Windows settings.
Was this guide helpful?
Leave a Reply