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
root_checkandpve_checkfrom core'score.funcrun first; a non-root user or a start throughsudoends 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.- The script exits with 1 if
pctorpvesmis missing. - Missing packages are installed with
apt:whiptail,cifs-utils,nfs-common,open-iscsi. - 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 entry | What it asks | What it does |
|---|---|---|---|
| 1 | SMB: manual mount test | Server, 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. |
| 2 | NFS: manual mount test | Server, export path | Mounts the export on /mnt/test-nfs, creates an empty file nfs-test-<timestamp>, unmounts. |
| 3 | iSCSI: discovery test | Portal IP or FQDN | iscsiadm -m discovery -t sendtargets -p <portal> |
| 4 | LXC: list mountpoints | Checklist of containers | Prints the mp<N> lines of each selected container. |
| 5 | Show storage/mount/iSCSI status | Nothing | pvesm 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 entry | What it asks | Command or change |
|---|---|---|---|
| 6 | Proxmox: add SMB/CIFS storage | Storage ID, server, share, username, password, content types (default backup,iso,vztmpl,snippets), nodes (optional), mount options (optional) | pvesm add cifs |
| 7 | Proxmox: add NFS storage | Storage ID, server, export path, content types (default images,rootdir), nodes (optional), mount options (optional) | pvesm add nfs |
| 8 | Proxmox: add iSCSI storage | Storage ID, portal, target IQN, nodes (optional) | pvesm add iscsi |
| 9 | Proxmox: add LVM on base storage | Storage ID, base storage ID, volume group name, content types (default images,rootdir), shared 1 or 0 (default 1) | pvesm add lvm ... --base ... --vgname ... |
| 10 | LXC: add bind mountpoint | Container (menu), host path, container path | After 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. |
| 11 | Host: install Samba + create SMB share | Share name, path (default /srv/samba/<share>), Linux/Samba username, password | See below. |
| 12 | Host: install NFS server + create export | Export 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 entry | Command | What is left untouched |
|---|---|---|---|
| 13 | Proxmox: remove storage definition | pvesm remove <storage> | Data on the share or target. |
| 14 | LXC: remove mountpoint | pct set <ctid> -delete mp<N> | Data on the host. |
A result list (removed, skipped, FAILED) is printed at the end.
Undo
| Action | How 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
| Variable | Default | Purpose |
|---|---|---|
COMMUNITY_SCRIPTS_CORE_URL | https://raw.githubusercontent.com/community-scripts/core/main | Base 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 addactions hide the command output. On failure you only see "Failed to add ... storage". - Entry 12 uses
no_root_squashin 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, includinglocal.