How to Mount Windows 11 Shares on Ubuntu Linux
Mounting Windows 11 shares on Ubuntu Linux lets you access files stored on a Windows computer directly from your Ubuntu desktop.
This process connects your Windows file system to Ubuntu, making it simple to share files between the two operating systems. You can essentially make a folder from your Windows 11 PC appear as if it’s a local drive on your Ubuntu machine.
To get started, you’ll need to install the `cifs-utils` package, which is part of the Samba client. You can do this by running the command `sudo apt update && sudo apt install cifs-utils` in your Ubuntu terminal.
Install `cifs-utils` on Ubuntu, create a mount point folder, and use the `mount` command with your Windows IP, share name, and credentials. For permanent mounting, add an entry to your `/etc/fstab` file.
Enable Network Discovery in 🪟 Windows 11
Turn on Network Discovery in Windows 11 so your Ubuntu computer can see your PC for file sharing. Go to Settings (Windows key + I), then click Network & Internet, and choose Ethernet (or Wi-Fi if you are on wireless). Under Network profile type, set it to Private. This helps your Ubuntu machine discover your Windows PC on the network.
To get to System Settings, use the Windows key + I shortcut or click Start ==> Settings.

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

For the Network profile type, choose `Private`. This setting lets other computers on your local network discover your Ubuntu Linux machine. This setting is crucial for accessing shared files, as it signals your computer is on a trusted network.
Latest Update
This setting lets other computers on your local network discover your Windows PC. This is crucial for accessing shared files, as it signals your computer is on a trusted network.

Turn on Public Folder Sharing in 🪟 Windows 11
To share files from your Windows 11 PC to Ubuntu, you must turn on file and printer sharing. Go to Network and Sharing Center, then select Change advanced sharing settings. Under the Private network settings, choose to turn on file and printer sharing.

Select Network and Internet.

Select Network and Sharing Center.

Select Change advanced sharing settings.

Under Private, select Turn on file and printer sharing.

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
Mounting Windows shares on Ubuntu Linux is possible after installing the cifs-utils tool. First, update your package list with 'sudo apt update' and install the tool using 'sudo apt install cifs-utils'. Then, create a folder like '/mnt/Windows_Share' to be your mount point before using the mount command.
Before you mount, ensure your Windows PC is set up to share folders. You also need to know the IP address of your Windows PC and the name of the shared folder.
Mounting Methods
- Manual Mount: Use the
mountcommand for temporary access. It's quick for one-time use but won't survive a reboot. - Automatic Mount (
fstab): Edit the/etc/fstabfile for persistent mounting. The share will be available every time you start Ubuntu.
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_ShareLet's break down what those terms mean:
- -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
To securely mount Windows shares on Ubuntu, use a credentials file instead of typing your password repeatedly. Create the credentials file using the command `nano /home/user/.smbcredentials` and then add your username, password, and domain to this file. Secure the credentials file by changing its owner and permissions so that only you can read it.
.smbcredentials file are set correctly. If the file is too open, your password could be exposed. Use chmod 600 /home/user/.smbcredentials to ensure only you can read it.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 have your Windows share automatically mount every time Ubuntu starts, add a line to your '/etc/fstab' file. Open the file with 'sudo nano /etc/fstab' and add the specific line provided, including your IP address, share name, and credentials file location. The '_netdev' option helps ensure the network is ready.
Latest Update
To have your Windows share automatically mount every time Ubuntu starts, add a line to your /etc/fstab file. Open the file with sudo nano /etc/fstab and add the specific line, including your Windows PC's IP address, the share name, and the location of your credentials file. The _netdev option is important.
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.
Latest Update
If you see a 'Permission denied' error, double-check that the username and password you are using on Ubuntu match a user account on your Windows PC that has permission to access the shared folder. Also, verify that the shared folder on Windows has 'Read' or 'Read/Write' permissions set for that specific user account in its Properties Sharing Advanced Sharing settings
How do I mount a Windows share that requires a specific SMB version?
If your Windows share connection fails on Ubuntu, you might need to specify the SMB version, like 3.0 or 2.0, in your mount command or fstab entry.
If you get a 'Host not found' error, it means your Ubuntu machine can't resolve the name or IP address of your Windows PC. Ensure your Windows PC is turned on, connected to the same network, and that your firewall settings on both Windows and Ubuntu allow network communication. Sometimes, restarting your router can also help.
SMB Versions
- SMBv1: Older and less secure. Generally not recommended.
- SMBv2: More secure and faster than SMBv1.
- SMBv3: The latest and most secure version, offering best performance.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!