在数字化的时代,家里的设备更新换代频繁,很容易就会有闲置的服务器吃灰。我家里就有一台闲置的 Ubuntu 24.04 服务器,一直放在角落,总觉得有些浪费。于是,我决定让它重新发挥作用,打造一个属于自己的家庭影院。
要打造家庭影院,首先得让本地 Windows 电脑和 Ubuntu 服务器之间能够方便地传输电影文件。我选择安装 Samba 来实现这一目的。
- sudo apt-get install samba samba-common
系统会自动下载并安装 Samba 相关的软件包。
- mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
- [global]
- server min protocol = CORE
- workgroup = WORKGROUP
- netbios name = Nas
- security = user
- map to guest = bad user
- guest account = nobody
- client min protocol = SMB2
- server min protocol = SMB2
- server smb encrypt = off
- [NAS]
- comment = NASserver
- path = /home/bddxg/nas
- public = Yes
- browseable = Yes
- writable = Yes
- guest ok = Yes
- passdb backend = tdbsam
- create mask = 0775
- directory mask = 0775
这里需要注意的是,我计划的媒体库目录是个人目录下的 nas/,所以 path 是 /home/bddxg/nas ,如果大家要部署的话记得根据自己的实际情况修改为对应的位置。
文件传输的问题解决后,接下来就是安装 Jellyfin 来实现家庭影院的功能了。
- docker: Error response from daemon: error while creating mount source path '/srv/jellyfin/cache': mkdir /srv/jellyfin: read-only file system.
即使我给 /srv/jellyfin 赋予了 777 权限也没有效果。无奈之下,我决定放弃 Docker 安装方式,直接安装 server 版本的 Jellyfin。- sudo usermod -aG bddxg jellyfin
- # 并且重启 Jellyfin 服务
- sudo systemctl restart jellyfin
按照它的建议操作后,我刷新了网页,重新配置了 Jellyfin,终于可以正常添加媒体库了。通过这次折腾,我成功地让闲置的 Ubuntu 服务器重新焕发生机,变成了一个功能强大的家庭影院。希望我的经验能够对大家有所帮助,也欢迎大家一起交流更多关于服务器利用和家庭影院搭建的经验。
[!警告]
令人遗憾的是,目前 jellyfin 似乎不支持rmvb 格式的影片, 下载资源的时候注意影片格式,推荐直接下载 mp4 格式的资源
本次使用到的软件名称和版本如下:
软件名 | 版本号 | 安装命令 |
---|---|---|
samba | Version 4.19.5-Ubuntu | sudo apt-get install samba samba-common |
jellyfin | Jellyfin.Server 10.10.6.0 | curl https://repo.jellyfin.org/install-debuntu.sh \| sudo bash |
ffmpeg(jellyfin 内自带) | ffmpeg version 7.0.2-Jellyfin | null |