Host: Mount Samba share on Host
Mount an external Samba (SMB / CIFS) share — from a NAS, a Windows box, a TrueNAS SMB export — on the Proxmox host. Pick one or both methods: register it as Proxmox storage (visible in Datacenter > Storage) and/or add a plain /etc/fstab mount at a path you choose, with open uid/gid/file_mode so unprivileged LXCs can bind-mount and write without any changes inside the container.
What this does
pvesm add cifs, visible in Datacenter > Storage and mounted at /mnt/pve/<id>. The password is stored as plaintext in /etc/pve/priv/storage/<id>.pw, protected by the root-only private directory; this is access control, not encryption. (2) Host fstab mount at a chosen path, persistent through /etc/fstab and mounted with uid=0,gid=0,file_mode=0777,dir_mode=0777 so unprivileged LXC bind mounts can write. Its credentials are in a root-only file under /etc/samba/credentials/, never directly in fstab. Either or both methods can be used.Opening the tool
From ProxMenux's main menu, open Storage & Share Manager → Add Samba share as Proxmox Storage. You will see this sub-menu with four options (plus Exit):

How the script runs
The flow has two phases. Phase 1: discover server, validate credentials, pick share, then pick mount method(s) via a checklist. Phase 2: only the methods you marked are executed. Credentials are needed up-front because smbclient needs them to list shares. Until the final confirmation, neither /etc/pve/storage.cfg nor /etc/fstab are touched.
┌─────────────────────────────────────────────┐
│ PHASE 1 — Discover, validate, choose │
│ (nothing touched yet) │
└──────────────────┬──────────────────────────┘
▼
Server discovery (nmap 139/445 + nmblookup)
│
▼
Authentication (User or Guest)
│
▼
Share selection (smbclient -L)
│
▼
╔═════════════════════════════════════╗
║ MOUNT METHOD PICKER (checklist) ║
║ [ ] As Proxmox storage (pvesm) ║
║ [ ] As host fstab mount only ║
║ (mark one or both — re-prompts ║
║ if you press OK without marks) ║
╚════════════════╤════════════════════╝
│
┌──────────────┴──────────────┐
▼ ▼
pvesm branch fstab branch
├─ storage ID ├─ mount path
├─ content types ├─ mount options
└─ (User) write
/etc/samba/credentials/...cred
(mode 0600)
▼ ▼
┌─────────────────────────────────────────┐
│ PHASE 2 — Apply (only marked methods) │
└──────────────────┬──────────────────────┘
▼
pvesm add cifs <id> ... + mkdir -p <path>
(auto-mount at mount -t cifs ...
/mnt/pve/<id> with (uid=0,gid=0,
default options) file_mode=0777,
dir_mode=0777)
append /etc/fstab
systemctl daemon-reload
▼
Summary printedMount method picker (two options, mark one or both)
After selecting the share and validating credentials, ProxMenux shows a checklist with the two mount methods. You can mark either, or both. If you press OK without marking anything, the dialog re-appears until you choose at least one option or press Cancel to exit the flow.
| Method | Mount path | Visible in Datacenter > Storage | Typical use case |
|---|---|---|---|
| As Proxmox storage (pvesm) | /mnt/pve/<storage-id> (managed by Proxmox) | Yes | Backups, ISOs, LXC templates — anything that needs to appear in the Proxmox UI. Live VM disks are technically supported but discouraged on CIFS (locking semantics). |
| Host fstab only | /mnt/<path> with open uid/gid/file_mode | No | Bind-mount the share into one or more LXCs without registering Proxmox storage. Open local permissions help unprivileged CTs access it, but writing still requires permission from the SMB server for the authenticated user. |
| Both | Both paths above (two mount points for the same CIFS export) | Yes | You want UI integration AND a stable host-side path with open permissions for LXC bind-mounts. The pvesm mount uses Proxmox defaults; the fstab mount applies the open uid/gid/file_mode separately. |
“Both” creates two CIFS mount points
/mnt/pve/<id> with Proxmox defaults. fstab mounts at /mnt/<path> with uid=0,gid=0,file_mode=0777,dir_mode=0777 to permit local access through LXC bind mounts. The SMB server still enforces the mounted user’s permissions. These are two mount points; they do not guarantee two separate TCP connections.Method A — As Proxmox storage (pvesm)
If As Proxmox storage is marked, ProxMenux runs the original pvesm flow:
- Storage ID — default
cifs-<server-ip-with-dashes>. Only letters, digits,-and_. - Content types — this ProxMenux checklist offers 6 choices. It omits
rootdircompared with the NFS checklist; this is a script-level choice, not a claim that every Proxmox CIFS backend version forbids LXC root filesystems:
| Content type | What it allows |
|---|---|
| import | Disk image imports (selected by default). |
| backup | VM and CT backup files (vzdump). |
| iso | Installation ISO images. |
| vztmpl | LXC templates. |
| images | Live VM disk images — warned inline, see below. |
| snippets | Hook scripts and cloud-init snippets. |
Live VM disks on CIFS
images triggers a ProxMenux warning that CIFS/SMB can cause locking issues with VM disk operations. The script recommends NFS for VM disk images but lets you continue. Backups and ISOs are common CIFS uses. Assess locking, snapshots, migration and workload requirements before using CIFS for images.Where pvesm stores credentials
/etc/pve/storage.cfg. Proxmox writes plaintext credentials in /etc/pve/priv/storage/<storage-id>.pw, inside the private area of the cluster filesystem, readable only by root (mode 0600); it is protected by access control, not by encryption. After a server password change, use pvesm set <id> --password <new> or remove and re-add through ProxMenux.Method B — Host fstab mount only
If As host fstab mount only is marked, ProxMenux asks for a host mount path and persistent options, writes a root-only credentials file (User mode), then mounts and writes the entry to /etc/fstab:
- Host mount path — default
/mnt/<share-name>. Must be an absolute path. If something is already mounted there, or a fstab entry exists, ProxMenux offers to replace it. - Mount options — choose Read/Write (default:
rw,uid=0,gid=0,file_mode=0777,dir_mode=0777,iocharset=utf8,nofail,_netdev), Read-only (file_mode=0555,dir_mode=0555), or Custom (enter your own options). The script recommends open uid/gid/file_mode for writes through LXC bind mounts.
Credentials file (User mode)
/etc/samba/credentials/<server>_<share>.cred (mode 0600) with username= and password= lines, and references it in the fstab entry via the credentials= mount option. Plain text never lands in /etc/fstab. For Guest mode, the option guest is appended instead and no credentials file is created.Once you confirm, the script:
mkdir -pthe mount path.mount -t cifs -o <opts>,credentials=<file>(orguest)//<srv>/<share> <path>.- Writes a one-line entry to
/etc/fstab://<srv>/<share> <path> cifs <opts> 0 0. - Runs
systemctl daemon-reloadso systemd picks up the new fstab entry.
Using the fstab mount from an unprivileged LXC
uid=0,gid=0,file_mode=0777,dir_mode=0777 open local permission checks for LXC bind mounts. Server ACLs and negotiated Unix/POSIX semantics can still affect access. No changes are made inside the container: no CT chown, groups or edits to /etc/lxc. The mp line is managed in Proxmox CT configuration. Use the printed pct set command or the LXC Mount Manager.The fstab mount is NOT a Proxmox storage
Manual equivalent
Method A (pvesm) maps to:
apt-get install -y cifs-utils smbclient # one-time: SMB client tools
# with user authentication
pvesm add cifs mycifs \
--server 10.0.0.50 \
--share proxmox \
--username backup_user \
--password 's3cret' \
--content backup,iso
# guest access (no credentials)
pvesm add cifs mycifs-guest \
--server 10.0.0.50 \
--share public \
--content iso,vztmpl
pvesm status mycifs # verify it's active
ls -la /mnt/pve/mycifs # Proxmox auto-mounts hereMethod B (fstab, user auth) — credentials file + mount:
# 1. credentials file (root-only)
mkdir -p /etc/samba/credentials && chmod 0700 /etc/samba/credentials
cat > /etc/samba/credentials/nas01_share.cred <<'EOF'
username=admin
password=s3cret
EOF
chmod 0600 /etc/samba/credentials/nas01_share.cred
# 2. mount with open uid/gid/file_mode (for unpriv LXC bind-mounts)
mkdir -p /mnt/data
mount -t cifs //10.0.0.50/share /mnt/data \
-o "rw,uid=0,gid=0,file_mode=0777,dir_mode=0777,iocharset=utf8,nofail,_netdev,credentials=/etc/samba/credentials/nas01_share.cred"
# 3. persist
echo "//10.0.0.50/share /mnt/data cifs rw,uid=0,gid=0,file_mode=0777,dir_mode=0777,iocharset=utf8,nofail,_netdev,credentials=/etc/samba/credentials/nas01_share.cred 0 0" \
>> /etc/fstab
systemctl daemon-reload
# 4. bind into an unpriv LXC (no changes inside the CT)
pct set <ctid> -mp0 /mnt/data,mp=/mnt/data,shared=1,backup=0
pct reboot <ctid>Method B (fstab, guest auth) — no credentials file:
mkdir -p /mnt/public
mount -t cifs //10.0.0.50/public /mnt/public \
-o "rw,uid=0,gid=0,file_mode=0777,dir_mode=0777,iocharset=utf8,nofail,_netdev,guest"
echo "//10.0.0.50/public /mnt/public cifs rw,uid=0,gid=0,file_mode=0777,dir_mode=0777,iocharset=utf8,nofail,_netdev,guest 0 0" \
>> /etc/fstab
systemctl daemon-reloadView configured CIFS storages and host mounts
Shows registered CIFS storages (pvesm status | awk '$2 == "cifs"') with server, share, content, username or Guest, path and status. Passwords are never printed. Note: a second section lists host fstab mounts, their options, authentication-file path and active/inactive state. For manual checks use findmnt -t cifs or grep cifs /etc/fstab.
Remove CIFS storage or a host mount
The removal picker offers pvesm storages and host fstab mounts. For pvesm, it runs pvesm remove <storage-id> and Proxmox removes the paired credentials. For fstab, it attempts umount <path>, removes the matching /etc/fstab entry and credentials under /etc/samba/credentials/, and removes an empty mount directory if possible. A failed unmount requires a manual unmount or reboot. The remote Samba server and its files are not modified.
Back up dependencies first
Test Samba connectivity
Runs a diagnostic pass over every CIFS storage registered in Proxmox: checks that smbclient is available, pings each server, probes ports 445 and 139, tries a guest listing, and reports Proxmox's own view (pvesm status). "Requires authentication" on guest-list means your server only exposes shares to authenticated users — normal for most NAS setups.
Troubleshooting
"No Samba servers found on the network"
nmap -p 139,445. The server may be on a different subnet, firewalled, or only reachable by hostname (mDNS / WINS). Use the Manual option with the IP or hostname instead."No accessible shares found"
smbclient -L returned nothing for these credentials. Causes: the user has no permission to list shares (try with admin credentials once, or enter the share name manually), the server has share visibility disabled, or the credentials are wrong. The script lets you type the share name by hand in this case.Proxmox mount fails with NT_STATUS_ACCESS_DENIED
pvesm set <id> --username <u> --password <p> or remove and re-add from ProxMenux. If the server is in an AD domain, append --domain <DOMAIN> to the pvesm set call."host is down" or storage status goes inactive at night
pvestatd then sees the storage as inactive until the first access wakes the NAS. If this is cosmetic, nothing is broken. If it causes backup failures, disable SMB idle disconnect on the NAS or schedule backups outside the sleep window.Unprivileged LXC bind-mount can't write to the fstab path
findmnt /mnt/<path> for the intended options, such as uid=0,gid=0,file_mode=0777,dir_mode=0777. Missing local write permissions can block mapped LXC UIDs. Reapply the default RW preset or adjust Custom options as needed. Also verify the mounted SMB user can write on the server and whether Unix/POSIX extensions supply server modes; open local modes cannot override server ACLs.fstab mount does not come up after reboot
nofail,_netdev so a missing share at boot does not block startup. If the mount never comes up: confirm the network is reachable (ping <server>), check journalctl -u remote-fs.target, verify the credentials file still exists (ls -l /etc/samba/credentials/) and is readable, and try mount -a manually.Related
- NFS share as Proxmox storage — sibling page with the same flow pattern (Method A pvesm + Method B fstab) and side-by-side trade-offs.
- LXC Mount Manager — bind-mount the fstab-only path
/mnt/<path>into one or more containers. - Samba client in LXC — alternative: mount Samba directly from inside a privileged container (skips the host).