How to use incus to launch a small VPS

注:非必须的都可以跳过。其实就没几步了。

一、开小鸡条件

1、公网ipv4 vps一台做母鸡。注意:不能是NAT(必须)

2、ipv6(非必须):如果你的母鸡支持ipv6 /64,可以给小小鸡直接分配ipv6

如果没有,可以注册 he.net 账号,利用 he.net 的ipv6 隧道服务实现小小鸡ipv6 公网的支持

3、ssh连接工具,用于连接你的母鸡执行命令,比如xshell , FinalShell之类。我喜欢使用webssh

比如: https://ssh.hidns.vip

二、步骤:

1、通过ssh连接你的vps

2、DD 重装系统(非必须)系统最好是debian 12, 也可以在主机商后台直接重装为debian12

我喜欢自己DD,命令如下:

没有安装wget 的可以先安装一下

apt update && apt install wget -y
wget https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh
bash InstallNET.sh -debian 12  -pwd  password   #换成自己的密码

image

出现上图这个提示说明DD 好了。输入 reboot 回车重启系统。等待几分钟就可以重新连接你的 vps 了。(此过程可以通过你的主机商后台提供的VNC查看重装过程)。

3、swap(可选)
重新通过ssh连接vps,密码是你DD命令设置的密码。执行以下命令:

curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh


选1
一般输入你物理内存的2倍,比如你本来内存是1G的,可以输入2048 回车就好了。

4、(可选)关于使用 he.net 的ipv6 隧道的配置。

需要在https://tunnelbroker.net/ 创建一个隧道。


填写你的ipv4,选择一个地区,提交即可。
修改你的vps 网络配置:

也就是在你的 vps /etc/network/interfaces 这个文件替换或者新增你的ipv6 配置。


然后执行ifup he-ipv6
如果启动无报错
查看接口状态:确认 he-ipv6 接口已获取 IPv6 地址
ip -6 addr show he-ipv6
测试 IPv6 连通性:ping HE 的网关或公共 IPv6 地址
ping6 -c 4 2001:420:c:222::1 # ping隧道网关
若能收到回复,说明 IPv6 隧道已通。
配置 IPv6 DNS(可选,避免无法解析 IPv6 域名)
编辑 /etc/resolv.conf 添加 IPv6 DNS(如谷歌 DNS 或 Cloudflare DNS):
vi /etc/resolv.conf
nameserver 2001:4860:4860::8888 # 谷歌IPv6 DNS
nameserver 2606:4700:4700::1111 # Cloudflare IPv6 DNS

5、

检测环境

使用后续脚本的务必执行本命令检测宿主机是否符合要求

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/oneclickvirt/incus/main/scripts/pre_check.sh)

6、incus 安装

curl -L https://raw.githubusercontent.com/oneclickvirt/incus/main/scripts/incus_install.sh -o incus_install.sh && chmod +x incus_install.sh && bash incus_install.sh

初始化配置的例子:

如果不需要指定非系统盘的路径做默认存储池,那么选择是否自定义存储池路径时直接回车或输入n即可,不需要指定路径。

如果需要指定非系统盘的路径做默认的存储池,那么需要选择y,然后输入对应的路径(你挂载的盘的实际的绝对路径)。
7、 在 Incus 中运行 LXC 容器

自定义批量生成版本

curl -L https://github.com/oneclickvirt/incus/raw/main/scripts/add_more.sh -o add_more.sh && chmod +x add_more.sh && bash add_more.sh

按提示生成即可。

开完容器后,具体信息会生成在当前目录下的log文件中,格式如下

1号容器名称 密码 ssh端口 外网端口起始 外网端口终止
2号容器名称 密码 ssh端口 外网端口起始 外网端口终止

如果想要查看,只需在当前目录执行以下命令打印log文件即可

cat log

至此,恭喜你成功开通小小鸡了。

至于对接 whmcs 和 incus webui 以后再写

37 Likes

My eyes are okay now.

I watched it, studied it, but still don’t understand.

Just follow the instructions.

Chicken cutting tutorial, learned.

First, give a like as a sign of respect. Wait for the hen to grow into practice :rofl:

Study a bit

Looking forward to the upcoming integration tutorial from the expert, thank you.

This can have :xhj006:

Studied, quickly release the procedure tutorial.

Thank you, boss, for sharing the tutorial.

This is a chicken‑cutting tutorial, and there isn’t even a hen.

I wonder if some VPS providers restrict this practice, or if just having a single VPS with an IPv4 address is enough. I’m a newbie passing by and wanted to ask; if my question is too naive, feel free to ignore it.

I’ve been waiting to sign up for the tutorial on launching a small server for a long time. Come over when you have time.

Thanks, big bro, for sharing the tutorial! Once I have a hen, I’ll definitely study!

Thanks for sharing, boss

\nA VPS with IPv4 is enough

Impressive, but it’s a pity they’re all NAT chickens.

We should try this

Impressive, I learned a trick; I hope I can try it out, practice brings true knowledge.