"net usershare" has returned error 255

Could someone tell me why when I try to share a directory through caja-share the log.net tells me that the resource I am trying to share contains invalid characters when the resource in its name does not have any of these symbols or characters?

net usershare add: share name /home/user/Downloads contains invalid characters (any of %<>*?|/\+=;:",)

This also happens to me when I try to share the Documents, Music and Images directory.

I have configured samba in the best way and on other computers with different distribution of Ubuntu and Debian, but it is the first time I see this message, of coursethe first message that usually appears is the following: "net usershare" has returned error 255

Thanks for your help

Same issue on one pc but not on another.
22.04 clean install on release.

Same issue here. I installed 22.04 very recently. I followed https://fostips.com/share-folder-ubuntu-21-04-fix-net-share-error-255/, but it is not working.
Each time I try to share the folder /home/m/pubblici I get the same error:

net usershare add: share name /home/m/pubblici contains invalid characters (any of %<>*?|/+=;:",)

It happens the same with other folders too, for example when I try t share /home/m/musica I get:

net usershare add: share name /home/m/musica contains invalid characters (any of %<>*?|/+=;:",)

Any suggestion, please? Thanks.

Hi @Ma_N0

I found this information in the community, of course this doesn't solve the problem completely, what it does is to share the resource of your directory under the Public name whether it is called Documents, Images, Downloads or simply any other directory. As soon as you want to change the resource you shared it is simply rename it with the command:
net usershare add Public /home/$USER/Downloads : Everyone:F guest_ok=y

The original post is from user @apinunt in his help and support topic, which I leave a link to for your review: Sharing Public folders between computers over the network - #3 by apinunt

In any case, the topic is still open for anyone who has a complete answer to this problem.

How to make Linux enthusiasts move back to windows 101

1 Like

Q:

A:

By making them use the worst filesharing protocol ever invented from the most incompatible operating system ever invented.

Really, why are you guys still using that fisher-price protocol instead of one of the many mature native standard cross platform compatible protocols supported by linux ?

On linux mint forum I wrote detailed tutorial for folder sharing for Linux Mint Cinnamon and MATE and it should apply here as well for Ubuntu-mate. Some errors are actually bugs that might not prevent you from sharing folders. You might try step by step concentrating only on case A)

https://forums.linuxmint.com/viewtopic.php?f=42&t=353391

Hi @Ma_N0 @colinux

The solution I found is the following, compile from source caja-extensions. The problem is already patched from source.

Make sure you have the following dependencies installed:

:heavy_dollar_sign: In x-terminal-emulator:

sudo apt install autoconf-archive autopoint autopoint clang clang clang-tools gcc git libcaja-extension-dev libdbus-1-dev libdbus-glib-1-dev libdconf-dev libgtk-3-dev libgupnp-1.2-dev libgupnp-1.2-dev libmate-desktop-dev libstartup-notification0-dev libxml2-utils make mate-common pkg-config libgstreamer-plugins-base1.0-dev

Clone the repository to your home directory from the terminal

:heavy_dollar_sign: In x-terminal-emulator:

git clone https://github.com/mate-desktop/caja-extensions.git

Access the location of the directory you cloned

:heavy_dollar_sign: In x-terminal-emulator:

cd caja-extensions

Enter the following command

:heavy_dollar_sign: In x-terminal-emulator:

./autogen.sh --prefix=/usr

Create and install the plugins

:heavy_dollar_sign: In x-terminal-emulator:

make && sudo make install

Restart the computer and you are done, I have tested this solution by myself.
If it worked for you let me know.

4 Likes

muchas gracias llevaba una semana rompiendome la cabeza tratado de compratir carpetas

2 Likes

Welcome @Miguel_Angel to the community!

I am running Mint 20.3 with Mate. The repository version of caja-share has not been updated to correct the net usershare error 255 issue.

Although my OS is a previous version, and Mint instead of Ubuntu, your solution worked perfectly, line-for-line as written, with no errors.

Thank you for posting this excellent solution.

3 Likes

Welcome @KenH2000 to the community!

1 Like

I just installed UM 20.04.6 (well it was a 20.04.5 iso on the usb stick but after updates it became .6) on my freshly upgraded with nvme ssd's and regular ssd's (only kept one very solid and made to last WD Red 2TB HDD in there, upgraded memory to maximum capacity, I'll have that one desktop running for a lonnnng time, I already had a graphics adapter way beyond what I needed).

Then I encountered this error when trying to do shares, I installed samba, I install caja-shares or such (I'm not on that desktop right now, but I think that's the packages's name). And I got that error, well both errors, was really dumbfounded as to why it was adding a dash "-" in front of the folders I wanted to share, of course none like that were named as such, I don't see why it would think so.

A few days ago I went ahead with your apparently working fix for that ridiculous bug (thank you very much) but when I wanted to do the first part in terminal

```
sudo apt install autoconf-archive autopoint autopoint clang clang clang-tools gcc git libcaja-extension-dev libdbus-1-dev libdbus-glib-1-dev libdconf-dev libgtk-3-dev libgupnp-1.2-dev libgupnp-1.2-dev libmate-desktop-dev libstartup-notification0-dev libxml2-utils make mate-common pkg-config libgstreamer-plugins-base1.0-dev
```

I saw that it wanted to bring in way more packages than indicated here, including the i386 database....I really, really don't want to install doubles of every packages in their 32 bit version I have installed (I could argue that it is an almost virgin install so far, only install chromium through snap and vlc so far, so it might not be too bad), I thought I was free forever from those packages now that WINE 7 and over doesn't need 32 bit packages to function, I unfortunately need it for a few applications and a few games that I wonderfully manage to emulate without an itch on older installs on the much less performant, at least outside cpu and video, instance of that desktop in the past.

Why does it want to bring in the package that install all those i386 architecture copy of the packages I already have in. That's one hell of a bug if it needs all of this (when I wanted to install your reasonable install line, as I said, it brought with it a lot, A LOT more dependencies and I want to know if I can skip any of them or are they all needed, because if I can skip the i386 architecture deb, I'll install Synaptic and install from there and uncheck it from the list when I check all those packages you say to install.

That said, I'm glad I found solutions somewhere, I thought it was restricted to UM users, but even regular plain Ubuntu users encounter this infamous "net usershare" has returned error 255 after some digging, it looks like it can affect anything based on Debian, at least from version 20.x.x and on

Hope you'll see this, I really hated having to install i386 mirror packages for WINE, which I unfortunately need, that or CrossOver, but my copy is now rather old (17). I was especially mad last time when I installed WINE 6.x and all those 32 bit packages before when a week later WINE 7 was released! (WINE 7 getting rid of that prerequisite).

Anyways, I've been yammering long enough, hope you can reassure me, it's my main hurdle right now, there's a win10 pro desktop in the house and it needs to have access to some files through LAN which will definitely be on my main desktop which has UM 20.04.6.

1 Like

Hi @whowasphone thank you for your good reviews. Regarding your question why install the i386 architecture copies I have no idea, although it would be nice as you say, just apply the dependencies with the architecture you currently have installed.

I would also like to know on your UM 20.04.06 which caja-share version you have installed.

On the other hand, these are instructions that I took from the official repository of the Mate desktop environment, I leave a link so you can detail more clearly.

You can also in this link go to the file named .build.yml, there you will find that the developer saved us a lot of time in researching each dependency, he attached the exact dependencies for some distributions, among which is Ubuntu.

I also found at the time very valuable information that helped me to solve the problem with caja-share, I leave the link if you want to investigate further. caja-share is not working on Ubuntu MATE 22.04 LTS, shows 'net usershare' returned error 255 in Folder Sharing window · Issue #111 · mate-desktop/caja-extensions · GitHub

What I did was to check if the bug was already patched from the source, I cloned the repository from the first link I left above, and placed it on my desktop

/home/user/Desktop/caja-extensions/share/shares.c

However, you can also do the same process without cloning the repo, from this link GitHub - mate-desktop/caja-extensions: Set of extensions for Caja, the MATE file manager Open the file shares.c and verify that the parameter argv[1] = "--long"; instead of argv[1] = "-l"; is there.

Here is a link for you to verify which parameter you must remove, in this file you will see that next to it there is a - sign and a + sign giving you to understand which parameter you must replace from the shares.c file.

https://launchpadlibrarian.net/601673077/108.patch

You could also choose to add a PPA, here is the link. caja-extensions fix samba share : Lena Voytek Check if in this case you end up adding dependencies for the 32-bit architecture, although I discarded this option because I wanted to compile from the caja-extensions source. I have not tried this option, but if you decide to do so you can choose to install a test machine in VirtualBox and verify.

I also clarify that UM 20.04 I do not use it for a long time and I do not know if these solutions can help you, also I would like to know what version of caja-share you currently have installed, since I applied these instructions to UM 22.04 at the time.

I hope I helped you, any other doubt you can leave it and if you solve your problem let me know.

3 Likes