mirror of
https://github.com/oneclickvirt/oneclickvirt.github.io.git
synced 2026-05-31 15:49:46 +08:00
fix: 添加物理机器无线网络的一键脚本
This commit is contained in:
@@ -10,7 +10,9 @@ If you don't know how to choose an option during installation, just press enter.
|
||||
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.
|
||||
:::
|
||||
|
||||
## One-click PVE installation
|
||||
## Installation on non-physical machines
|
||||
|
||||
### One-click PVE installation
|
||||
|
||||
:::tip
|
||||
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!
|
||||
@@ -18,25 +20,25 @@ Suggest debian12, the actual test part of the independent server debian11 system
|
||||
|
||||
- The installation is the latest PVE from the apt source at the moment.
|
||||
- For example, debian10 is pve6.4, debian11 is pve7.x, debian12 is pve8.x
|
||||
- Changes to the ``/etc/hosts`` file (to fix the wrong hostname setting for merchants and to add the required content for PVE)
|
||||
- ``/etc/cloud/cloud.cfg`` file modification (to avoid overwriting modified hostname etc.)
|
||||
- ``/etc/network/interfaces`` file modification (fix auto, dhcp type to static, add vmbr0 gateway)
|
||||
- Changes to the ```/etc/hosts``` file (to fix the wrong hostname setting for merchants and to add the required content for PVE)
|
||||
- ```/etc/cloud/cloud.cfg``` file modification (to avoid overwriting modified hostname etc.)
|
||||
- ```/etc/network/interfaces``` file modification (fix auto, dhcp type to static, add vmbr0 gateway)
|
||||
- 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
|
||||
- Create vmbr0 (independent IP gateway), the host allows addr and gateway for intranet IP or extranet IP, has been automatically recognized
|
||||
- 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
|
||||
- Installation of the necessary toolkit for PVE to open a virtual machine
|
||||
- x86_64 replace enterprise subscriptions in apt sources with community sources, arm sources built using third-party patches for fixes
|
||||
- Print query Linux system kernel and PVE kernel installed or not
|
||||
- Setting up DNS detection ``8.8.8.8.8`` for boot add DNS systemd service
|
||||
- Setting up DNS detection ```8.8.8.8.8``` for boot add DNS systemd service
|
||||
- Download PVE and printout of login information after adding APT source link for PVE
|
||||
|
||||
All modified files have been set to read-only mode to avoid overwriting after reboot.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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**.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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```.
|
||||
|
||||
@@ -58,14 +60,14 @@ After successful installation, the web page may not be safe to open, click on Ad
|
||||
|
||||
The login information is your SSH account and password.
|
||||
|
||||
## Pre-configure the environment
|
||||
### Pre-configure the environment
|
||||
|
||||
- Creating a resource pool mypool
|
||||
- Remove the subscription popup
|
||||
- Attempt to enable hardware passthrough
|
||||
- Detect and auto-install AppArmor modules.
|
||||
- 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.
|
||||
- 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!
|
||||
- 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!
|
||||
|
||||
Command:
|
||||
|
||||
@@ -73,7 +75,7 @@ Command:
|
||||
bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_backend.sh)
|
||||
```
|
||||
|
||||
## Automatically configure the host's gateway
|
||||
### Automatically configure the host's gateway
|
||||
|
||||
:::warning
|
||||
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
|
||||
- If vmbr0 is not created, it is automatically created with the same logic as the main installation
|
||||
- Create vmbr1 (NAT gateway) to support IPV4 servers that open NAT for IPV6 networks with NAT.
|
||||
- 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.
|
||||
- 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!
|
||||
- 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!
|
||||
- Load iptables and set back to source and allow NAT port forwarding.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
Command:
|
||||
|
||||
@@ -109,3 +111,72 @@ bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/onecli
|
||||
:::tip
|
||||
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.
|
||||
:::
|
||||
|
||||
To this point the main body is installed.
|
||||
|
||||
## Installation on a physical machine
|
||||
|
||||
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
|
||||
|
||||
### U disk burning official ISO
|
||||
|
||||
Official ISO download address:
|
||||
|
||||
https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso
|
||||
|
||||
You need to download it locally in advance.
|
||||
|
||||
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
|
||||
|
||||
rufus download address (download to your local, not USB flash drive):
|
||||
|
||||
https://rufus.ie/zh/
|
||||
|
||||
or
|
||||
|
||||
https://github.com/pbatard/rufus
|
||||
|
||||
Burning needs to use DD method to burn, the original data of the USB flash disk will be completely erased after burning.
|
||||
|
||||
### PVE installation
|
||||
|
||||
Find out how to get into the BIOS on the host itself, and modify two things after entering the BIOS
|
||||
|
||||
1. Safe boot needs to be turned off
|
||||
|
||||
2. the order of the boot needs to be moved to the first USB order
|
||||
|
||||
Then save the settings, then insert the USB flash drive, reboot the system, and choose to use the graphical interface for installation.
|
||||
|
||||
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!
|
||||
|
||||
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!
|
||||
|
||||
### Wireless Network Configuration
|
||||
|
||||
Download the required zip file and shell scripts
|
||||
|
||||
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.zip
|
||||
|
||||
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.sh
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
```shell
|
||||
fdisk -l
|
||||
mount /dev/sdx1 /mnt
|
||||
```
|
||||
|
||||
The ```wireless.zip``` on the USB flash drive should be unzipped and opened to see the deb file.
|
||||
|
||||
At this point, run the one-click configuration
|
||||
|
||||
```shell
|
||||
bash /mnt/wireless.sh
|
||||
```
|
||||
|
||||
After the configuration is complete, the system will automatically reboot and the public network will be available after the reboot.
|
||||
|
||||
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.
|
||||
@@ -10,7 +10,9 @@ outline: deep
|
||||
低配置的宿主机,建议所有内容安装完毕后,查看```自定义```分区的内容,进行内存调优,减少内存占用。
|
||||
:::
|
||||
|
||||
## 一键安装PVE
|
||||
## 在非物理机器上进行安装
|
||||
|
||||
### 一键安装PVE
|
||||
|
||||
:::tip
|
||||
建议debian12,实测部分独立服务器的debian11系统会出现一重启网络就失联的情况,debian12没有这种问题
|
||||
@@ -62,7 +64,7 @@ bash install_pve.sh
|
||||
|
||||
登录的信息是你SSH的账户和密码
|
||||
|
||||
## 预配置环境
|
||||
### 预配置环境
|
||||
|
||||
- 创建资源池mypool(local)
|
||||
- 移除订阅弹窗
|
||||
@@ -83,7 +85,7 @@ bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/onecli
|
||||
bash <(wget -qO- --no-check-certificate https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_backend.sh)
|
||||
```
|
||||
|
||||
## 自动配置宿主机的网关
|
||||
### 自动配置宿主机的网关
|
||||
|
||||
:::warning
|
||||
**使用前请保证重启过服务器且此时PVE能正常登录进WEB端再执行,重启机器后不要立即执行此命令,待WEB端启动并可登录成功后至少等1分钟再执行本命令**
|
||||
@@ -125,3 +127,86 @@ bash <(wget -qO- --no-check-certificate https://cdn.spiritlhl.net/https://raw.gi
|
||||
:::tip
|
||||
这一步是可能需要你执行成功几分钟后重启系统,详见脚本最后执行完毕的提示,但重启可以保证部分隐藏设置加载成功,有条件务必重启一次服务器
|
||||
:::
|
||||
|
||||
到这一步主体安装完毕。
|
||||
|
||||
## 在物理机器上进行安装
|
||||
|
||||
本方法未大规模测试和适配,仅作者本人在本地机器上安装了PVE8.4,如有问题对应仓库再开issues
|
||||
|
||||
### U盘刻录官方ISO
|
||||
|
||||
官方ISO下载地址:
|
||||
|
||||
https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso
|
||||
|
||||
需要提前下载到本地
|
||||
|
||||
同时还需要一个读写速率比较好的U盘,用于制作启动盘,由于启动盘需要使用rufus进行启动盘制作,所以需要U盘格式化,需要确保U盘制作前为空U盘
|
||||
|
||||
rufus下载地址(下载到你的本地,不是U盘中):
|
||||
|
||||
https://rufus.ie/zh/
|
||||
|
||||
或
|
||||
|
||||
https://github.com/pbatard/rufus
|
||||
|
||||
刻录需要使用DD方式进行刻录,刻录完毕后U盘原数据会被完全擦除。
|
||||
|
||||
### PVE主体安装
|
||||
|
||||
查找宿主机本身如何进入BIOS,进入BIOS后修改两处地方
|
||||
|
||||
1. 安全启动需要关闭
|
||||
|
||||
2. Boot的顺序需要将USB的顺序移动到第一位
|
||||
|
||||
然后保存设置,然后插入U盘,重新启动系统,选择使用图形界面进行安装
|
||||
|
||||
FQDN需要填写一个网址,可以填写类似 pve.spiritlhl.net 这样的网址,最好是你拥有的域名的一个子域名,不是实际的域名的话写成类似 pve.localsite.com 也行,后续不一定用得到
|
||||
|
||||
安装完毕后会自动关机重启,重启黑屏后可以拔掉USB,避免又从U盘重启安装了,当然如果忘了又重启到安装页面了,关闭机器后拔掉U盘再启动也行
|
||||
|
||||
### 无线网络配置
|
||||
|
||||
下载所需的压缩文件和shell脚本
|
||||
|
||||
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.zip
|
||||
|
||||
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/wireless.sh
|
||||
|
||||
下载完成后,解压压缩包,将```wireless```的文件夹拖入一个新的U盘的根目录,同时```wireless.sh```文件也得放到根目录。
|
||||
|
||||
U盘插到物理机器后,需要挂载U盘,这里的sdx1是第一条命令查询到的U盘的实际路径,需要自行修改
|
||||
|
||||
```shell
|
||||
fdisk -l
|
||||
mount /dev/sdx1 /mnt
|
||||
```
|
||||
|
||||
U盘内的```wireless.zip```需要确保已解压,打开可见其中的deb文件
|
||||
|
||||
此时直接执行一键配置
|
||||
|
||||
```shell
|
||||
bash /mnt/wireless.sh
|
||||
```
|
||||
|
||||
配置完毕会自动重启系统,重启后会有公共网络
|
||||
|
||||
配置脚本执行过程中会提示输入WIFI的名字和密码,由于纯CI环境无中文输入法,WIFI的名字必须仅英文数字组成,密码也是
|
||||
|
||||
### 其他相关默认配置
|
||||
|
||||
下载脚本,类似上面一步那样导入文件
|
||||
|
||||
https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/refs/heads/main/extra_scripts/wireless/default.sh
|
||||
|
||||
使用前务必确保```curl ip.sb```无问题
|
||||
|
||||
```shell
|
||||
bash default.sh
|
||||
```
|
||||
|
||||
执行会非常耗时,但装完后会自带xfce的桌面环境,且换源阿里云,且去除无效订阅,且设置合并local和loacl-lvm,且设置清华镜像容器源
|
||||
@@ -18,7 +18,7 @@ outline: deep
|
||||
|
||||
建议debian在使用前尽量使用最新的稳定版本的系统
|
||||
|
||||
**警告:本项目仅支持具有独立公网IPv4地址的服务器**
|
||||
**警告:一键安装PVE仅支持具有独立公网IPv4地址的服务器**
|
||||
|
||||
本项目依赖固定的 IPV4 地址进行网络分配,不支持以下情况:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user