Simplest file sharing for Ubuntu Desktop 24.04 for non-Linux users

johna by | October 26, 2024 | Linux

File sharing in Ubuntu Desktop 24.04

With Windows 10 coming to an end in 2025, Linux has its best opportunity yet to capture a more significant share of the desktop market.

However, Linux makes some things difficult that are so easy to do in Windows.

For example, file sharing. In Windows, you can just right-click on a folder and share it without ever having to leave the GUI (graphic user interface).

I have tried a few flavours of Linux, those particularly aimed at Windows users such as Linux Mint and Ubuntu desktop, and so far I haven't found any that make file sharing easy.

For this post, I will look at Ubuntu Desktop 24.04. It appears to have some file sharing out of the box, but I couldn't make these work.

In Settings there is Sharing options. Well just one option: Media Sharing because File Sharing is not installed by default.

On Ask Ubuntu people told me I could use Media Sharing to share a folder and access through Windows. I tried this, and although easy to set up, I could only access the shared folders through Media Player on a Windows PC. Not so useful for non-media files.

So on to File Sharing. The installed help page told me to click to install the necessary gnome-user-share package but no matter how many times I clicked there was no action and no message indicating why. Some searching later I found I could install using the terminal with sudo apt install gnome-user-share.

This got me the File Sharing option in Settings and I was able to enable file sharing of one special Public folder. But I had no success finding or accessing the folder from my Windows PC. The settings page mentions a dav://computer-name address that I was to use but I had no luck with that or any of the usual Windows conventions for accessing shared folders.

I searched the forums and asked questions hoping to find a simple equivalent to Windows file sharing but I mostly got long-winded instructions on installing Samba and configuring via the terminal, or outdated information on Local Network Share that I assume was available on earlier versions of Ubuntu.

But eventually I came across this article on using Nautilus Samba on Ubuntu 24.04. This apparently adds the nice Sharing Options option to the right-click menu of folders.

I followed the instructions to the letter – which unfortunately involve a few entries in the terminal – and saw and tried to access the newly shared folder on Windows and amazingly it appeared on the local network so I double-clicked and... "Windows cannot access"!

So close, yet so far. More searching and I found this Stack Exchange question and answer that suggested an edit to the /etc/samba/smb.conf file might fix this. Not great that I have to make this change but at least I could do it using the GUI.

Much to my amazement, it worked! I could access the shared folder finally.

I am no Linux expert (far, far from it), and I'm sure somebody out there knows easier ways to do this or another Linux distribution that does this out of the box so don't take my advice on this being the best method. But if you are here because you have become as frustrated about this as I was then give those two resources a try.


Following is a brief summary of the instructions, but see the links above for more information.

1. Open a terminal window. You can press Ctrl+Alt+T to do this or access through the menu.

2. Update the APT package database cache:
sudo apt update

3. Install Nautilus file sharing plugin:
sudo apt install nautilus-share
Press y when asked to confirm installation.

4. Add the user to the sambashare group:
sudo usermod -aG sambashare $(whoami)

5. Restart the computer either through the normal menu or from the terminal:
sudo reboot

6. Set a password for the Samba share:
sudo smbpasswd -a $(whoami)
Enter your current password and choose a password for the share.

7. You should now have Sharing Options available when right-clicking on a folder where you can control sharing and who has access.

8. To access from a windows device open a file explorer window and navigate to the Linux PC using the computer name or IP addres, eg:
\\192.168.0.99 or
\\MyLinuxPc

If you don't know the IP address you can find it by typing hostname -I into the terminal.

If you didn't chose to enable guest access then you will be prompted for your user name and the password you set in step 6.

9. If this didn't work, like it didn't for me, then you need one more step. Open a File window find your way to the folder /etc/samba/ (you can start by going to Other Locations) and open the file smb.conf in the text editor just by double-clicking.

Find the line workgroup = WORKGROUP and add a few line below it:
force user = John (replace John with your username)

Then restart Samba with:
sudo service smbd restart

You should now be able to access the shared folder.

Related Posts

Linux

Moving from Linux to Windows - little annoying issues

by johna | November 6, 2024
So far in the move from Windows to Ubuntu things are going okay, but there have been several small annoying issues.

Linux

Moving from Windows to Linux - Outlook email on Ubuntu Desktop

by johna | November 1, 2024
I have been trying to transition all of the family computers from Windows to Linux and the latest issue was with transitioning one computer running Outlook 2003.

Comments

There are no comments yet. Be the first to leave a comment!

Leave a Comment

About

...random postings about web development and programming, Internet, computers and electronics topics.

I recommend ASPnix for web hosting and Crazy Domains for domain registration.

Subscribe

Get the latest posts delivered to your inbox.