How to Mount an SMB Network Drive in a Proxmox LXC Container (Jellyfin Example)

Как подключить сетевой диск SMB в LXC контейнер Proxmox на примере JellyFin Proxmox
How to mount an SMB network drive for Jellyfin inside a Proxmox LXC container and access a media library on external storage.

In this article I will show you how to mount a network drive for Jellyfin inside an LXC container on Proxmox. This way you can access an external hard drive connected to your router from within a Proxmox LXC container running the Jellyfin media server.

This setup requires three steps.

  1. Set up SMB file sharing on your server/computer/router
  2. Mount the share in Proxmox
  3. Access the shared folder inside your Jellyfin LXC container

Set up the SMB share

Depending on the device you use, this can be done in different ways. For this demo I will use a Proxmox virtual machine with Windows Server 2022 and an attached external USB drive.

Connect the external hard drive with your media files to a USB port on your server.

Sign in to Windows → right-click the USB drive → Give access toAdvanced sharing settings → Advanced Sharing → check Share this folder and enter a network share name of your choice → Permissionscheck Full Control for everyone or specific users, then apply the changes.

On your Windows PC, go to Network and enter the IP address of the SMB media folder. For example: 192.168.0.1Disk1Movies.

Mount the SMB drive in Proxmox

Sign in to your Proxmox web interface, select the required node, and open a Shell session.

Mount the SMB drive in Proxmox — screenshot 1

In the command-line window, run the following command to install the CIFS utility packages.

apt install cifs-utils -y

After installing cifs-utils, run the following command to create a shared folder in the media directory.

mkdir /media/share

Next we need to create a file that will store the credentials for logging in to the SMB share. We will use the nano text editor by running this command.

nano ~/.smb

Edit the file and add the following lines. Change smb_username and smb_password to the username and password of your SMB share.

Press CTRL + X, Y to save, then Enter.

Next we need to edit the system file called fstab.

nano /etc/fstab

Add the line below to the fstab system file.

192.168.0.1Disk1Movies /media/share cifs credentials=/root/.smb,users,rw,vers=3.0,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Press CTRL + X, Y to save, then Enter.

For the last step, you need to mount the drive.

mount -a

You have successfully mounted your SMB share on Proxmox. Next you need to configure Proxmox to use this share.

Still in the Proxmox interface, select DatacenterStorageAdd

Enter the desired storage name in the ID field, then set the directory path for the mount that was configured earlier. In this case it will be /media/share.

In the Content drop-down list, choose what the drive should be used for. You can select Disk image and Container, or select all, then click Add.

Mount the SMB drive in Proxmox — screenshot 2

Add the SMB drive to the Jellyfin LXC container

If you do not have Jellyfin installed in a container yet, use the Proxmox script at this link to automatically create and install Jellyfin in an LXC container.

After installation, shut down the Jellyfin container, select your node, and open a new SSH session in Proxmox (Shell).

Add the share to the LXC container.

cd /etc/pve/lxc/

ls

You will see a list of all available containers. You need to edit the Jellyfin container. To open the file, enter the following. (102 is my Jellyfin container)

nano 102.conf

When the file opens, scroll to the end and add the code below to mount the shared folder.

mp0: /media/share,mp=/mnt/

Press CTRL + X, Y to save, then Enter.

Select the Jellyfin container and start it. You need to check whether the drive was mounted successfully. Open Console and run the following commands.

cd /mnt
ls
Add the SMB drive to the Jellyfin LXC container — screenshot 1

If everything went well, you should see the folders on your network drive.

Sign in to Jellyfin through the web interface and go to SettingsDashboardLibrariesAdd Media LibraryFolders/mnt; you should now see your media folders.

My code in the 102.conf file mentioned above looks like this (example):

That concludes the process of mounting a network drive for Jellyfin in an LXC container on Proxmox.

If you have questions, please contact me through the comments section below.

Subscribe to new posts (RSS)

No email, no trackers — just the update feed.

Russian feed https://en.kiberlis.ru/feed/

Rate this article
Leave a comment