reinstall/README.en.md

245 lines
10 KiB
Markdown
Raw Normal View History

2023-12-16 16:41:34 +08:00
# reinstall
[![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-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
One-click reinstallation script
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
[中文](README.md) | English
2023-12-16 16:41:34 +08:00
## Highlights
2024-05-03 21:37:07 +08:00
- Support arbitrary conversion between the following systems (including Windows to Linux).
- Compatible low-spec servers and automatically select the appropriate official slimmed-down kernel.
2024-01-27 23:08:34 +08:00
- Supports installing Windows using the official ISO.
2024-05-03 21:37:07 +08:00
- Automatically detect dynamic/static IPv4/IPv6, eliminating the need to fill in IP/mask/gateway (even for DD/ISO installation of Windows).
- Supports BIOS, EFI, ARM. The original system partition supports LVM, Btrfs.
- Progress of DD and cloud image installation can be viewed through SSH, HTTP port 80, serial console, and vendor backend VNC.
- The script does not include third-party homemade packages; all resources are obtained in real-time from the source site.
2024-01-27 23:08:34 +08:00
- Includes many comments.
2023-12-16 16:41:34 +08:00
2024-05-03 21:37:07 +08:00
## System Requirements
| Target System | Memory | Disk |
| -------------------------------------------------------- | --------- | ---------------------- |
| 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 | Depending on the image |
| Windows 8.1 (Server 2012 R2) or below (ISO installation) | 512 MB | 20~25 GB |
| Windows 10 (Server 2016) or above (ISO installation) | 1G | 20~25 GB |
(\*) Indicates installation using cloud images
(^) indicates requiring either 256 MB memory + 1.5 GB disk, or 512 MB memory + 1 GB disk
2024-01-27 23:08:34 +08:00
## Download (Current system is Linux)
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
For users outside China:
2023-12-16 16:41:34 +08:00
```bash
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
```
2024-01-27 23:08:34 +08:00
For users in China:
2023-12-16 16:41:34 +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-12-16 16:41:34 +08:00
```
2024-01-27 23:08:34 +08:00
## Download (Current system is Windows)
2024-01-28 22:46:38 +08:00
[Unable to download?](#if-the-script-cannot-be-downloaded-under-windows)
Before proceeding, please disable the 'Real-time protection' feature in `Windows Defender`. This feature may prevent `certutil` from downloading any files.
2024-01-27 23:08:34 +08:00
For users outside China:
```batch
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
```
For users in China:
```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
```
## Usage
2024-01-28 22:46:38 +08:00
All features can be used on both Linux and Windows.
- on Linux, execute `bash reinstall.sh`
- on Windows, execute `reinstall.bat`
2024-01-27 23:08:34 +08:00
2024-01-28 22:46:38 +08:00
### Feature 1: Install Linux
2023-12-16 16:41:34 +08:00
2024-04-25 22:43:11 +08:00
- If no version number is entered, the latest version will be installed.
2024-04-27 09:45:10 +08:00
- When installing on a virtual machine, it will automatically select a slimmed-down kernel.
2023-12-16 16:41:34 +08:00
```bash
2024-01-27 23:08:34 +08:00
bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
2024-05-03 23:34:42 +08:00
oracle 7|8|9
2023-12-16 16:41:34 +08:00
alma 8|9
rocky 8|9
2024-04-23 23:34:53 +08:00
fedora 38|39|40
2023-12-16 16:41:34 +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-12-16 16:41:34 +08:00
```
2024-01-28 22:46:38 +08:00
### Feature 2: DD
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
- Supports gzip, xz formats.
- For machines with static IP, DD Windows, and the script will automatically configure the IP.
2023-12-16 16:41:34 +08:00
```bash
2024-01-27 23:08:34 +08:00
bash reinstall.sh dd --img https://example.com/xxx.xz
2023-12-16 16:41:34 +08:00
```
2024-01-28 22:46:38 +08:00
### Feature 3: Reboot to Alpine Rescue System (Live OS)
2024-01-27 23:08:34 +08:00
- Can be connected via SSH to perform manual DD, modify partitions, manually install Arch / Gentoo, etc.
- If the disk content is not modified, rebooting again will return to the original system.
2023-12-16 16:41:34 +08:00
```bash
bash reinstall.sh alpine --hold=1
```
2024-03-01 00:22:04 +08:00
### Feature 4: Reboot to netboot.xyz
2024-01-27 23:08:34 +08:00
2024-05-03 21:37:07 +08:00
- Can install [more systems](https://github.com/netbootxyz/netboot.xyz?tab=readme-ov-file#what-operating-systems-are-currently-available-on-netbootxyz) using vendor backend VNC.
2024-04-06 00:16:10 +08:00
- If the disk content is not modified, rebooting again will return to the original system.
2023-12-16 16:41:34 +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
### Feature 5: Install Windows ISO
2023-12-16 16:41:34 +08:00
2024-02-02 00:49:24 +08:00
- Pay attention to the quotation marks around the parameters
2024-05-03 21:37:07 +08:00
- Supports automatically searching for some ISO links. Need to set the language using `--lang`, default is `en-us`.
2024-02-02 00:49:24 +08:00
2023-12-16 16:41:34 +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
- You can also specify an ISO link.
2024-04-05 22:45:59 +08:00
```bash
bash reinstall.sh windows \
--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-12-16 16:41:34 +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
Parameters Description:
2023-12-16 16:41:34 +08:00
2024-04-05 22:45:59 +08:00
`--image-name` Specify the image to install, case-insensitive, Commonly used images include:
2023-12-16 16:41:34 +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-12-16 16:41:34 +08:00
```
2024-01-27 23:08:34 +08:00
Use `Dism++` File menu > Open Image File, select the iso to be installed to get the image name.
2023-12-16 16:41:34 +08:00
![image-name](https://github.com/bin456789/reinstall/assets/7548515/5aae0a9b-61e2-4f66-bb98-d470a6beaac2)
2024-01-27 23:08:34 +08:00
1. Supported systems:
2024-02-02 00:49:24 +08:00
- Windows Vista to 11
- Windows Server 2008 to 2022, including the following variants
2024-01-27 23:08:34 +08:00
- Windows Server Essentials
- Windows Server Annual Channel
- Hyper-V Server
- Azure Stack HCI
2024-01-28 22:46:38 +08:00
2. The script will install the following drivers as needed:
2024-04-05 22:45:59 +08:00
- KVM ([Virtio](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/))
- 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 Network Adapter](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/enhanced-networking-ena.html), [NVMe Storage Controller](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-nvme-drivers.html))
2024-04-05 22:45:59 +08:00
- GCP ([gVNIC Network Adapter](https://cloud.google.com/compute/docs/networking/using-gvnic), [GGA Graphics](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display))
- Azure ([MANA Network Adapter](https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows))
2024-01-28 22:46:38 +08:00
3. Vista (Server 2008) and 32-bit systems may lack drivers.
2024-03-17 00:08:48 +08:00
4. For EFI machines without CSM enabled, Windows 7 (Server 2008 R2) cannot be installed.
5. If the machine has a static IP, the IP will be automatically set after installation.
6. Can bypass Windows 11 hardware restrictions.
7. Supports Windows 11 on ARM, exclusively for Hyper-V (Azure), not compatible with KVM (Oracle Cloud).
8. The process `wsappx` will occupy CPU for a long time after installing the image `zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso`.
2023-12-16 16:41:34 +08:00
This is an issue with the image, and the solution is to install the `VCLibs` library.
<https://www.google.com/search?q=ltsc+wsappx>
2024-03-17 00:08:48 +08:00
9. The following website provides iso links.
<https://massgrave.dev/genuine-installation-media.html> (Recommended, iso sourced from official channels, updated monthly, includes the latest patches)
2023-12-16 16:41:34 +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> (Need to open it with a mobile User-Agent)
<https://www.microsoft.com/software-download/windows11>
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## Virtualization Requirements
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Not supported on OpenVZ, LXC virtual machines.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Please use <https://github.com/LloydAsp/OsMutation>.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## Default Passwords
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
| System | Username | Password |
| ------------- | -------------- | -------------- |
| Linux | root | 123@@@ |
| Windows (iso) | administrator | 123@@@ |
| Windows (dd) | Image username | Image password |
2023-12-16 16:41:34 +08:00
2024-02-02 00:49:24 +08:00
If encountering a password error during remote login to Windows, try using the username .\administrator.
2024-01-27 23:08:34 +08:00
## If the script cannot be downloaded under Windows
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
You can try the following methods:
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
1. Disable Windows Defender Real-time Protection.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
2. For Windows 7, install this patch to enable TLS 1.2.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
<https://aka.ms/easyfix51044>
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
3. Update SSL root certificates.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
```batch
certutil -generateSSTFromWU root.sst
certutil -addstore Root root.sst
```
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
4. Download manually by copying these two files through `Remote Desktop Connection`.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh>
2023-12-16 16:41:34 +08:00
2024-02-02 00:49:24 +08:00
## Thanks
Thanks to the following businesses for providing free servers.
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/)