Configuring Samba
Mesh Hypervisor nodes can run Samba bare-metal to share files over the network—like a folder for backups. This guide sets up Samba to share /mnt/data
on a remote node, showing how configs work in either a group or machine folder. Commands run via SSH to the central orchestration node’s CLI (e.g., ssh root@<central-ip>
). For node basics, see Configuring Nodes.
Prerequisites
Ensure:
- A remote node is online (
mesh node info
)—e.g., one with RAID at/mnt/data
(see Setting Up RAID Storage). - User
nobody
exists—Samba uses it for guest access (see Adding a User Account). - You’ve got a machine folder (e.g.,
/host0/machines/terrible-tuneup/
).
Step 1: Configure Samba
You can put Samba settings in a group (reusable) or directly in the machine folder (one-off)—both work the same. Here’s how:
Option 1: As a Group
- Make the Group: Create
/host0/groups/samba/
:mkdir /host0/groups/samba
- Add Manifest: Create
/host0/groups/samba/manifest
:A MODE=root:root:0644 SRC=/host0/groups/samba/packages TGT=/etc/apk/world L SRC=/etc/init.d/samba TGT=/etc/runlevels/default/samba O MODE=root:root:0644 SRC=/host0/groups/samba/smb.conf TGT=/etc/samba/smb.conf
- Add Packages: Create
/host0/groups/samba/packages
:samba samba-server samba-server-openrc
- Add Config: Create
/host0/groups/samba/smb.conf
:[global] workgroup = WORKGROUP server string = network file share netbios name = Mesh Hypervisor-SAMBA security = user map to guest = Bad User guest account = nobody [data] path = /mnt/data browsable = yes writable = yes guest ok = yes read only = no force user = nobody create mask = 0777 directory mask = 0777
- Link to Machine: In
/host0/machines/terrible-tuneup/groups
:baseline storage samba
Option 2: In the Machine Folder
- Add to Machine: In
/host0/machines/terrible-tuneup/manifest
:A MODE=root:root:0644 SRC=/host0/machines/terrible-tuneup/samba-packages TGT=/etc/apk/world L SRC=/etc/init.d/samba TGT=/etc/runlevels/default/samba O MODE=root:root:0644 SRC=/host0/machines/terrible-tuneup/smb.conf TGT=/etc/samba/smb.conf
- Add Files: In
/host0/machines/terrible-tuneup/
:samba-packages
:samba samba-server samba-server-openrc
smb.conf
: Same as above.
Step 2: Apply to the Node
- Set Hostname: Mesh Hypervisor generates hostnames like
terrible-tuneup
fromgenid
using noun/adjective lists—check yours inmesh node info
. - Set UUID: In
/host0/machines/terrible-tuneup/UUID
, use the node’s UUID (e.g.,10eff964
) frommesh node info
. - Apply: Update, rebuild, reboot:
mesh system download mesh system configure mesh node ctl -n 10eff964 "reboot"
Step 3: Test Samba
- SSH In: Connect to the node:
mesh node ctl -n 10eff964
- Verify Service: Check Samba’s running:
rc-service samba status
- Should say
started
—if not,rc-service samba start
.
- Should say
- Exit Node: Back to your desktop:
Ctrl+D
- Test Access: From another machine:
- Linux:
smbclient -L //terrible-tuneup -U nobody%
- Lists the
data
share.
- Lists the
- Windows: Open
\\terrible-tuneup
in Explorer—use node’s hostname or IP frommesh node info
. - Mount:
mount -t cifs //terrible-tuneup/data /mnt -o username=nobody,password=
- Empty password for guest.
- Linux:
Notes
Groups and machines are interchangeable—use a group to reuse Samba across nodes, or stick it in the machine folder for a one-off. The nobody
user is required—add it first. This example shares /mnt/data
with open perms (0777)—tighten create mask
(e.g., 0644) or guest ok = no
for security. For RAID setup, see Setting Up RAID Storage; for users, see Adding a User Account.
Next, explore Adding a User Account.