Thunar Shares Plugin 'net usershare' error 255

I use the Thunar Shares Plugin because it makes creating samba shares so much quicker and easier.

I tried to create a share and when pressing apply a box pops up saying “net usershare error 255”. I googled the error and it talks about permission errors and to add my user ot sambashares. My user is in that group and has been for 3 years :stuck_out_tongue:

Anyway, I thought I would try on a vm of manjaro xfce I had installed for testing. The same error comes up.
I also had manjaro KDE installed on a VM so i tested. It worked!!

Next I download a fresh copy of xfce and installed in a vm and tried again. It still didn’t work. So I don’t think its a setting I got wrong over the years.

Oh I should note that i installed manjaro-settings-samba first from the package manager.

Any advice? I don’t want to create a share from terminal as that takes much longer, and my skills are still limited when it comes to that.

Or if I have to go the terminal way can some one explain as simple as possible here?

Thanks in advanced.

Same problem here. Samba ArchWiki no help.

I had to create a share by creating it in smb.conf file.

I had this issue. I do not know if yours is the same.

Ownership of the file is probably root in /var/lib/samba/usershare/

You, the user, needs to have ownership of the file:

sudo chown user name:username name of file

Then restart samba service
systemctl restart smb.service

Now in Thunar, Right Click on the folder in question and Thunar Shares Plugin should show folder in question as Shared.

Also be sure that your user is a member of the group, sambashare.

I don’t have any file in usershare folder. The folder is root however. What do you have in the folder?

I have the folder owned as root with text files owned by me with contents like this:

#VERSION 2
path=/home/jrichard/Downloads
comment=
usershare_acl=S-1-1-0:F
guest_ok=y
sharename=Downloads

The only differences in those files is the name of the file itself, so the Documents shared folder would be different in path and shared name sections of the text file. At one point I had used the deprecated system-config-samba and/or Nautilus-Share/Nautilus which both are not on my system anymore. I don’t know if that had anything to do with it. I had that same error you have for just my Downloads folder , so I copied the Documents file inside the folder, made some changes, changed owner and it worked.

Samba along with the now unnecessary, stunnel, are the most infuriating for me on Linux to configure.

Yea samba should be easier. Manjaro has it already set up and a manjaro-settings-samba package that just creates the smb.conf for us. But helpful. We are also in the correct groubs by default. My issue is with some DE file managers creating samba share isn’t built in. I think that should be mandatory.

It can put new users off too. Since they will probably need samba because they might have other windows systems they would want to connect to or alow access to.

This is not a manjaro issue tho, so they can’t do anything. It’s a thunar issue.

I’ll keep my setting in smb.conf for now as its working fine. But I’ll keep your advice in mind for the future.

Thanks

I’ve invested a lot of time. The problem exists in Manjaro since an update in October 2021. Apparently this has to do with net usershare parameters -l and --long.
Read here: Samba Nautilus-Share funktioniert nicht mehr

This bug exists with all Samba Share plugins. In Manjaro XFCE (Thunar), Gnome (Nautilus) Cinnamon (Nemo). But it works in Manjaro KDE Plasma and Linux Mint 20.3 (Beta Version) Cinnamon (Nemo) without problems.

Until the Manjaro file manager plugin is patched at some point, I have the following simple solution:

Goal: create folder samba and allow access for everyone in the network via the file manager.

1. Open the terminal
2. mkdir ~/samba
3. net usershare add --long samba ~/samba "comment" "Everyone:F" guest_ok=y

The following is displayed in the terminal:
[samba]
path=/home/hello/samba
comment=comment
usershare_acl=Everyone:F,
guest_ok=y

The “samba” folder is now visible in the SMB network and can be accessed by everyone.

2 Likes

Yes I thought it was after a manjaro update. Right now I’m just doing it by editing smb.conf file and adding the share manually.

How do we let manjaro know then if it is a manjaro issue that it needs looking in too. I mean it took ages for this thread to be seen already.

thunar-shares-plugin does not work since quite some time. I am a bit surprised that actually, there seems to be only low interest in that topic. See Thunar Shares Plugin 'net usershare' error 255 - #8 by ondara for a reference.

Currently, thunar-shares-plugin seems to be broken.
It starts with the fact that there are at least three different thunar-shares-plugin packages available when you search in pamac.

The first, thunar-shares-plugin-manjaro, does not seem to work at all. You simply do not get the Share tab when clicking a folder’s properties. Even tried a reboot, to no avail.

The second, thunar-shares-plugin (without the -manjaro suffix) just spits out the following errors:

Calling "net usershare" created error 255: [2022/01/22 17:25:39,0] ../../lib/util/debug.c:1100(reopen_one_log)
reopen_one_log: Unable to open new log file 'shared/log.net': No such file or directory
net usershare add: share name /home/gerd/shared contains invalid characters (any of %<>*?|/\+-=;:,)

Of course, creating an empty file shared/log.net does not help. And there are also no illegal chars in the path to the folder to be shared.

Finally, I tried thunar-shares-plugin-gtk but it shows the same net usershare add error as thunar-shares-plugin.
According to Thunar Shares Plugin 'net usershare' error 255 - #8 by ondara, this has been introduced by a recent Manjaro update.

UPDATE: The solution is provided by @megavolt here: Samba Nautilus-Share funktioniert nicht mehr - #20 by megavolt

What do you have to do?

  1. Download the following PKGBUILD in an empty folder:
# Maintainer : Rob McCathie <korrode at gmail>
# Contributor: SpepS <dreamspepser at yahoo dot it>
# Contributor: vinz <vinz@archlinux.us>
# Contributor: Aurélien DESBRIÈRES <ice.cube@gmx.com>
# Contributor: Alexandru Ianu <alexandru.ianu at gmail>

_name=thunar-shares-plugin
pkgname=$_name
pkgver=0.3.1
_gitcommit=9f9d2429217838b3b8375e41ab3675412cf1d0ed
pkgrel=1
pkgdesc="Thunar plugin to quickly share a folder using Samba without requiring root access"
arch=('i686' 'x86_64')
url="http://goodies.xfce.org/projects/thunar-plugins/${_name}"
license=('GPL2' 'LGPL')
depends=('thunar>=1.7.0' 'samba' 'manjaro-settings-samba')
makedepends=('xfce4-dev-tools')
provides=("${_name}=${pkgver}")
replaces=("$_name-manjaro")
conflicts=("${_name}" "$_name-manjaro" "$_name-gtk")
#source=("http://git.xfce.org/thunar-plugins/${_name}/snapshot/${_name}-${_gitcommit}.tar.bz2")
source=("https://gitlab.xfce.org/thunar-plugins/thunar-shares-plugin/-/archive/master/${_name}-master.tar.bz2"
        "shares.patch")
sha256sums=('bdb4c5e3c4125522d5893caacf17d599e4bf259b947ee46961825f4e2e80810a'
            '88ffc824dd38bb61d3e0db0a0df44bc1afcae3a2b27557570c0e984917c2d575')

build() {
  #cd "${srcdir}/${_name}-${_gitcommit}"
  cd "${srcdir}/${_name}-master"
  patch -p1 -i "$srcdir"/shares.patch
  ./autogen.sh --prefix=/usr --enable-debug=no
  make
}

package() {
  #cd "${srcdir}/${_name}-${_gitcommit}"
  cd "${srcdir}/${_name}-master"
  make DESTDIR="${pkgdir}" install
}
  1. Download the following patch in the same folder and name it shares.patch:
--- a/libshares/shares.c	2022-01-22 18:59:51.925421512 +0100
+++ b/libshares/shares.c	2022-01-22 19:00:16.665155816 +0100
@@ -711,7 +711,7 @@
 		return FALSE;
 
 	argv[0] = "add";
-	argv[1] = "-l";
+	argv[1] = "--long";
 	argv[2] = info->share_name;
 	argv[3] = info->path;
 	argv[4] = info->comment;
  1. Run makepkg --syncdeps, let it install the dependencies and have a look if it is able to create the package.
  2. Install the newly made package with sudo pacman -U thunar-shares-plugin-0.3.1-1-x86_64.pkg.tar.zst and replace all other versions of thunar-shares-pluigin.
  3. Important: Log out and back in to your X session, or reboot.
  4. Finished: thunar-shares-plugin works again!
3 Likes

Thanks for this detailed content. I was over on the page in German but couldn’t follow what he was explaining. 1,2,3. Made it a whole lot clearer. Now going back I get it. I have more than one Manjaro distro on my test machine. I recently installed the latest Gnome. When I got to the Samba install and config noticed the netshare error. I have another Gnome installed Sept 2020. That one had a shared directory that was ok. Up until I deleted it and tried to configure it again. So the update late last year must have caused a conflict for most of the file managers share plugins.

Thanks a lot for this info.

What gets me is that something I would call important for a distribution is broken and not even bothered to be looked at. Especially when the fix is basically a package update.

It’s really a shame.

It was definitely an update that did this.

The bug has been posted. The (patch) workaround works. Let’s see if it gets any traction over at xfce. I have known them to be pretty responsive when I had issue with thunar.

I’ll register tomorrow and second that post so they know its not just you with the issue.

You can thank @DAC324 for posting the bug with xfce and of course, @megavolt for the patch.

Updated the bug at xfce with the knowledge we recently gathered.

Filed Please update this package, it is outdated and broken (#1) · Issues · Packages / Community / xfce / thunar-shares-plugin · GitLab for the Manjaro thunar-shares-plugin package as well. Hopefully, it is still maintained.

oberon closed via commit [e5d7b1c6]

Thanks!

Oh, just noticed an update for the package.

Thanks to everyone. @DAC324 and @megavolt for getting this noticed to the right people.