Linux Mount Shared Folders on Linux and Windows Systems
✅ OPTION 1: SMB (Samba) — Good for cross-platform 🔵 On the source VM (10.20.38.39) 1. Install Samba
Linux Mount Shared Folders on Linux and Windows Systems

✅ OPTION 1: SMB (Samba) — Good for cross-platform 🔵 On the source VM (10.20.38.39)
- Install Samba
Debian/Ubuntu:
sudo apt update && sudo apt install samba -y
RHEL/CentOS:
sudo yum install samba -y
- Create a system user (if needed)
sudo adduser shareuser
sudo smbpasswd -a shareuser
- Configure Samba share
Edit the file:
sudo nano /etc/samba/smb.conf
Add at the end:
[SAP_GL]
path = /test/sharefolder
valid users = shareuser
read only = no
browsable = yes
- Set permissions
sudo chown -R shareuser:shareuser
/test/sharefolder
- Restart Samba
sudo systemctl restart smbd
sudo systemctl enable smbd
- Allow SMB in firewall
Ubuntu:
sudo ufw allow samba
RHEL/CentOS:
sudo ufw allow samba
sudo firewall-cmd — permanent — add-service=samba
sudo firewall-cmd — reload
🔵 On the client VM (the one mounting the share)
- Install CIFS utils
sudo apt install cifs-utils -y # Ubuntu/Debian
sudo yum install cifs-utils -y # RHEL/CentOS
- Create mount point
sudo mkdir -p /mnt/sap_gl
- Mount the share
sudo mount -t cifs //192.168.1.1/SAP_GL /mnt/sap_gl -o username=shareuser,password=YourPassword
- To auto-mount on boot
Add to /etc/fstab:
//192.168.1.1/SAP_GL /mnt/sap_gl cifs username=shareuser,password=YourPassword,iocharset=utf8,vers=3.0 0 0
✅ OPTION 2: NFS — Better for Linux-to-Linux 🔵 On the source VM (10.20.38.39)
- Install NFS server
Ubuntu/Debian:
sudo apt install nfs-kernel-server -y
RHEL/CentOS:
sudo yum install nfs-utils -y
- Edit /etc/exports
sudo nano /etc/exports
Add:
/test/sharefolder 192.168.1.1/255(rw,sync,no_subtree_check)
Adjust subnet (e.g., /24) or IP if needed for tighter control.
- Export the directory
sudo exportfs -a
- Start NFS services
Ubuntu/Debian:
sudo systemctl restart nfs-kernel-server
sudo systemctl enable nfs-kernel-server
RHEL/CentOS:
sudo systemctl start nfs-server
sudo systemctl enable nfs-server
- Allow NFS in firewall
RHEL:
sudo yum install nfs-utils -ysudo firewall-cmd — permanent — add-service=nfs
sudo firewall-cmd — reload
Ubuntu (if UFW is used):
sudo ufw allow from 10.20.38.0/24 to any port nfs
🔵 On the client VM
- Install NFS client
Ubuntu/Debian:
ysudo apt install nfs-common -y
RHEL/CentOS:
sudo yum install nfs-utils -y
- Create mount point
sudo mkdir -p /mnt/sap_gl
- Mount the NFS share
sudo mount 192.168.1.1:/test/sharefolder /mnt/sap_gl
- Auto-mount on boot
Add to /etc/fstab:
192.168.1.1:/test/sharefolder /mnt/sap_gl nfs defaults 0 0
!!!Thanks for Reading!!:!)
메타데이터
- post_id
- c8e2003c2de6
- slug
- linux-mount-shared-folders-on-linux-and-windows-systems-c8e2003c2de6
- url
- https://medium.com/@haris29/linux-mount-shared-folders-on-linux-and-windows-systems-c8e2003c2de6
- canonical_url
- https://medium.com/@haris29/linux-mount-shared-folders-on-linux-and-windows-systems-c8e2003c2de6
- author_url
- https://medium.com/@haris29
- status
- ok
- fetched_at
- 2026-06-20 20:29:01