2023-05-17 22:54:26 +08:00
|
|
|
|
# reinstall
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-12-04 22:19:59 +08:00
|
|
|
|
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/dc679a17751448628fe6d8ac35e26eed)](https://app.codacy.com/gh/bin456789/reinstall/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
|
|
|
[![CodeFactor](https://www.codefactor.io/repository/github/bin456789/reinstall/badge)](https://www.codefactor.io/repository/github/bin456789/reinstall)
|
2024-01-27 23:08:34 +08:00
|
|
|
|
[![Lines of Code](https://tokei.rs/b1/github/bin456789/reinstall?category=code&style=flat)](https://github.com/XAMPPRocky/tokei_rs)
|
2023-12-04 22:19:59 +08:00
|
|
|
|
|
2023-12-16 16:41:34 +08:00
|
|
|
|
一键重装脚本
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
中文 | [English](README.en.md)
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
## 亮点
|
|
|
|
|
|
2024-05-03 21:37:07 +08:00
|
|
|
|
- 支持以下系统任意转换(包括 Windows 转 Linux)
|
|
|
|
|
- 适配低配小鸡,并自动选择合适的官方精简内核
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 支持用官方 iso 安装 Windows
|
2024-05-03 21:37:07 +08:00
|
|
|
|
- 自动判断动静态 IPv4 / IPv6,无需填写 IP / 掩码 / 网关(即使是 DD / ISO 安装 Windows)
|
|
|
|
|
- 支持 BIOS、EFI、ARM,原系统分区支持 lvm、btrfs
|
|
|
|
|
- 可通过 SSH、HTTP 80 端口、串行控制台、商家后台 VNC 查看 DD、云镜像安装进度
|
|
|
|
|
- 不含第三方自制包,所有资源均实时从源站点获得
|
2023-08-12 21:11:46 +08:00
|
|
|
|
- 有很多注释
|
|
|
|
|
|
2024-05-03 21:37:07 +08:00
|
|
|
|
## 配置要求
|
|
|
|
|
|
|
|
|
|
| 目标系统 | 内存 | 硬盘 |
|
|
|
|
|
| ---------------------------------------------- | --------- | ---------- |
|
|
|
|
|
| Alpine | 256 MB | 1 GB |
|
|
|
|
|
| Debian / Kali | 256 MB | 1~1.5 GB ^ |
|
|
|
|
|
| Ubuntu | 512 MB \* | 2 GB |
|
2024-05-03 23:34:42 +08:00
|
|
|
|
| CentOS / Alma / Rocky / Oracle | 512 MB \* | 5 GB |
|
2024-05-03 21:37:07 +08:00
|
|
|
|
| Fedora | 512 MB \* | 5 GB |
|
|
|
|
|
| openSUSE | 512 MB \* | 5 GB |
|
|
|
|
|
| Arch | 512 MB | 5 GB |
|
|
|
|
|
| Gentoo | 512 MB | 5 GB |
|
|
|
|
|
| DD | 512 MB | 取决于镜像 |
|
|
|
|
|
| Windows 8.1 (Server 2012 R2) 或以下 (ISO 安装) | 512 MB | 20~25 GB |
|
|
|
|
|
| Windows 10 (Server 2016) 或以上 (ISO 安装) | 1024 MB | 20~25 GB |
|
|
|
|
|
|
|
|
|
|
(\*) 表示使用云镜像安装
|
|
|
|
|
|
|
|
|
|
(^) 需要 256 MB 内存 + 1.5 GB 硬盘,或 512 MB 内存 + 1 GB 硬盘
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 下载(当前系统是 Linux)
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
国外:
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
|
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
国内:
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
2024-04-06 00:16:10 +08:00
|
|
|
|
curl -O https://mirror.ghproxy.com/https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 下载(当前系统是 Windows)
|
|
|
|
|
|
2024-01-28 22:46:38 +08:00
|
|
|
|
[无法下载?](#如果-windows-下无法下载脚本)
|
|
|
|
|
|
|
|
|
|
请先关闭 `Windows Defender` 的 `实时保护` 功能。该功能会阻止 `certutil` 下载任何文件
|
2024-01-27 23:08:34 +08:00
|
|
|
|
|
|
|
|
|
国外:
|
|
|
|
|
|
|
|
|
|
```batch
|
|
|
|
|
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
国内:
|
|
|
|
|
|
|
|
|
|
```batch
|
2024-04-06 00:16:10 +08:00
|
|
|
|
certutil -urlcache -f -split https://mirror.ghproxy.com/https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
|
2024-01-27 23:08:34 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 使用
|
|
|
|
|
|
2024-01-28 22:46:38 +08:00
|
|
|
|
所有功能均可在 Linux / Windows 下使用
|
|
|
|
|
|
|
|
|
|
- Linux 下运行 `bash reinstall.sh`
|
|
|
|
|
- Windows 下运行 `reinstall.bat`
|
2024-01-27 23:08:34 +08:00
|
|
|
|
|
2024-01-28 22:46:38 +08:00
|
|
|
|
### 功能 1: 安装 Linux
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-04-25 22:43:11 +08:00
|
|
|
|
- 不输入版本号,则安装最新版
|
2024-04-27 09:45:10 +08:00
|
|
|
|
- 在虚拟机上,会自动安装精简内核
|
2023-12-04 22:19:59 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
2024-05-03 23:34:42 +08:00
|
|
|
|
oracle 7|8|9
|
2023-10-22 23:02:48 +08:00
|
|
|
|
alma 8|9
|
|
|
|
|
rocky 8|9
|
2024-04-23 23:34:53 +08:00
|
|
|
|
fedora 38|39|40
|
2023-10-22 23:02:48 +08:00
|
|
|
|
debian 10|11|12
|
2024-03-17 00:08:48 +08:00
|
|
|
|
opensuse 15.5|tumbleweed
|
2024-04-25 22:24:46 +08:00
|
|
|
|
ubuntu 20.04|22.04|24.04
|
2024-03-31 00:32:05 +08:00
|
|
|
|
alpine 3.16|3.17|3.18|3.19
|
2024-05-03 21:37:07 +08:00
|
|
|
|
kali
|
2024-03-31 00:32:05 +08:00
|
|
|
|
arch
|
2024-03-28 00:16:05 +08:00
|
|
|
|
gentoo
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-28 22:46:38 +08:00
|
|
|
|
### 功能 2: DD
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 支持 gzip、xz 格式
|
|
|
|
|
- 静态 IP 的机器 DD Windows,会自动配置好 IP
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
2024-01-27 23:08:34 +08:00
|
|
|
|
bash reinstall.sh dd --img https://example.com/xxx.xz
|
2023-11-04 14:37:22 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-01-28 22:46:38 +08:00
|
|
|
|
### 功能 3: 重启到 Alpine 救援系统 (Live OS)
|
2023-11-09 23:23:33 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 可用 ssh 连接,进行手动 DD、修改分区、手动安装 Arch / Gentoo 等操作
|
|
|
|
|
- 如果没有修改硬盘内容,再次重启将回到原系统
|
2023-11-09 23:23:33 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh alpine --hold=1
|
|
|
|
|
```
|
|
|
|
|
|
2024-03-01 00:22:04 +08:00
|
|
|
|
### 功能 4: 重启到 netboot.xyz
|
2024-01-27 23:08:34 +08:00
|
|
|
|
|
2024-05-03 21:37:07 +08:00
|
|
|
|
- 可使用商家后台 VNC 安装 [更多系统](https://github.com/netbootxyz/netboot.xyz?tab=readme-ov-file#what-operating-systems-are-currently-available-on-netbootxyz)
|
2024-04-06 00:16:10 +08:00
|
|
|
|
- 如果没有修改硬盘内容,再次重启将回到原系统
|
2023-11-09 23:23:33 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh netboot.xyz
|
|
|
|
|
```
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
![netboot.xyz](https://netboot.xyz/images/netboot.xyz.gif)
|
|
|
|
|
|
2024-01-28 22:46:38 +08:00
|
|
|
|
### 功能 5: 安装 Windows ISO
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-02-02 00:49:24 +08:00
|
|
|
|
- 注意参数两边的引号
|
2024-05-03 21:37:07 +08:00
|
|
|
|
- 支持自动查找部分 iso 链接,需设置语言 `--lang`,默认 `en-us`
|
2024-02-02 00:49:24 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh windows \
|
2024-04-05 22:45:59 +08:00
|
|
|
|
--image-name 'Windows 10 Enterprise LTSC 2021' \
|
2024-05-03 21:37:07 +08:00
|
|
|
|
--lang zh-cn
|
2024-04-05 22:45:59 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-05-03 21:37:07 +08:00
|
|
|
|
- 也可以指定 iso 链接
|
2024-04-05 22:45:59 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh windows \
|
2024-04-10 21:41:46 +08:00
|
|
|
|
--image-name 'Windows 10 Enterprise LTSC 2021' \
|
2024-05-03 21:37:07 +08:00
|
|
|
|
--iso 'https://drive.massgrave.dev/en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso'
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-02-02 00:49:24 +08:00
|
|
|
|
![Installing Windows](https://github.com/bin456789/reinstall/assets/7548515/07c1aea2-1ce3-4967-904f-aaf9d6eec3f7)
|
2024-01-27 23:08:34 +08:00
|
|
|
|
|
2024-04-05 22:45:59 +08:00
|
|
|
|
参数说明:
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-04-05 22:45:59 +08:00
|
|
|
|
`--image-name` 指定要安装的映像,不区分大小写,常用映像有:
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-11-04 14:37:22 +08:00
|
|
|
|
```text
|
2024-02-02 00:49:24 +08:00
|
|
|
|
Windows 7 Ultimate
|
|
|
|
|
Windows 10 Enterprise LTSC 2021
|
|
|
|
|
Windows 11 Pro
|
|
|
|
|
Windows Server 2022 SERVERDATACENTER
|
2023-11-01 22:19:48 +08:00
|
|
|
|
```
|
|
|
|
|
|
2023-11-04 14:37:22 +08:00
|
|
|
|
使用 `Dism++` 文件菜单 > 打开映像文件,选择要安装的 iso,可以得到映像名称
|
|
|
|
|
|
|
|
|
|
![image-name](https://github.com/bin456789/reinstall/assets/7548515/5aae0a9b-61e2-4f66-bb98-d470a6beaac2)
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
1. 支持的系统:
|
2024-04-05 22:45:59 +08:00
|
|
|
|
- Windows Vista 到 11
|
|
|
|
|
- Windows Server 2008 到 2022,包括以下衍生版
|
|
|
|
|
- Windows Server Essentials
|
|
|
|
|
- Windows Server Annual Channel
|
|
|
|
|
- Hyper-V Server
|
|
|
|
|
- Azure Stack HCI
|
2024-01-28 22:46:38 +08:00
|
|
|
|
2. 脚本会按需安装以下驱动:
|
2024-04-05 22:45:59 +08:00
|
|
|
|
- KVM ([Virtio](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/))
|
2024-04-16 23:34:28 +08:00
|
|
|
|
- XEN ([XEN](https://xenproject.org/windows-pv-drivers/)、[Citrix](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Upgrading_PV_drivers.html#win2008-citrix-upgrade)、[AWS](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/xen-drivers-overview.html))
|
|
|
|
|
- AWS ([ENA 网卡](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/enhanced-networking-ena.html)、[NVME 存储控制器](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-nvme-drivers.html))
|
2024-04-05 22:45:59 +08:00
|
|
|
|
- GCP ([gVNIC 网卡](https://cloud.google.com/compute/docs/networking/using-gvnic)、[GGA 显卡](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display))
|
2024-04-16 23:34:28 +08:00
|
|
|
|
- Azure ([MANA 网卡](https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows))
|
2024-01-28 22:46:38 +08:00
|
|
|
|
3. Vista (Server 2008) 和 32 位系统可能会缺少驱动
|
2024-03-17 00:08:48 +08:00
|
|
|
|
4. 未开启 CSM 的 EFI 机器,无法安装 Windows 7 (Server 2008 R2)
|
|
|
|
|
5. 静态 IP 的机器,安装后会自动配置好 IP
|
|
|
|
|
6. 可绕过 Windows 11 硬件限制
|
|
|
|
|
7. 支持 Windows 11 on ARM,仅限 Hyper-V (Azure) ,不支持 KVM (甲骨文云)
|
|
|
|
|
8. `zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso` 此镜像安装后 `wsappx` 进程会长期占用 CPU
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
|
|
|
|
这是镜像的问题,解决方法是安装 `VCLibs` 库
|
|
|
|
|
|
|
|
|
|
<https://www.google.com/search?q=ltsc+wsappx>
|
|
|
|
|
|
2024-03-17 00:08:48 +08:00
|
|
|
|
9. 以下网站可找到 iso 链接
|
|
|
|
|
|
|
|
|
|
<https://massgrave.dev/genuine-installation-media.html> (推荐,iso 来自官方,每月更新,包含最新补丁)
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-04-05 22:45:59 +08:00
|
|
|
|
<https://www.microsoft.com/software-download/windows8>
|
|
|
|
|
|
2024-03-17 00:08:48 +08:00
|
|
|
|
<https://www.microsoft.com/software-download/windows10> (需用手机 User-Agent 打开)
|
|
|
|
|
|
|
|
|
|
<https://www.microsoft.com/software-download/windows11>
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 虚拟化要求
|
2023-07-06 22:52:18 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
不支持 OpenVZ、LXC 虚拟机
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
请使用 <https://github.com/LloydAsp/OsMutation>
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 默认密码
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
| 系统 | 用户名 | 密码 |
|
|
|
|
|
| ------------- | ------------- | -------- |
|
|
|
|
|
| Linux | root | 123@@@ |
|
|
|
|
|
| Windows (iso) | administrator | 123@@@ |
|
|
|
|
|
| Windows (dd) | 镜像用户名 | 镜像密码 |
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-02-02 00:49:24 +08:00
|
|
|
|
如果远程登录 Windows 提示密码错误,尝试用户名 `.\administrator`
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 如果 Windows 下无法下载脚本
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
可尝试以下几种方法
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
1. 关闭 Windows Defender 实时保护
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
2. Windows 7 安装此补丁启用 TLS 1.2
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
<https://aka.ms/easyfix51044>
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
3. 更新 SSL 根证书
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
```batch
|
|
|
|
|
certutil -generateSSTFromWU root.sst
|
|
|
|
|
certutil -addstore Root root.sst
|
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
4. 手动下载,通过 `远程桌面` 复制这两个文件
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh>
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-02-02 00:49:24 +08:00
|
|
|
|
## 感谢
|
|
|
|
|
|
|
|
|
|
感谢以下商家提供白嫖机器
|
2024-01-19 11:55:35 +08:00
|
|
|
|
|
2024-02-02 00:49:24 +08:00
|
|
|
|
[![Oracle Cloud](https://github.com/bin456789/reinstall/assets/7548515/8b430ed4-8344-4f96-b4da-c2bda031cc90)](https://www.oracle.com/cloud/)
|
2024-03-01 00:22:04 +08:00
|
|
|
|
[![DartNode](https://github.com/bin456789/reinstall/assets/7548515/435d6740-bcdd-4f3a-a196-2f60ae397f17)](https://dartnode.com/)
|