编辑
2021-04-10
DevOps
00
请注意,本文编写于 1134 天前,最后修改于 668 天前,其中某些信息可能已经过时。

目录

建立容器
修改配置
容器内
安装docker(Aria-Pro,AriaNG)

最近优化一下家里的all in one,为了节约内存,决定用轻量化的lxc容器来替代虚拟机安装omv,步骤如下:

建立容器

用pve模版列表里自带的debian10镜像,下载一下,然后新建虚拟机,因为要直通硬盘,所以要特权主机,因为我还要在里面放docker,在选项中勾选嵌套。网络需要科学上网。

修改配置

修改pve主机/etc/pve/lxc/{ID}.conf({ID}是你的LXC序号),添加:

lxc.mount.auto: cgroup:rw lxc.mount.auto: proc:rw lxc.mount.auto: sys:rw

当然,如果你需要挂载设备,那需要加点别的,请看我的另一片文章。

容器内

输入一下命令:

#更新并重启,很重要,有时候不一开始就这样装不成功 apt update && apt upgrade -y && reboot #添加仓库、密钥,安装依赖 apt-get install --yes gnupg wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc"
cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list deb https://packages.openmediavault.org/public usul main # deb https://downloads.sourceforge.net/project/openmediavault/packages usul main ## Uncomment the following line to add software from the proposed repository. # deb https://packages.openmediavault.org/public usul-proposed main # deb https://downloads.sourceforge.net/project/openmediavault/packages usul-proposed main ## This software is not part of OpenMediaVault, but is offered by third-party ## developers as a service to OpenMediaVault users. # deb https://packages.openmediavault.org/public usul partner # deb https://downloads.sourceforge.net/project/openmediavault/packages usul partner EOF
export LANG=C.UTF-8 export DEBIAN_FRONTEND=noninteractive export APT_LISTCHANGES_FRONTEND=none wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" apt-get update apt-get --yes --auto-remove --show-upgraded \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option Dpkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \ install openmediavault-keyring openmediavault omv-confdbadm populate

然后就可以啦!直通硬盘请看我的另一篇LXC的文章。

安装docker(Aria-Pro,AriaNG)

wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:mereith

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!