rknebel
On GhostBSD, avahi-daemon
is already enabled, and the system includes proper mDNS configuration out of the box, including:
However, SMB (Windows-style) network browsing still requires a few extra steps:
1. No Network Places Visible in File Manager
Even with Avahi running, Windows shares often require additional support for SMB discovery via gvfs-smb
, especially when using the Caja file manager.
To enable proper network browsing: sudo pkg install gvfs-smb
After installing, log out and back in to restart your session. This allows the file manager to recognise and use the SMB protocol plugin for browsing shared folders.
2. Samba Error: smb4.conf
Not Found
If you are trying to share a folder from your GhostBSD system (i.e., act as a Samba server), then Samba needs to be installed and configured. GhostBSD does not include it by default.
To set up Samba:
sudo pkg install samba416
sudo cp /usr/local/etc/smb4.conf.sample /usr/local/etc/smb4.conf
sudo sysrc samba_server_enable=YES
sudo service samba_server start
Then edit /usr/local/etc/smb4.conf
to define your shared directories.
3. To Mount or Access SMB Shares Manually (Without GUI):
You do not need Samba installed for this. You can directly mount shares with:
smbclient -L //<ip-address> # List shares
mount_smbfs //user@<ip>/share /mnt/target
In summary:
Below is an advanced smb4.conf
example that integrates with ZFS datasets, enables Windows-compatible ACLs, and respects extended attributes and NT-style permissions. This is useful when sharing files with Windows systems, providing better compatibility for file ownership, access control lists (ACLs), and metadata such as file timestamps or thumbnails.
/usr/local/etc/smb4.conf
— ZFS + Windows ACL + Extended Attributes
[global]
workgroup = WORKGROUP
server string = GhostBSD ZFS Samba Server
netbios name = ghostbsd
security = user
map to guest = Bad User
guest account = nobody
dns proxy = no
log file = /var/log/samba4/log.%m
max log size = 100
server role = standalone server
passdb backend = tdbsam
load printers = no
printing = bsd
disable spoolss = yes
# Performance and Compatibility
smb ports = 445
interfaces = lo0 re0
bind interfaces only = yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
# Support for extended attributes and Windows ACLs
ea support = yes
store dos attributes = yes
vfs objects = zfsacl
map acl inherit = yes
acl group control = yes
inherit acls = yes
inherit permissions = yes
dos filemode = yes
# Encoding and Time
unix charset = UTF-8
time server = yes
[public]
path = /tank/shares/public
browseable = yes
writable = yes
guest ok = yes
create mask = 0664
directory mask = 0775
force user = YOURUSERNAME
[secure]
path = /tank/shares/secure
browseable = yes
writable = yes
guest ok = no
valid users = YOURUSERNAME
create mask = 0660
directory mask = 0770
force group = smbusers
Filesystem Preparation (ZFS)
- Create ZFS datasets (if not already created):
sudo zfs create -o aclmode=passthrough -o aclinherit=passthrough -o xattr=sa tank/shares/public
sudo zfs create -o aclmode=passthrough -o aclinherit=passthrough -o xattr=sa tank/shares/secure
- Ensure your user and group exist:
sudo pw groupadd smbusers
sudo pw groupmod smbusers -m YOURUSERNAME
- Set ownership and permissions:
sudo chown -R YOURUSERNAME:smbusers /tank/shares
sudo chmod -R 770 /tank/shares/secure
sudo chmod -R 775 /tank/shares/public
- Add a Samba password for the user:
sudo smbpasswd -a YOURUSERNAME
Start or Restart Samba
sudo service samba_server restart
Notes:
vfs objects = zfsacl
enables FreeBSD’s native ZFS ACL handling in Samba, required for Windows ACL emulation.
xattr=sa
(system attributes) stores extended attributes in the inode rather than a hidden file, which is both performant and compatible with Windows Explorer.
You can inspect and manage ACLs with:
getfacl /tank/shares/public
setfacl -m user:alice:rwx /tank/shares/public