https://github.com/oneclickvirt/pve_lxc_images
PVE的LXC容器的第三方模板文件仓库--手动修复但自动化验证可用性(Third-party template file repository for LXC containers for PVE - manual fixes but automated verification of availability)
https://github.com/oneclickvirt/pve_lxc_images
images lxc patcher patcher-script proxmox proxmox-ve ssh x86 x86-64
Last synced: 11 months ago
JSON representation
PVE的LXC容器的第三方模板文件仓库--手动修复但自动化验证可用性(Third-party template file repository for LXC containers for PVE - manual fixes but automated verification of availability)
- Host: GitHub
- URL: https://github.com/oneclickvirt/pve_lxc_images
- Owner: oneclickvirt
- License: mit
- Created: 2024-02-05T02:44:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-27T15:07:51.000Z (about 2 years ago)
- Last Synced: 2025-04-06T09:24:29.282Z (about 1 year ago)
- Topics: images, lxc, patcher, patcher-script, proxmox, proxmox-ve, ssh, x86, x86-64
- Language: Shell
- Homepage: https://github.com/spiritLHLS/pve
- Size: 153 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pve_lxc_images
不支持:devuan
部分支持:fedora、gentoo、archlinux
完全支持:ubuntu、debian、centos、almalinux、rockylinux、alpine、opensuse
## 说明
已预安装:openssh、lsof、curl、wget、sudo、nano、sshpass
已替换可使用的源,均为可使用的源,且均已更新过源
已预设置开机自启SSH,预设置支持IPV4和IPV6的22端口进行SSH链接,预设置支持root登录
未设置默认密码,未设置DNS,未设置网关
部分旧镜像有对应的缺陷,详见仓库对应release的说明
## 手动修补的部分命令
```shell
image=""
pct create 101 "$image" -cores 1 -cpuunits 1024 -memory 1024 -swap 0 -rootfs local:10 -onboot 1 -features nesting=1
pct start 101
pct set 101 --hostname 101
pct set 101 --net0 name=spiritlhl,ip=172.16.1.2/24,bridge=vmbr1,gw=172.16.1.1
pct set 101 --nameserver 1.1.1.1
pct set 101 --searchdomain local
sleep 3
echo "nameserver 8.8.8.8" | pct exec $CTID -- tee -a /etc/resolv.conf
echo "nameserver 8.8.4.4" | pct exec $CTID -- tee -a /etc/resolv.conf
```
```shell
pct enter 101
```
```shell
# https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/ChangeMirrors.sh
./ChangeMirrors.sh --use-official-source --web-protocol http --intranet false --close-firewall true --backup true --updata-software false --clean-cache false --ignore-backup-tips
```
```shell
# https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/ChangeMirrors.sh
./ChangeMirrors.sh --use-official-source --web-protocol http --intranet false --close-firewall true --backup true --updata-software false --clean-cache false --install-epel true --ignore-backup-tips
```
https://help.mirrors.cernet.edu.cn/
```shell
# https://raw.githubusercontent.com/oneclickvirt/pve_lxc_images/main/ssh_bash.sh
chmod 777 ssh_bash.sh
./ssh_bash.sh
```
```shell
# https://raw.githubusercontent.com/oneclickvirt/pve_lxc_images/main/ssh_sh.sh
chmod 777 ssh_sh.sh
./ssh_sh.sh
```
```shell
pct exec 101 -- yum clean all -y
pct exec 101 -- yum autoremove -y
```
```shell
pct exec 101 -- apt-get clean
pct exec 101 -- apt-get autoclean
pct exec 101 -- apt-get autoremove
```
```shell
pct exec 101 -- rm -rf /etc/resolv.conf
pct exec 101 -- rm -rf /etc/hostname
pct exec 101 -- rm -rf /etc/network/.pve-ignore.interfaces
pct exec 101 -- ip addr flush dev eth0
pct set 101 --delete net0
pct stop 101
echo "$image"
```
```shell
vzdump 101 --dumpdir /root/tp --compress zstd
rm -rf /root/tp/*.log
backup_file_name=$(ls /root/tp | grep "vzdump")
real_name=$(echo "${image}" | sed 's/_amd64\..*//')
mv /root/tp/${backup_file_name} /root/tp/${real_name}_amd64.tar.zst
rm -rf /root/tp/vzdump*
pct destroy 101
```
## 上传到对应release
```
# https://api.github.com/repos/oneclickvirt/pve_lxc_images/releases/tags/images
release_id="139874716"
token=""
for file in *; do
if [ -f "$file" ]; then
echo "Uploading $file..."
curl -s -H "Authorization: Bearer $token" \
-H "Content-Type: application/zip" \
--data-binary @"$file" \
"https://uploads.github.com/repos/oneclickvirt/pve_lxc_images/releases/$release_id/assets?name=$(basename "$file")"
rm -rf $file
echo ""
fi
done
```
## Thanks
http://download.proxmox.com/images/system/
https://github.com/spiritLHLS/pve