One-Click Script to Reinstall System 中文
Virtio.Linux to Linux, Linux to Windows, Windows to Windows, Windows to Linux/32, /128, gateway outside subnet, IPv6 only, dual NICThe original system can be any system listed in the table.
The system requirements for the target system are as follows:
| System | Version | Memory | Disk |
|---|---|---|---|
| 3.18, 3.19, 3.20, 3.21 | 256 MB | 1 GB | |
| 9, 10, 11, 12 | 256 MB | 1 ~ 1.5 GB ^ | |
| Rolling | 256 MB | 1 ~ 1.5 GB ^ | |
| 16.04 LTS - 24.04 LTS, 25.04 | 512 MB * | 2 GB | |
| 7, 8, 23 | 512 MB * | 5 GB | |
| 8, 9 | 512 MB * | 5 GB | |
| 8, 9, Stream 23 | 512 MB * | 5 GB | |
| 9, 10 | 512 MB * | 5 GB | |
| 41, 42 | 512 MB * | 5 GB | |
| 20.03 LTS - 24.03 LTS, 25.03 | 512 MB * | 5 GB | |
| Leap 15.6, Tumbleweed (Rolling) | 512 MB * | 5 GB | |
| 24.11 | 512 MB | 5 GB | |
| Rolling | 512 MB | 5 GB | |
| Rolling | 512 MB | 5 GB | |
| Rolling | 512 MB | 5 GB | |
| Beta | 512 MB | 8 GB | |
| Any | 512 MB | Depends on image | |
| Vista, 7, 8.x (Server 2008 - 2012 R2) | 512 MB | 25 GB | |
| 10, 11 (Server 2016 - 2025) | 1 GB | 25 GB |
* Indicates installation using cloud images, not traditional network installation.
^ Indicates requiring either 256 MB memory + 1.5 GB disk, or 512 MB memory + 1 GB disk
[!WARNING] ❌ This script does not support OpenVZ or LXC virtual machines.
Please use https://github.com/LloydAsp/OsMutation instead.
For server outside China:
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh || wget -O reinstall.sh $_
For server inside China:
curl -O https://cnb.cool/bin456789/reinstall/-/git/raw/main/reinstall.sh || wget -O reinstall.sh $_
[!IMPORTANT] Before proceeding, please disable the 'Real-time protection' feature in
Windows Defender. This feature may preventcertutilfrom downloading any files.
Due to lack of support for TLS 1.2, SHA-256, or outdated root certificates, Windows Vista, 7, and Server 2008 (R2) may not be able to download scripts automatically. Manual downloading is required, as follows:
Use Internet Explorer (enable TLS 1.2 in IE's advanced settings first) to download, or use Remote Desktop to save the following two files into the same directory:
To use, run the downloaded reinstall.bat.
For server outside China:
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
For server inside China:
certutil -urlcache -f -split https://cnb.cool/bin456789/reinstall/-/git/raw/main/reinstall.bat
All features can be used on both Linux and Windows.
bash reinstall.sh ...cmd, then run .\reinstall.bat ...
"", not ''.root with a default password of 123@@@.Cloud or HWE kernels.qcow2 image link obtained from https://access.redhat.com/downloads/content/rhel. You can also install other RHEL-based OS, such as Alibaba Cloud Linux and TencentOS Server./etc/ssh/sshd_config.d/.bash reinstall.sh anolis 7|8|23
opencloudos 8|9|23
rocky 8|9
redhat 8|9 --img="http://xxx.com/xxx.qcow2"
oracle 8|9
almalinux 8|9
centos 9|10
fedora 41|42
nixos 24.11
debian 9|10|11|12
opensuse 15.6|tumbleweed
alpine 3.18|3.19|3.20|3.21
openeuler 20.03|22.03|24.03|25.03
ubuntu 16.04|18.04|20.04|22.04|24.04|25.04 [--minimal]
kali
arch
gentoo
aosc
fnos
--password PASSWORD Set the password--ssh-key KEY Set up SSH login public key, supports these formats. When using public key, password is empty.
--ssh-key "ssh-rsa ..."--ssh-key "ssh-ed25519 ..."--ssh-key "ecdsa-sha2-nistp256/384/521 ..."--ssh-key http://path/to/public_key--ssh-key github:your_username--ssh-key gitlab:your_username--ssh-key /path/to/public_key--ssh-key C:\path\to\public_key--ssh-port PORT Change the SSH port (for log observation during installation and for the new system)--web-port PORT Change the Web port (for log observation during installation)--hold 2 Prevent reboot after installation completes, allowing SSH login to modify system content; the system is mounted at /os (this feature is not supported on Debian/Kali).[!TIP] When installing Debian/Kali, x86 architectures can monitor the installation progress through VNC from server provider, while ARM architectures can use the serial console.
When installing other systems, can monitor the progress through various methods (SSH, HTTP 80 port, VNC from server provider, serial console).
Even if errors occur during the installation process, you can still install to Alpine via SSH by running/trans.sh alpine
Install Debian using a cloud image
bash reinstall.sh debian --ci
Install CentOS, AlmaLinux, Rocky, Fedora using ISO
123@@@, and the SSH port is 22; modifying them using parameters is not supported.bash reinstall.sh centos --installer
Install Ubuntu using ISO
123@@@, and the SSH port is 22; modifying them using parameters is not supported.bash reinstall.sh ubuntu --installer
raw and vhd image formats (either uncompressed or compressed as .gz, .xz, .zst, .tar, .tar.gz, .tar.xz, .tar.zst).bash reinstall.sh dd --img "https://example.com/xxx.xz"
--allow-ping Allow ping responses (DD Windows only)--rdp-port PORT Change RDP port (DD Windows only)--ssh-port PORT Change SSH port (for log observation during installation)--web-port PORT Change Web port (for log observation during installation)--hold 2 Prevent reboot after the DD process finishes, allowing SSH login to modify system content. The Windows system will be mounted at /os, but Linux systems will NOT be automatically mounted.[!TIP] Can monitor the progress through various methods (SSH, HTTP 80 port, VNC from server provider, serial console).
Even if errors occur during the installation process, you can still install to Alpine via SSH by running/trans.sh alpine
root, Default password 123@@@bash reinstall.sh alpine --hold=1
--password PASSWORD Set password--ssh-port PORT Change SSH port--ssh-key KEY Set up SSH login public key, supports these formats. When using public key, password is empty.
--ssh-key "ssh-rsa ..."--ssh-key "ssh-ed25519 ..."--ssh-key "ecdsa-sha2-nistp256/384/521 ..."--ssh-key http://path/to/public_key--ssh-key github:your_username--ssh-key gitlab:your_username--ssh-key /path/to/public_key--ssh-key C:\path\to\public_keybash reinstall.sh netboot.xyz

administrator, Default password 123@@@.\administrator.[!CAUTION] The ISO repository currently prohibits direct link downloads, so this method is no longer effective.
bash reinstall.sh windows \
--image-name "Windows 11 Enterprise LTSC 2024" \
--lang zh-cn
ar-sa bg-bg cs-cz da-dk de-de el-gr en-gb en-us es-es es-mx et-ee fi-fi fr-ca fr-fr he-il hr-hr hu-hu it-it ja-jp ko-kr lt-lt lv-lv nb-no nl-nl pl-pl pt-pt pt-br ro-ro ru-ru sk-sk sl-si sr-latn-rs sv-se th-th tr-tr uk-ua zh-cn zh-hk zh-tw
--image-name, you can enter any value. After rebooting, connect via SSH and re-enter the correct value based on the error messages.bash reinstall.sh windows \
--image-name "Windows 11 Enterprise LTSC 2024 Evaluation" \
--iso "https://go.microsoft.com/fwlink/?linkid=2289029"
or Magnet Link
bash reinstall.sh windows \
--image-name "Windows 11 Enterprise LTSC 2024" \
--iso "magnet:?xt=urn:btih:7352bd2db48c3381dffa783763dc75aa4a6f1cff"
--password PASSWORD Set Password--allow-ping Configures the Windows firewall to allow ping requests--rdp-port PORT Change RDP port--ssh-port PORT Change SSH port (for log observation during installation)--web-port PORT Change Web port (for log observation during installation)--add-driver INF_OR_DIR Add additional driver, specifying .inf path, or the folder contains .inf file.
--hold 2 Allow SSH connections for modifying the disk content before rebooting into the official Windows installation program, with the disk mounted at /os.Typically, an ISO will contain multiple system versions, such as Home Edition and Professional Edition. The image name --image-name is used to specify the version to be installed, and it is case-insensitive when entered.
You can use tools like DISM, DISM++, or Wimlib to query the image names included in the ISO.
Commonly used image names include:
Windows 7 Ultimate Windows 11 Pro Windows 11 Enterprise LTSC 2024 Windows Server 2025 SERVERDATACENTER
Open File menu > Open Image File, select the iso to be installed to get the image name (full system name), and all available image names are installable.
[!WARNING] Vista (Server 2008) and 32-bit systems may lack drivers.
[!WARNING] For EFI machines without CSM enabled, Windows 7 (Server 2008 R2) cannot be installed.
Hyper-V (Azure) requires selecting the appropriate VM generation: https://learn.microsoft.com/windows-server/virtualization/hyper-v/plan/should-i-create-a-generation-1-or-2-virtual-machine-in-hyper-v
[!WARNING] In the Chinese version of Windows 10 LTSC 2021 ISO
zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso, thewsappxprocess may indefinitely consume CPU resources.The solution is to update the system patches or manually install the
VCLibslibrary https://www.google.com/search?q=ltsc+wsappx.
Most ARM machines support installing latest Windows 11.
During the installation process, you might encounter a black screen, and the serial console may display ConvertPages: failed to find range, but neither issue affects the installation.
| Compatibility | Cloud Provider | Instance Type | Issues |
|---|---|---|---|
| ✔️ | Azure | B2pts_v2 | |
| ✔️ | Alibaba Cloud | g6r, c6r | |
| ✔️ | Alibaba Cloud | g8y, c8y, r8y | There is a chance of hanging at the boot logo during restart; forced reboot will resolve it. |
| ✔️ | AWS | T4g | |
| ✔️ | Scaleway | COPARM1 | |
| ✔️ | Gcore | ||
| ❔ | Oracle Cloud | A1.Flex | Installation success is not guaranteed; newer instances are more likely to succeed. Manual loading of GPU drivers is required after installation. |
| ❌ | Google Cloud | t2a | Missing network card drivers |
Log in to the server using Remote Desktop, open Device Manager, locate the graphics card, select "Update Driver," and choose Red Hat VirtIO GPU DOD controller from the list. There's no need to download the drivers in advance.
confhome and confhome_cn at the beginning of reinstall.sh and reinstall.bat.Thanks to the following businesses for providing free servers.