Skip to main content
Community Scripts logo
Skip to Content
Tools & Add-onsPVE Tools

Storage-Share-Helper

Menu-driven tool to test SMB, NFS and iSCSI, add or remove Proxmox storages, manage LXC bind mounts and create shares on the host.

storage-share-helper.sh bundles the usual network-storage chores into one menu: test whether a share is reachable, register it as Proxmox storage, bind a host path into a container, or turn the host itself into an SMB or NFS server.

Website entry: storage-share-helper. Source: tools/pve/storage-share-helper.sh.

Run

In the Proxmox VE host shell, as root:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/storage-share-helper.sh)"

Startup

  1. root_check and pve_check from core's core.func run first; a non-root user or a start through sudo ends the script with 104, a host that is not Proxmox VE with 232, and a version other than 8.0 to 8.9 or 9.0 to 9.2 with 1.
  2. The script exits with 1 if pct or pvesm is missing.
  3. Missing packages are installed with apt: whiptail, cifs-utils, nfs-common, open-iscsi.
  4. A Yes/No dialog titled "Storage Share Allrounder" asks whether to proceed. No exits.

The main menu then stays open until you choose 0 or Cancel. Cancelling inside an action returns to the menu.

Read-only actions

#Menu entryWhat it asksWhat it does
1SMB: manual mount testServer, share name (default Proxmox), username (default proxmox), password, domain (optional), SMB version (default 3.1.1)Mounts //server/share on /mnt/test-smb with sec=ntlmssp, creates an empty file smb-test-<timestamp> on the share, unmounts.
2NFS: manual mount testServer, export pathMounts the export on /mnt/test-nfs, creates an empty file nfs-test-<timestamp>, unmounts.
3iSCSI: discovery testPortal IP or FQDNiscsiadm -m discovery -t sendtargets -p <portal>
4LXC: list mountpointsChecklist of containersPrints the mp<N> lines of each selected container.
5Show storage/mount/iSCSI statusNothingpvesm status, mounts under /mnt/pve, CIFS and NFS mounts, iscsiadm -m session.

The two mount tests are labelled read-only in the menu, but each leaves one empty test file on the share and creates its mount directory on the host.

Write actions

These run as soon as you have filled in the last field. Only entry 10 asks for confirmation.

#Menu entryWhat it asksCommand or change
6Proxmox: add SMB/CIFS storageStorage ID, server, share, username, password, content types (default backup,iso,vztmpl,snippets), nodes (optional), mount options (optional)pvesm add cifs
7Proxmox: add NFS storageStorage ID, server, export path, content types (default images,rootdir), nodes (optional), mount options (optional)pvesm add nfs
8Proxmox: add iSCSI storageStorage ID, portal, target IQN, nodes (optional)pvesm add iscsi
9Proxmox: add LVM on base storageStorage ID, base storage ID, volume group name, content types (default images,rootdir), shared 1 or 0 (default 1)pvesm add lvm ... --base ... --vgname ...
10LXC: add bind mountpointContainer (menu), host path, container pathAfter a Yes/No confirmation: pct set <ctid> -mp<N> <host path>,mp=<container path>, using the first free slot from mp0 to mp255. The host path must exist.
11Host: install Samba + create SMB shareShare name, path (default /srv/samba/<share>), Linux/Samba username, passwordSee below.
12Host: install NFS server + create exportExport path (default /srv/proxmox-nfs), allowed subnet, export options (default rw,sync,no_subtree_check,no_root_squash)See below.

Entry 11 installs samba, creates the directory, creates the group sambashare and the user (no home, shell /usr/sbin/nologin) if they do not exist, adds the user to that group, runs chown -R root:sambashare on the directory (everything already in it changes owner) and sets its mode to 2775, sets the Samba password, appends a [share] section to /etc/samba/smb.conf (valid users = @sambashare, guest ok = no) unless one with that name exists, validates with testparm and enables and restarts smbd and nmbd.

Entry 12 installs nfs-kernel-server, creates the directory with mode 0770, appends <path> <subnet>(<options>) to /etc/exports unless that path and subnet are already listed, runs exportfs -ra and enables nfs-kernel-server.

Remove actions

Both show a checklist, then ask for each selected item separately. The confirmation defaults to No.

#Menu entryCommandWhat is left untouched
13Proxmox: remove storage definitionpvesm remove <storage>Data on the share or target.
14LXC: remove mountpointpct set <ctid> -delete mp<N>Data on the host.

A result list (removed, skipped, FAILED) is printed at the end.

Undo

ActionHow to revert
Added storage (6 to 9)Entry 13.
Added mountpoint (10)Entry 14.
Samba share (11)No menu entry. Remove the section from /etc/samba/smb.conf and restart smbd. The package, user and directory stay.
NFS export (12)No menu entry. Remove the line from /etc/exports and run exportfs -ra.
Test files (1, 2)Delete smb-test-* or nfs-test-* on the share.

Environment variables

VariableDefaultPurpose
COMMUNITY_SCRIPTS_CORE_URLhttps://raw.githubusercontent.com/community-scripts/core/mainBase URL for core/core.func and api/api.func.

Limits

  • Bind mounts are added as they are. For an unprivileged container the script only prints a reminder that UID/GID mapping and file permissions must fit; it changes neither.
  • The pvesm add actions hide the command output. On failure you only see "Failed to add ... storage".
  • Entry 12 uses no_root_squash in its default options. Change the options if clients should not act as root on the export.
  • The script itself notes after entries 11 and 12 that a dedicated container or VM is the cleaner place for a file server than the host.
  • The storage checklist in entry 13 lists every storage in /etc/pve/storage.cfg, including local.