Skip to content

Commit 71b8d17

Browse files
committed
fix: 添加物理机器无线网络的一键脚本
1 parent c13a95b commit 71b8d17

File tree

3 files changed

+172
-16
lines changed

3 files changed

+172
-16
lines changed

docs/en/guide/pve/pve_install.md

Lines changed: 83 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,35 @@ If you don't know how to choose an option during installation, just press enter.
1010
For low-configuration hosts, it is recommended to check the contents of the ```Custom``` partition after all the content has been installed to perform memory tuning and reduce the memory footprint.
1111
:::
1212

13-
## One-click PVE installation
13+
## Installation on non-physical machines
14+
15+
### One-click PVE installation
1416

1517
:::tip
1618
Suggest debian12, the actual test part of the independent server debian11 system will appear a reboot network will be lost, debian12 does not have such a problem!
1719
:::
1820

1921
- The installation is the latest PVE from the apt source at the moment.
2022
- For example, debian10 is pve6.4, debian11 is pve7.x, debian12 is pve8.x
21-
- Changes to the ``/etc/hosts`` file (to fix the wrong hostname setting for merchants and to add the required content for PVE)
22-
- ``/etc/cloud/cloud.cfg`` file modification (to avoid overwriting modified hostname etc.)
23-
- ``/etc/network/interfaces`` file modification (fix auto, dhcp type to static, add vmbr0 gateway)
23+
- Changes to the ```/etc/hosts``` file (to fix the wrong hostname setting for merchants and to add the required content for PVE)
24+
- ```/etc/cloud/cloud.cfg``` file modification (to avoid overwriting modified hostname etc.)
25+
- ```/etc/network/interfaces``` file modification (fix auto, dhcp type to static, add vmbr0 gateway)
2426
- Detect whether it is China IP, if it is China IP use Tsinghua mirror source, otherwise use the official source, and at the same time deal with the source of apt and the corresponding nameserver, to avoid disconnections
2527
- Create vmbr0 (independent IP gateway), the host allows addr and gateway for intranet IP or extranet IP, has been automatically recognized
2628
- vmbr0 creation support to open pure IPV4, pure IPV6, dual-stack virtual machine, automatic identification of IPV4 address and IPV6 address, automatic identification of the corresponding IP interval
2729
- Installation of the necessary toolkit for PVE to open a virtual machine
2830
- x86_64 replace enterprise subscriptions in apt sources with community sources, arm sources built using third-party patches for fixes
2931
- Print query Linux system kernel and PVE kernel installed or not
30-
- Setting up DNS detection ``8.8.8.8.8`` for boot add DNS systemd service
32+
- Setting up DNS detection ```8.8.8.8.8``` for boot add DNS systemd service
3133
- Download PVE and printout of login information after adding APT source link for PVE
3234

3335
All modified files have been set to read-only mode to avoid overwriting after reboot.
3436

35-
If you want to modify the file, please use ``chattr -i file path`` to cancel the read-only lock, and run ``chattr +i file path`` to lock the read-only lock when you finish modifying the file.
37+
If you want to modify the file, please use` ```chattr -i file path``` to cancel the read-only lock, and run ```chattr +i file path``` to lock the read-only lock when you finish modifying the file.
3638

3739
You will be prompted to reboot your system once during the execution process, **After rebooting, be sure to wait at least 20 seconds to make sure the system does not reboot automatically again**.
3840

39-
Because the original environment may be missing ``ifupdown`` or ``ifupdown2`` environment, there is a self-installation daemon loaded for the installation, after the installation of the system will automatically reboot the system again, wait for 20 seconds without reboot to ensure that the installation has been run.
41+
Because the original environment may be missing ```ifupdown``` or ```ifupdown2``` environment, there is a self-installation daemon loaded for the installation, after the installation of the system will automatically reboot the system again, wait for 20 seconds without reboot to ensure that the installation has been run.
4042

4143
If the host itself exists SLAAC assigned IPV6 address, will be able to choose whether to use the largest IPV6 subnet range, the default carriage return does not use the largest IPV6 subnet range only use the local IPV6, if you subsequently need to attach a separate IPV6 address to the virtual machine/container, the option must be selected ```y```.
4244

@@ -58,22 +60,22 @@ After successful installation, the web page may not be safe to open, click on Ad
5860

5961
The login information is your SSH account and password.
6062

61-
## Pre-configure the environment
63+
### Pre-configure the environment
6264

6365
- Creating a resource pool mypool
6466
- Remove the subscription popup
6567
- Attempt to enable hardware passthrough
6668
- Detect and auto-install AppArmor modules.
6769
- Before rebooting the system, it is recommended to hook up [nezha probe](https://github.com/naiba/nezha) to facilitate the use of the command line in the background without SSH, to avoid the possibility that SSH may lead to the loss of the root password after the reboot due to the merchant's strange presets.
68-
- Before executing ``reboot``, you need to wait for the background task to finish executing, some host system apt command execution is very slow, you have to wait for a while to finish executing, of course, most of the machines are not so bad!
70+
- Before executing ```reboot```, you need to wait for the background task to finish executing, some host system apt command execution is very slow, you have to wait for a while to finish executing, of course, most of the machines are not so bad!
6971

7072
Command:
7173

7274
```shell
7375
bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_backend.sh)
7476
```
7577

76-
## Automatically configure the host's gateway
78+
### Automatically configure the host's gateway
7779

7880
:::warning
7981
Before using this command, please make sure that you have restarted the server and that PVE can use the WEB terminal normally before executing this command. Do not execute this command immediately after restarting the machine, wait for at least 1 minute after the WEB terminal is successfully started before executing this command.
@@ -91,14 +93,14 @@ If the host needs to attach an IPV6 tunnel (add an IPV6 subnet to a host that do
9193
- If vmbr0 is not created, it is automatically created with the same logic as the main installation
9294
- Create vmbr1 (NAT gateway) to support IPV4 servers that open NAT for IPV6 networks with NAT.
9395
- Create vmbr2 (standalone IPV6 gateway), use ndppd to solve the problem of MAC verification of IPV6 addresses by the host, support the opening of servers with standalone IPV6 networks.
94-
- If you want to see the complete settings, you can execute ``cat /etc/network/interfaces`` to see, if you need to modify the gateway you need to modify the file, the web site can not be modified!
96+
- If you want to see the complete settings, you can execute ```cat /etc/network/interfaces``` to see, if you need to modify the gateway you need to modify the file, the web site can not be modified!
9597
- Load iptables and set back to source and allow NAT port forwarding.
9698

9799
In short, ```vmbr0``` is responsible for v4 standalone IPs, and ```vmbr1``` is responsible for complex v4/v6 NATs, ```vmbr2``` is responsible for v6 standalone IPs.
98100

99101
Open independent IPV4 virtual machine using vmbr0, gateway with the host, IPV4/CIDR using the same network segment address and the same subnet mask, using the host's unbound IPV4 address for IPV4/CIDR, of course, if the subsequent use of this script does not need to pay attention to this point of the nuances of the thing
100102

101-
Use vmbr1 for IPV4 VM with NAT, ``172.16.1.1`` for gateway, ``172.16.1.x/24`` for IPV4/CIDR, where x can't be 1, but of course you don't need to pay attention to this minutia if you use this script later.
103+
Use vmbr1 for IPV4 VM with NAT, ```172.16.1.1``` for gateway, ```172.16.1.x/24``` for IPV4/CIDR, where x can't be 1, but of course you don't need to pay attention to this minutia if you use this script later.
102104

103105
Command:
104106

@@ -109,3 +111,72 @@ bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/onecli
109111
:::tip
110112
This step may require you to reboot your system after a few minutes of successful execution, see the final execution of the script at the end of the tip. However, a reboot will ensure that some of the hidden settings are loaded successfully, so be sure to reboot the server once if you are in a position to do so.
111113
:::
114+
115+
To this point the main body is installed.
116+
117+
## Installation on a physical machine
118+
119+
This method has not been tested and adapted on a large scale, only the author himself installed PVE8.4 on the local machine, if there are problems corresponding to the warehouse and then open issues
120+
121+
### U disk burning official ISO
122+
123+
Official ISO download address:
124+
125+
https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso
126+
127+
You need to download it locally in advance.
128+
129+
You also need a USB flash drive with a good read/write rate for making a boot disk, as the boot disk needs to be formatted using rufus for boot disk making, you need to make sure that the USB flash drive is empty before making the disk
130+
131+
rufus download address (download to your local, not USB flash drive):
132+
133+
https://rufus.ie/zh/
134+
135+
or
136+
137+
https://github.com/pbatard/rufus
138+
139+
Burning needs to use DD method to burn, the original data of the USB flash disk will be completely erased after burning.
140+
141+
### PVE installation
142+
143+
Find out how to get into the BIOS on the host itself, and modify two things after entering the BIOS
144+
145+
1. Safe boot needs to be turned off
146+
147+
2. the order of the boot needs to be moved to the first USB order
148+
149+
Then save the settings, then insert the USB flash drive, reboot the system, and choose to use the graphical interface for installation.
150+
151+
FQDN need to fill in a URL, you can fill in something like pve.spiritlhl.net, preferably a sub-domain of the domain name you own, not the actual domain name if you write it as something like pve.localsite.com will also work, the subsequent may not be used!
152+
153+
After the installation will automatically shut down and restart, reboot after the black screen can be unplugged USB, to avoid restarting the installation from the USB flash drive, of course, if you forget to reboot to the installation page, shut down the machine after unplugging the USB flash drive and then start up is also OK!
154+
155+
### Wireless Network Configuration
156+
157+
Download the required zip file and shell scripts
158+
159+
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.zip
160+
161+
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.sh
162+
163+
After downloading, unzip the zip file, drag the ```wireless``` folder into the root directory of a new USB flash drive, and the ```wireless.sh``` file has to be put into the root directory as well.
164+
165+
After the flash drive is plugged into the physical machine, you need to mount the flash drive, here sdx1 is the actual path of the flash drive queried by the first command, you need to modify it yourself
166+
167+
```shell
168+
fdisk -l
169+
mount /dev/sdx1 /mnt
170+
```
171+
172+
The ```wireless.zip``` on the USB flash drive should be unzipped and opened to see the deb file.
173+
174+
At this point, run the one-click configuration
175+
176+
```shell
177+
bash /mnt/wireless.sh
178+
```
179+
180+
After the configuration is complete, the system will automatically reboot and the public network will be available after the reboot.
181+
182+
During the execution of the configuration script, you will be prompted to enter the name and password of the WIFI. Since there is no Chinese input method in the pure CI environment, the name of the WIFI must be composed of English numbers only, and the password must be the same.

docs/guide/pve/pve_install.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ outline: deep
1010
低配置的宿主机,建议所有内容安装完毕后,查看```自定义```分区的内容,进行内存调优,减少内存占用。
1111
:::
1212

13-
## 一键安装PVE
13+
## 在非物理机器上进行安装
14+
15+
### 一键安装PVE
1416

1517
:::tip
1618
建议debian12,实测部分独立服务器的debian11系统会出现一重启网络就失联的情况,debian12没有这种问题
@@ -62,7 +64,7 @@ bash install_pve.sh
6264

6365
登录的信息是你SSH的账户和密码
6466

65-
## 预配置环境
67+
### 预配置环境
6668

6769
- 创建资源池mypool(local)
6870
- 移除订阅弹窗
@@ -83,7 +85,7 @@ bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/onecli
8385
bash <(wget -qO- --no-check-certificate https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_backend.sh)
8486
```
8587

86-
## 自动配置宿主机的网关
88+
### 自动配置宿主机的网关
8789

8890
:::warning
8991
**使用前请保证重启过服务器且此时PVE能正常登录进WEB端再执行,重启机器后不要立即执行此命令,待WEB端启动并可登录成功后至少等1分钟再执行本命令**
@@ -125,3 +127,86 @@ bash <(wget -qO- --no-check-certificate https://cdn.spiritlhl.net/https://raw.gi
125127
:::tip
126128
这一步是可能需要你执行成功几分钟后重启系统,详见脚本最后执行完毕的提示,但重启可以保证部分隐藏设置加载成功,有条件务必重启一次服务器
127129
:::
130+
131+
到这一步主体安装完毕。
132+
133+
## 在物理机器上进行安装
134+
135+
本方法未大规模测试和适配,仅作者本人在本地机器上安装了PVE8.4,如有问题对应仓库再开issues
136+
137+
### U盘刻录官方ISO
138+
139+
官方ISO下载地址:
140+
141+
https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso
142+
143+
需要提前下载到本地
144+
145+
同时还需要一个读写速率比较好的U盘,用于制作启动盘,由于启动盘需要使用rufus进行启动盘制作,所以需要U盘格式化,需要确保U盘制作前为空U盘
146+
147+
rufus下载地址(下载到你的本地,不是U盘中):
148+
149+
https://rufus.ie/zh/
150+
151+
152+
153+
https://github.com/pbatard/rufus
154+
155+
刻录需要使用DD方式进行刻录,刻录完毕后U盘原数据会被完全擦除。
156+
157+
### PVE主体安装
158+
159+
查找宿主机本身如何进入BIOS,进入BIOS后修改两处地方
160+
161+
1. 安全启动需要关闭
162+
163+
2. Boot的顺序需要将USB的顺序移动到第一位
164+
165+
然后保存设置,然后插入U盘,重新启动系统,选择使用图形界面进行安装
166+
167+
FQDN需要填写一个网址,可以填写类似 pve.spiritlhl.net 这样的网址,最好是你拥有的域名的一个子域名,不是实际的域名的话写成类似 pve.localsite.com 也行,后续不一定用得到
168+
169+
安装完毕后会自动关机重启,重启黑屏后可以拔掉USB,避免又从U盘重启安装了,当然如果忘了又重启到安装页面了,关闭机器后拔掉U盘再启动也行
170+
171+
### 无线网络配置
172+
173+
下载所需的压缩文件和shell脚本
174+
175+
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.zip
176+
177+
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.sh
178+
179+
下载完成后,解压压缩包,将```wireless```的文件夹拖入一个新的U盘的根目录,同时```wireless.sh```文件也得放到根目录。
180+
181+
U盘插到物理机器后,需要挂载U盘,这里的sdx1是第一条命令查询到的U盘的实际路径,需要自行修改
182+
183+
```shell
184+
fdisk -l
185+
mount /dev/sdx1 /mnt
186+
```
187+
188+
U盘内的```wireless.zip```需要确保已解压,打开可见其中的deb文件
189+
190+
此时直接执行一键配置
191+
192+
```shell
193+
bash /mnt/wireless.sh
194+
```
195+
196+
配置完毕会自动重启系统,重启后会有公共网络
197+
198+
配置脚本执行过程中会提示输入WIFI的名字和密码,由于纯CI环境无中文输入法,WIFI的名字必须仅英文数字组成,密码也是
199+
200+
### 其他相关默认配置
201+
202+
下载脚本,类似上面一步那样导入文件
203+
204+
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/default.sh
205+
206+
使用前务必确保```curl ip.sb```无问题
207+
208+
```shell
209+
bash default.sh
210+
```
211+
212+
执行会非常耗时,但装完后会自带xfce的桌面环境,且换源阿里云,且去除无效订阅,且设置合并local和loacl-lvm,且设置清华镜像容器源

docs/guide/pve/pve_precheck.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ outline: deep
1818

1919
建议debian在使用前尽量使用最新的稳定版本的系统
2020

21-
**警告:本项目仅支持具有独立公网IPv4地址的服务器**
21+
**警告:一键安装PVE仅支持具有独立公网IPv4地址的服务器**
2222

2323
本项目依赖固定的 IPV4 地址进行网络分配,不支持以下情况:
2424

0 commit comments

Comments
 (0)