← Back to list

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

Hari · 2025-05-19 10:47 · 140 claps · 1.7 min read paywalled
#linux #ubuntu #windows #redhat-linux #mount
Open on Medium ↗
Wiki topics: BIZ · Business Strategy 🔓 · Open Source

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

Debian/Ubuntu:

sudo apt update && sudo apt install samba -y

RHEL/CentOS:

sudo yum install samba -y
  1. Create a system user (if needed)
sudo adduser shareuser
sudo smbpasswd -a shareuser
  1. 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
  1. Set permissions
sudo chown -R shareuser:shareuser
/test/sharefolder
  1. Restart Samba
sudo systemctl restart smbd
sudo systemctl enable smbd
  1. 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)

  1. Install CIFS utils
sudo apt install cifs-utils -y # Ubuntu/Debian
sudo yum install cifs-utils -y # RHEL/CentOS
  1. Create mount point

sudo mkdir -p /mnt/sap_gl
  1. Mount the share
sudo mount -t cifs //192.168.1.1/SAP_GL /mnt/sap_gl -o username=shareuser,password=YourPassword
  1. 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)

  1. Install NFS server

Ubuntu/Debian:

sudo apt install nfs-kernel-server -y

RHEL/CentOS:

sudo yum install nfs-utils -y
  1. 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.

  1. Export the directory
sudo exportfs -a
  1. 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
  1. 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

  1. Install NFS client

Ubuntu/Debian:

ysudo apt install nfs-common -y

RHEL/CentOS:

sudo yum install nfs-utils -y
  1. Create mount point
sudo mkdir -p /mnt/sap_gl
  1. Mount the NFS share
sudo mount 192.168.1.1:/test/sharefolder /mnt/sap_gl
  1. 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