How to Enable File Sharing Between Ubuntu and Windows 11
This guide helps you connect your Ubuntu computer to shared folders on a Windows 11 PC. By doing this, you can easily move files back and forth between the two systems.
Why do this?
Sharing files between different operating systems makes working on projects much faster. You won’t need a USB drive to move files between your computers anymore.
What happens when done?
Once you finish these steps, your Windows folders will show up in your Ubuntu file manager, and your Ubuntu folders will be visible to your Windows PC.
Enable Network Discovery in Windows 11
Windows needs to “announce” that it has files to share. If this is turned off, other computers cannot find it. First, turn on Network Discovery in Windows 11. Read more about this here: How to enable Network Discovery on Windows 11.
Turn on File Sharing in Windows 11
You must allow Windows to share files on your private network.
- Click Start and type Control Panel.

- Click Network and Internet.

- Select Network and Sharing Center.

- Click Change advanced sharing settings.

- Under the Private section, turn on File and printer sharing.

- Scroll down to All networks and ensure these settings are active so you can access your folders.

Note: You can also run these commands as an administrator in the Command Prompt to enable these settings quickly:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
Access Windows Shares from Ubuntu
Now that Windows is ready, let’s connect from Ubuntu.
- Open your File Manager.
- Click Other Locations in the left sidebar.

- If you do not see your Windows computer, you may need to install the sharing tool by opening your terminal and running:
sudo apt update sudo apt install samba
In the Connect to Server box at the bottom, type the address of your Windows computer like this:
smb://servername/Share_name
Or if you have a specific folder to open:
smb://10.0.2.18/users/Richard/Documents

When prompted, enter your Windows username and password to gain access.


How to access Ubuntu files from Windows
To share a folder from Ubuntu, you need to set up a tool called Samba.
- Open the terminal and create a folder:
sudo mkdir /samba
- Set the permissions so others can use it:
sudo chgrp sambashare /samba sudo chmod 2770 /samba
- Add your user account to the sharing list (replace yourusername with your actual Ubuntu name):
sudo smbpasswd -a yourusername
- Set a password for your Samba share:
sudo smbpasswd -a yourusername sudo smbpasswd -e yourusername
- Add your account to the share group:
sudo usermod -a -G sambashare yourusername
- Open the configuration file:
sudo nano /etc/samba/smb.conf
- Add these lines to the bottom of the file and save it:
path = /samba
browseable = yes
read only = no
force create mode = 0660
force directory mode = 2770
valid users = @sambashare
- Restart the service to apply changes:
sudo systemctl restart smbd sudo systemctl restart nmbd
Summary
- Connectivity: Ubuntu and Windows 11 use the SMB protocol to talk to each other.
- Visibility: You must enable Network Discovery in Windows so other devices can find it.
- Permissions: You need to set up specific share permissions and passwords to keep your files secure.
- Tools: Samba is the essential software used to bridge the gap between Ubuntu and Windows file systems.
[share]
How do I access Windows 11 shared folders from Ubuntu?
Why can't my Ubuntu computer see my Windows 11 shared files?
Is it safe to enable file sharing between Windows 11 and Ubuntu?
How do I enable Network Discovery on Windows 11 for file sharing?
Can I use command line tools to enable file sharing on Windows 11?
Was this guide helpful?
Thank you very much.
I have tried many tutorials to connect to Windows network share and by far this was the easiest.
Command prompt as administrator. Get this.
C:\Windows\System32>netsh advfirewall firewall set rule group=”File and Printer Sharing” new enable=Yesnetsh advfirewall firewall set rule group=”Network Discovery” new enable=Yes
‘group’ is not a valid argument for this command.