Skip to content
Follow
Windows

How to Enable File Sharing Between Ubuntu and Windows 11

Richard
Written by
Richard
Jul 17, 2021 Updated Oct 7, 2026 7 min read
How to Enable File Sharing Between Ubuntu and Windows 11
How to Enable File Sharing Between Ubuntu and Windows 11

File sharing between Ubuntu and Windows 11 lets you move files back and forth over your home network in about 10 minutes, with no USB drives. The connection relies on Samba, a free tool that lets Linux computers share files using SMB, the same network protocol Windows uses.

Advertisement

Once you finish the setup, your Windows 11 shared folders show up in the Ubuntu file manager, and your Ubuntu shared folder opens from Windows. Both computers need to be on the same network, for example the same router. This guide works on Windows 11 Home and Pro, and the steps are the same on both.

⚡ Quick Answer

Turn on Network Discovery and File and printer sharing in Control Panel Network and Sharing Center Change advanced sharing settings, under the Private profile. Then, on Ubuntu, open Files, choose Other Locations, and connect to your Windows PC’s network address with your Windows username and password. The connection works on Windows 11 Home and Pro over the same home network.

Advertisement

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.

📝Good to KnowNetwork discovery only works when Windows treats your connection as a Private network.

If your home network is set to Public, Windows hides the PC from other devices. You can check this in Settings Network & internet, by opening your Wi-Fi or Ethernet connection and looking at the network profile type. Home networks should be set to Private network.

Turn on File Sharing in 🪟 Windows 11

Turning on file sharing in Windows 11 allows your Ubuntu computer to see and connect to your Windows folders over your home network. You do this through the Control Panel by opening the Network and Sharing Center, changing the advanced sharing settings, and turning on network discovery and file and printer sharing.

📝Good to KnowThese settings only open the door.

They do not share any folder on their own. To share a folder, right-click it in File Explorer , choose Properties, open the Sharing tab and use the Share button. You need an administrator account to change the settings below, and you do not need to restart afterwards.

Advertisement
  1. Click Start, type Control Panel and open the result. The Control Panel window appears.

    Windows 11 Control Panel for settings adjustment
    windows 11 control panel

  2. Click Network and Internet. If Control Panel is in Large icons or Small icons view, you will not see this category. In that case, go straight to the Network and Sharing Center icon instead.

    Network and Internet settings in Windows 11 Control Panel
    windows 11 control panel network and internet

  3. Select Network and Sharing Center. This page shows your active network and its type.

    Network and Sharing Center in Windows 11
    windows 11 network and sharing center

  4. Click Change advanced sharing settings in the left pane. A page with a list of network profiles opens.

    Advanced sharing settings in Windows 11
    windows 11 change advanced sharing settings

  5. Expand the Private section. Turn on Network discovery, then turn on File and printer sharing.

    Windows 11 Advanced Sharing Center configuration
    windows 11 advanced sharing center 1

  6. Scroll down to All networks and ensure these settings are active so you can access your folders. Leave Password protected sharing turned on. This is why Ubuntu will later ask for your Windows username and password. When you are done, click Save changes at the bottom of the page.

    Turning off password protected sharing in Windows
    windows turn off password protected sharing

You can quickly enable file sharing settings for Windows 11 by running specific commands as an administrator in the Command Prompt. This method is particularly useful for users who prefer command-line operations over graphical interfaces.

To open an elevated prompt, click Start, type cmd, right-click Command Prompt and choose Run as administrator. Click Yes if User Account Control asks. If the window title does not say Administrator, the commands will fail with an access error. Run the command shown below, and you can check the result in the Control Panel settings from the previous method.

💻Code
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

Accessing Windows shares from Ubuntu takes just a few clicks inside the built-in File Manager. You connect directly to your Windows computer by opening Other Locations, typing your Windows machine's network address, and entering your Windows login details to browse the shared folders.

Before you start, make sure the Windows PC is awake and that you have shared at least one folder on it. These steps use the default Ubuntu desktop and its Files app.

Advertisement
  1. Open your File Manager. The Files window opens with a sidebar on the left.
  2. Click Other Locations in the left sidebar. Any computers Ubuntu can detect on the network appear in the main pane.

    File sharing setup between Ubuntu and Windows 11
    ubuntu and windows 11 file sharing

  3. If you do not see your Windows computer, you may need to install the sharing tool by opening your terminal and running:
🐧Bash / Shell
sudo apt update
sudo apt install samba

After the install finishes, close and reopen the File Manager, then check Other Locations again. Even then, the Windows PC may not be listed, because Ubuntu does not always detect Windows computers automatically. If that happens, connect by typing the address yourself. In the Connect to Server box at the bottom, type the address of your Windows computer like this:

💻Code
smb://servername/Share_name

Or if you have a specific folder to open:

💻Code
smb://10.0.2.18/users/Richard/Documents
Accessing Windows 11 shares from Ubuntu
windows 11 shares access from ubuntu

When prompted, enter your Windows username and password to gain access. Choose Registered User if the dialog offers it. If you sign in to Windows with a Microsoft account, use that account's email address and its password. A Windows Hello PIN will not work here. If the connection is refused, double-check the address and confirm that both computers are on the same network.

Ubuntu accessing shared folders from Windows
ubuntu access windows shared folders
Ubuntu connecting to Windows 11 shared resources
ubuntu access windows 11 shares

How to access Ubuntu files from Windows

Accessing Ubuntu files from Windows requires Samba (a tool that lets different operating systems share files over a network). You install Samba, create a shared folder on your Ubuntu system, and change the folder permissions so your Windows computer has permission to open it.

Advertisement

You need an account that can use sudo. If Samba is not installed on Ubuntu yet, install the samba package with the apt package manager first. The steps below then run in the terminal and in a text editor. Work through them in order, because later steps depend on the folder and account you set up earlier.

  1. Open the terminal and create a folder:
🐧Bash / Shell
sudo mkdir /samba
  1. Set the permissions so others can use it:
🐧Bash / Shell
sudo chgrp sambashare /samba
sudo chmod 2770 /samba
  1. Add your user account to the sharing list (replace yourusername with your actual Ubuntu name):
🐧Bash / Shell
sudo smbpasswd -a yourusername
  1. Set a password for your Samba share. This password is separate from your Ubuntu login password, although you can make them the same. You will type it on Windows when it asks for credentials. Nothing appears on screen as you type it, which is normal.
🐧Bash / Shell
sudo smbpasswd -a yourusername
sudo smbpasswd -e yourusername
  1. Add your account to the share group:
🐧Bash / Shell
sudo usermod -a -G sambashare yourusername
  1. Open the configuration file. It opens in a text editor in the terminal, and you need sudo rights to save changes to it.
🐧Bash / Shell
sudo nano /etc/samba/smb.conf
  1. Add these lines to the bottom of the file and save it. Keep the spacing and layout exactly as shown, and do not remove any existing lines. A typing mistake in this file can stop Samba from starting.
💻Code
    path = /samba
    browseable = yes
    read only = no
    force create mode = 0660
    force directory mode = 2770
    valid users = @sambashare

  1. Restart the service to apply changes. If it reports an error, reopen the configuration file and check the lines you added for typos.
🐧Bash / Shell
sudo systemctl restart smbd
sudo systemctl restart nmbd

To open the share from Windows, click the File Explorer address bar, type two backslashes followed by the IP address of your Ubuntu computer, and press Enter. When Windows asks for credentials, use your Ubuntu username and the Samba password from step 4. If Windows still cannot reach the share, check whether the Ubuntu firewall is blocking Samba traffic.

Summary

In short, connecting Ubuntu and Windows 11 for file sharing relies on the SMB protocol. Windows must be visible on a Private network with network discovery and file sharing turned on, and Ubuntu needs Samba to share its own folders. If either side cannot see the other, check those settings first.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Enable File and Printer Sharing in Windows 11
Windows How to Enable File and Printer Sharing in Windows 11
How to Turn On or off Public Folder Sharing in Windows 11
Windows How to Turn On or off Public Folder Sharing in Windows 11
Windows 11 Control Panel Shortcuts Guide
Windows Windows 11 Control Panel Shortcuts Guide
How to Share Your Files with OneDrive in Windows 11
Windows How to Share Your Files with OneDrive in Windows 11

2 Comments

  • Thank you very much.
    I have tried many tutorials to connect to Windows network share and by far this was the easiest.

    Reply
  • 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.

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *