First of all, what is Samba error 255? Well, it is the error that we get when in Ubuntu (for example), we try to share a folder and we cannot because it tells us:
The "network share" returned error 255: net usershare: cannot open usershare directory / var / lib / samba / usershares. Error Permission Denied You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share.
This happened to me when I tried to create a shared folder on one of my users' PCs, so that I could comfortably exchange files with a Windows XP virtual machine running on Virtualbox.
In the case of Ubuntu the solution is simple, because I solved everything by executing in the terminal:
sudo chmod 777 /var/lib/samba/usershares
But this may not be the solution for others. For example, in the case of Debian it can be easily solved also by adding our user to the sambashare group.
# addgroup usuario sambashare
But let's say we want something more. In this case we do not want it to ask us for a username and password to access the shared folder. Well, for this, what we do is create a folder in / media:
# mkdir /media/compartir
# chmod -R 777
And then we add to the end of the file /etc/samba/smb.conf:
[documents] comment = Shared documents path = / media / share public = yes writable = yes
And well, in some cases we have to restart Samba:
# /etc/init.d/samba restart
Now, from the virtual machine I just have to put in Windows Explorer: