https://github.com/lloydasp/osmutation
Reinstall Any OpenVZ/LXC VPS to Debian/CentOS/Alpine
https://github.com/lloydasp/osmutation
alpine container lxc openvz openvz7 reinstall
Last synced: 2 months ago
JSON representation
Reinstall Any OpenVZ/LXC VPS to Debian/CentOS/Alpine
- Host: GitHub
- URL: https://github.com/lloydasp/osmutation
- Owner: LloydAsp
- License: gpl-3.0
- Created: 2023-04-27T10:59:26.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-30T22:31:18.000Z (3 months ago)
- Last Synced: 2026-04-03T00:38:45.376Z (3 months ago)
- Topics: alpine, container, lxc, openvz, openvz7, reinstall
- Language: Shell
- Homepage: https://www.nodeseek.com/post-5159-1
- Size: 43.9 KB
- Stars: 774
- Watchers: 3
- Forks: 134
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OsMutation
Reinstall Any OpenVZ/LXC VPS to Debian/CentOS/Alpine
## Features
- Support both OpenVZ 7 and LXC
- Support reinstall to multiple operating systems
## Usage
```
wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutation.sh && chmod u+x OsMutation.sh && ./OsMutation.sh
```
or
```
curl -so OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutation.sh && chmod u+x OsMutation.sh && ./OsMutation.sh
```
for vps whose disk is small (less than 1GiB, experimental support)
```
wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutationTight.sh && chmod u+x OsMutation.sh && ./OsMutation.sh
```
[](https://asciinema.org/a/582009)
## Notice
- A fresh system will be installed and all old data will be wiped! Backup your important data first.
- OpenVZ 7 and above is support, not OpenVZ 6.
- Virtual Machine is not supported, such as kvm, xen and vmware
## How Does This work
Openvz and Lxc are typical container virtualization technologys. The host OS kernel is shared with both the host and other containers, and all the applications and runtime libraries required by os are packed together in container itself.
So if you want to replace the operating system, you can just replace the files in the container. That's it, simple and straightforward. Just pay attention to the order of action since there are some dependences of files.
## Template Sources
LXC templates are directly downloaded from http://images.linuxcontainers.org, OpenVZ 7 templates are extracted from OpenVZ 7 official iso.
## Thanks To
- Inspired by https://gist.github.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d
## To Do
- Support non-interactive mode by accepting arguments
- Support customed template source
- Support more operating system
- Fix networking bug of CentOS under LXC
- Auto configure ipv6 network