# SMB Drive Sharing Setup (VM `192.168.0.178`) This config shares the VM drives to the internal network using Samba. ## 1) Drive mount points and persistent mounts Mounted drives: - `sda2` -> `/mnt/drive-a` (UUID `68F46144F461159A`) - `sdb1` -> `/mnt/drive-b` (UUID `EE80C48480C454AD`) - `sdc2` -> `/mnt/drive-c` (UUID `D68E4A0E8E49E817`) Create mount points: ```bash sudo mkdir -p /mnt/drive-a /mnt/drive-b /mnt/drive-c ``` Add to `/etc/fstab`: ```fstab UUID=68F46144F461159A /mnt/drive-a ntfs-3g defaults,uid=1000,gid=1000,dmask=002,fmask=113 0 0 UUID=EE80C48480C454AD /mnt/drive-b ntfs-3g defaults,uid=1000,gid=1000,dmask=002,fmask=113 0 0 UUID=D68E4A0E8E49E817 /mnt/drive-c ntfs-3g defaults,uid=1000,gid=1000,dmask=002,fmask=113 0 0 ``` Apply and verify: ```bash sudo mount -a df -h /mnt/drive-a /mnt/drive-b /mnt/drive-c ``` ## 2) Install and configure Samba Install: ```bash sudo apt update sudo apt install -y samba smbclient ``` Append to `/etc/samba/smb.conf`: ```ini [DriveA] path = /mnt/drive-a browseable = yes read only = no guest ok = no valid users = sze create mask = 0664 directory mask = 0775 [DriveB] path = /mnt/drive-b browseable = yes read only = no guest ok = no valid users = sze create mask = 0664 directory mask = 0775 [DriveC] path = /mnt/drive-c browseable = yes read only = no guest ok = no valid users = sze create mask = 0664 directory mask = 0775 ``` Set SMB password and start service: ```bash sudo smbpasswd -a sze sudo systemctl enable --now smbd sudo systemctl restart smbd ``` Verify: ```bash systemctl is-active smbd smbclient -L //127.0.0.1 -U sze ``` ## 3) Access from clients ### macOS Open the share in Finder: 1. Open Finder 2. Click `Go` -> `Connect to Server...` 3. Enter `smb://192.168.0.178/DriveA` 4. Click `Connect` 5. Sign in with: - Username: `sze` - Password: the password set with `sudo smbpasswd -a sze` You can also open it directly from Terminal: ```bash open "smb://192.168.0.178/DriveA" ``` Other shares: - `smb://192.168.0.178/DriveB` - `smb://192.168.0.178/DriveC` ### Windows In File Explorer, enter: - `\\192.168.0.178\DriveA` - `\\192.168.0.178\DriveB` - `\\192.168.0.178\DriveC` Then sign in with the same SMB username and password. Credentials: - Username: `sze` - Password: set via `sudo smbpasswd -a sze` ## Troubleshooting - Shares not visible: `sudo systemctl status smbd` - Mount issue at boot: `sudo mount -a` - NTFS permission mismatch: check `uid=1000,gid=1000` in `/etc/fstab`