2 min read

Sharing Ubuntu Folders on Network

I’m trying to share my Ubuntu folders on the local network so I can access the files from my Google TV.

To accomplish this, you need to run the following commands:

apt install samba nautilus-share
 
usermod -aG sambashare <username>

You may need to restart your machine for the changes to take effect.

Next, from my file explorer, I simply select the folder I want to share, right-click on it, and choose “Local Network Share” from the menu:

The “Folder Sharing” window will open; then just check the “Share this folder” checkbox. The other options are optional.

Ubuntu Folder Sharing

If you encounter an error like this:

'net usershare' returned error 255: [2024/05/10 21:21:53,  0] ../../lib/util/debug.c:1100(reopen_one_log)
  reopen_one_log: Unable to open new log file '<folder>/log.net': No such file or directory
net usershare add: share name <folder> contains invalid characters (any of %<>*?|/\+=;:",)

Then, you need to share the folder manually from the command line. It’s a bug from nautilus-share itself, as shownhere.

The solution is to run this command:

net usershare add --long share <full_path> "comment" "Everyone:R" guest_ok=n
 
# Change "R" to "F" for read and write access
# Change "n" to "y" for guest access

Now you can access the folder from other devices via its IP address:

\\<local-ip>\<folder-name>

For testing, you can download the X-Plorer app for Android and Google TV to access your shared folder. It has built in media player too 👍.