Samba-vsf-module package

Hello!
How are you?

We have a Samba AD-DC with Rocky Linux 9.x and and other machine with samba file server AD. At samba file server needs to apply recycle bin. To apply this, is necessary samba-vsf-module package for recycle bin works right.

So, my file server its works but there is no this package on repository system. I try to search some channel/blog/ about this package. There are samba repository package system to install samba and yes, was installed and working.

Somebody can help me to fix this?

Or only compiling samba to works recycle bin in correct mode is possible?

Thank you so much

Douglas

Most likely will need to be compiled, since the system-installed one doesn’t have the module you require. Unless someone has packaged it, you can use https://pkgs.org to search.

I don’t see even this module available in Debian or Ubuntu when searching for vsf in package names. But perhaps they have it compiled in by default, never used it so cannot say for 100%.

Do you really need the samba-vfs-module ? Isn’t the recycle.so file part of the samba rpm, it should be in /usr/lib64/samba/vfs directory.

Hello!

Yes, this package has on Debian and Ubuntu (samba-vsf-module)

Hello!

Yes, I need (samba requires) this package to enable recycle bin in samba.conf. I did a lab with debian 12 and up it on AD-DC as file server and recycle bin works well. But, I would like to use Rocky Linux

I will read more about recycle.so

Thank you!

It isn’t in the latest Debian samba packages (bookworm-backports and above).

First, It is not recommended to use a Samba AD DC as fileserver, for various reasons, one of the main ones being that you will need to set the permissions from a Windows machine.

Do you have ‘/usr/lib64/samba/vfs/recycle.so’ ? If you do, that is vfs_recycle.

2 Likes

Ah no wonder I couldn’t find it. You wrote vsf when it’s actually vfs.

root@rocky9:~# dnf provides */recycle.so
Last metadata expiration check: 2:13:14 ago on Sun 25 May 2025 08:04:41 AM CEST.
samba-4.20.2-2.el9_5.1.x86_64 : Server and Client software to interoperate with Windows machines
Repo        : baseos
Matched from:
Filename    : /usr/lib64/samba/vfs/recycle.so

confirms the above answer from @hortimech in that the main samba package has what you are looking for.

1 Like

hello!
No, I am not use file server on AD-DC. It is other machine (vm)

Do you have ‘/usr/lib64/samba/vfs/recycle.so’
I will check this. But, if exist on the system how can enable it?

Thank you!

Hello @iwalker
ohhh, I am sorry, i wrote wrong word (vfs, yeah, you are right)

Thanks

You just need to add (at a minimum) ‘vfs objects = recycle’ to ‘global’ in your smb.conf if you want all shares to have Samba recycle bins, or to a share if you just want it on one share. Note that if you already have a ‘vfs objects’ line, you need to add ‘recycle’ to that, or it will replace the existing one.
See ‘man vfs_recycle’ for more details.

Hello!
@hortimech

Yes, I follow various blogs to know how enable vfs on smb.conf. As you answer, I add vfs objects = recycle on [global] section and after [share] section
All tests does not work

The recycle share give it 777 permission (chmod -R 777 /share/.recycle) following more smb.conf configuration modes.

All these configs I tested in Debian and works well. I can not understand why does not works with rocky linux. The smb.conf are equal in rocky linux and debian side.

I did the question because I think has other kind to enable recycle bin in redhat family package.

Thanks

Yes, there is recycle.so in system:

[root@srvadarq ~]# dnf provides */recycle.so
Last metadata expiration check: 1:42:49 ago on Mon May 26 06:56:49 2025.
samba-4.20.2-2.el9_5.1.x86_64 : Server and Client software to interoperate with
                              : Windows machines
Repo        : @System
Matched from:
Filename    : /usr/lib64/samba/vfs/recycle.so

samba-4.20.2-2.el9_5.1.x86_64 : Server and Client software to interoperate with
                              : Windows machines
Repo        : baseos
Matched from:
Filename    : /usr/lib64/samba/vfs/recycle.so

Okay, lets start with the easiest thing.

Please post the output of ‘testparm -s’ from the Samba machine you want the recycle bin on, also post the output of ‘sudo smbd -V’

@hortimech

testparm -s
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)

Server role: ROLE_DOMAIN_MEMBER

# Global parameters
[global]
	bind interfaces only = Yes
	dedicated keytab file = /etc/krb5.keytab
	interfaces = lo ens18
	kerberos method = secrets and keytab
	log file = /var/log/samba/%m.log
	min domain uid = 0
	realm = PRUDE.PR
	security = ADS
	template homedir = /home/%U
	template shell = /bin/bash
	username map = /etc/samba/user.map
	winbind refresh tickets = Yes
	winbind use default domain = Yes
	workgroup = PRUDE
	recycle:exclude_dir = tmp, cache
	recycle:exclude = *.tmp, *.log, *.obj, ~*.*, *.bak, *.iso
	recycle:repository = /mnt/diskrede/.recycle/%U
	recycle:subdir_mode = MODE
	recycle:directory_mode = 2770
	recycle:versions = yes
	recycle:keeptree = yes
	idmap config * : range = 3000-7999
	idmap config prude : backend = rid
	idmap config prude : range = 10000-999999
	idmap config * : backend = tdb
	map acl inherit = Yes
	vfs objects = acl_xattr recycle


[Disco-Arquivos]
	path = /mnt/diskrede/
	read only = No


[Lixeira]
	path = /mnt/diskrede/.recycle/%U
	read only = No

smbd -V

Version 4.20.2

That ‘MODE’ should be an octal number, like the line below it.

Ohhh, right. After many many tests I copied line from internet and no switch off this part

After save the smb.conf file and doing the command testparm it does not return wrong line with this line: recycle:subdir_mode = MODE but, was my fault yeah

Thanks

Hello!

Only to say that after switch off the line recycle:subdir_mode = MODE , the problem still exists

Thank you!

A couple of other thoughts, is selinux getting in the way ? Easy to test, temporarily turn of selinux and see if it works. The other thought is permissions, do your users have write permission on /mnt/diskrede/.recycle/%U ? And can they ‘walk’ that path ?

Hello @hortimech

Yes, I turn of selinux and yes, on the path mnt/diskrede/.recycle/%U the permission is 777. Yes =, I can walk in that path.

I did the same mode on Debian 12. And there the recycle bin works well.
I will switch only file server to Debian, because we need enable allright this service.

Thank you!