Skip to content

Commit db6a6fe

Browse files
committed
feat: 添加qemu和kubevirt的说明
1 parent 0982dc7 commit db6a6fe

24 files changed

+1882
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,27 @@ https://github.com/oneclickvirt/oneclickvirt
6161
[https://github.com/oneclickvirt/lxd](https://github.com/oneclickvirt/lxd)
6262

6363
[![Hits](https://hits.spiritlhl.net/lxd.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
64+
65+
## Containerd相关的各种一键脚本
66+
67+
[https://github.com/oneclickvirt/containerd](https://github.com/oneclickvirt/containerd)
68+
69+
[![Hits](https://hits.spiritlhl.net/containerd.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
70+
71+
## Podman相关的各种一键脚本
72+
73+
[https://github.com/oneclickvirt/podman](https://github.com/oneclickvirt/podman)
74+
75+
[![Hits](https://hits.spiritlhl.net/podman.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
76+
77+
## QEMU相关的各种一键脚本
78+
79+
[https://github.com/oneclickvirt/qemu](https://github.com/oneclickvirt/qemu)
80+
81+
[![Hits](https://hits.spiritlhl.net/qemu.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
82+
83+
## KubeVirt相关的各种一键脚本
84+
85+
[https://github.com/oneclickvirt/kubevirt](https://github.com/oneclickvirt/kubevirt)
86+
87+
[![Hits](https://hits.spiritlhl.net/kubevirt.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)

docs/.vitepress/config.mts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export default defineConfig({
7777
{ text: 'LXD', link: '/guide/lxd/lxd_precheck.html' },
7878
{ text: 'Containerd', link: '/guide/containerd/containerd_precheck.html' },
7979
{ text: 'Podman', link: '/guide/podman/podman_precheck.html' },
80+
{ text: 'QEMU', link: '/guide/qemu/qemu_precheck.html' },
81+
{ text: 'KubeVirt', link: '/guide/kubevirt/kubevirt_precheck.html' },
8082
{ text: '屏蔽滥用', link: '/guide/block/block_iptables.html' },
8183
]
8284
},
@@ -150,6 +152,8 @@ export default defineConfig({
150152
{ text: 'LXD', link: '/en/guide/lxd/lxd_precheck.html' },
151153
{ text: 'Containerd', link: '/en/guide/containerd/containerd_precheck.html' },
152154
{ text: 'Podman', link: '/en/guide/podman/podman_precheck.html' },
155+
{ text: 'QEMU', link: '/en/guide/qemu/qemu_precheck.html' },
156+
{ text: 'KubeVirt', link: '/en/guide/kubevirt/kubevirt_precheck.html' },
153157
{ text: 'Block Abuse', link: '/en/guide/block/block_iptables.html' },
154158
]
155159
},
@@ -310,6 +314,28 @@ function getGuideSidebarZhCN() {
310314
{ text: '常见问题答疑', link: '/guide/podman/podman_qa.html' }
311315
]
312316
},
317+
{
318+
text: 'QEMU',
319+
collapsed: false,
320+
items: [
321+
{ text: '系统和配置要求', link: '/guide/qemu/qemu_precheck.html' },
322+
{ text: 'QEMU主体安装', link: '/guide/qemu/qemu_install.html' },
323+
{ text: 'Linux虚拟机(KVM/QEMU)', link: '/guide/qemu/qemu_build.html' },
324+
{ text: '致谢', link: '/guide/qemu/qemu_thanks.html' },
325+
{ text: '常见问题答疑', link: '/guide/qemu/qemu_qa.html' }
326+
]
327+
},
328+
{
329+
text: 'KubeVirt',
330+
collapsed: false,
331+
items: [
332+
{ text: '系统和配置要求', link: '/guide/kubevirt/kubevirt_precheck.html' },
333+
{ text: 'KubeVirt主体安装', link: '/guide/kubevirt/kubevirt_install.html' },
334+
{ text: 'Linux虚拟机(KVM)', link: '/guide/kubevirt/kubevirt_build.html' },
335+
{ text: '致谢', link: '/guide/kubevirt/kubevirt_thanks.html' },
336+
{ text: '常见问题答疑', link: '/guide/kubevirt/kubevirt_qa.html' }
337+
]
338+
},
313339
{
314340
text: '捐赠',
315341
collapsed: false,
@@ -484,6 +510,28 @@ function getGuideSidebarEnUS() {
484510
{ text: 'FAQ', link: '/en/guide/podman/podman_qa.html' }
485511
]
486512
},
513+
{
514+
text: 'QEMU',
515+
collapsed: false,
516+
items: [
517+
{ text: 'System & configuration requirements', link: '/en/guide/qemu/qemu_precheck.html' },
518+
{ text: 'QEMU main installation', link: '/en/guide/qemu/qemu_install.html' },
519+
{ text: 'Linux Virtual Machine(KVM/QEMU)', link: '/en/guide/qemu/qemu_build.html' },
520+
{ text: 'Acknowledgements', link: '/en/guide/qemu/qemu_thanks.html' },
521+
{ text: 'FAQ', link: '/en/guide/qemu/qemu_qa.html' }
522+
]
523+
},
524+
{
525+
text: 'KubeVirt',
526+
collapsed: false,
527+
items: [
528+
{ text: 'System & configuration requirements', link: '/en/guide/kubevirt/kubevirt_precheck.html' },
529+
{ text: 'KubeVirt main installation', link: '/en/guide/kubevirt/kubevirt_install.html' },
530+
{ text: 'Linux Virtual Machine(KVM)', link: '/en/guide/kubevirt/kubevirt_build.html' },
531+
{ text: 'Acknowledgements', link: '/en/guide/kubevirt/kubevirt_thanks.html' },
532+
{ text: 'FAQ', link: '/en/guide/kubevirt/kubevirt_qa.html' }
533+
]
534+
},
487535
{
488536
text: 'Donation',
489537
collapsed: false,

docs/en/guide/dashboard.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,27 @@ https://github.com/oneclickvirt/oneclickvirt
5353
[https://github.com/oneclickvirt/lxd](https://github.com/oneclickvirt/lxd)
5454

5555
[![Hits](https://hits.spiritlhl.net/lxd.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
56+
57+
## Containerd
58+
59+
[https://github.com/oneclickvirt/containerd](https://github.com/oneclickvirt/containerd)
60+
61+
[![Hits](https://hits.spiritlhl.net/containerd.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
62+
63+
## Podman
64+
65+
[https://github.com/oneclickvirt/podman](https://github.com/oneclickvirt/podman)
66+
67+
[![Hits](https://hits.spiritlhl.net/podman.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
68+
69+
## QEMU
70+
71+
[https://github.com/oneclickvirt/qemu](https://github.com/oneclickvirt/qemu)
72+
73+
[![Hits](https://hits.spiritlhl.net/qemu.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
74+
75+
## KubeVirt
76+
77+
[https://github.com/oneclickvirt/kubevirt](https://github.com/oneclickvirt/kubevirt)
78+
79+
[![Hits](https://hits.spiritlhl.net/kubevirt.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Introduction
6+
7+
Two ways to create virtual machines.
8+
9+
## Create a Single VM
10+
11+
- Creates only one KVM virtual machine (via KubeVirt VirtualMachine resource), automatically detects international or domestic server
12+
- Can configure binding of an independent IPv6 address (requires host to have a public IPv6 address and IPv6 network configured during installation)
13+
- Supports x86_64 and ARM64 architecture servers
14+
15+
### Download Script
16+
17+
International
18+
19+
```shell
20+
wget -q https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/onekubevirt.sh
21+
chmod +x onekubevirt.sh
22+
```
23+
24+
China
25+
26+
```shell
27+
wget -q https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/onekubevirt.sh
28+
chmod +x onekubevirt.sh
29+
```
30+
31+
### Example
32+
33+
Supported variables:
34+
35+
```bash
36+
./onekubevirt.sh <name> <cpu> <memory_mb> <disk_gb> <password> <sshport> <startport> <endport> [independent_ipv6:y/n] [system]
37+
```
38+
39+
Currently supported systems:
40+
41+
- debian
42+
- ubuntu
43+
44+
Default is debian if not specified.
45+
46+
```shell
47+
./onekubevirt.sh vm1 1 1024 10 MyPassword 25000 34975 35000 n debian
48+
```
49+
50+
Example VM details:
51+
52+
| Property | Value |
53+
|----------|-------|
54+
| VM name | vm1 |
55+
| SSH username | root |
56+
| SSH password | MyPassword |
57+
| CPU cores | 1 |
58+
| Memory | 1024MB |
59+
| Disk size | 10GB |
60+
| SSH port | 25000 |
61+
| Port mapping range | 34975 to 35000 |
62+
| System | debian |
63+
| Independent IPv6 | N |
64+
65+
### Related Operations
66+
67+
List all virtual machines
68+
69+
```shell
70+
kubectl get vmi -n default
71+
```
72+
73+
Check VM status
74+
75+
```shell
76+
kubectl get vm vm1 -n default
77+
```
78+
79+
Start a virtual machine
80+
81+
```shell
82+
virtctl start vm1 -n default
83+
```
84+
85+
Stop a virtual machine
86+
87+
```shell
88+
virtctl stop vm1 -n default
89+
```
90+
91+
Access VM serial console
92+
93+
```shell
94+
virtctl console vm1 -n default
95+
```
96+
97+
Press `Ctrl + ]` to exit the console.
98+
99+
Delete example
100+
101+
```shell
102+
kubectl delete vm vm1 -n default
103+
kubectl delete pvc vm1-pvc -n default
104+
```
105+
106+
## Batch Create VMs
107+
108+
- Generates multiple VMs inheriting the same configuration
109+
- Automatically increments VM names (vm1, vm2, ...), SSH ports, and public ports
110+
- VM information is logged to the `vmlog` file
111+
- It is recommended to run in a screen session when creating multiple VMs to avoid SSH disconnection
112+
- Supports x86_64 and ARM64 architecture servers
113+
114+
### Run
115+
116+
International
117+
118+
```shell
119+
wget -q https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/create_kubevirt.sh
120+
chmod +x create_kubevirt.sh
121+
./create_kubevirt.sh
122+
```
123+
124+
China
125+
126+
```shell
127+
wget -q https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/create_kubevirt.sh
128+
chmod +x create_kubevirt.sh
129+
./create_kubevirt.sh
130+
```
131+
132+
### Query Batch Creation Info
133+
134+
```shell
135+
cat vmlog
136+
```
137+
138+
Output format:
139+
140+
```
141+
VM-name SSH-port root-password CPU-cores memory disk start-port end-port
142+
```
143+
144+
One line per VM.
145+
146+
## Delete All VMs and Images
147+
148+
```shell
149+
kubectl delete vm --all -n default
150+
kubectl delete pvc --all -n default
151+
rm -rf vmlog
152+
```
153+
154+
## Recover After Host Reboot
155+
156+
The k3s service starts automatically on boot. After a reboot:
157+
158+
```shell
159+
# Check k3s status
160+
systemctl status k3s
161+
162+
# Check KubeVirt pod status
163+
kubectl get pods -n kubevirt
164+
165+
# Start all stopped VMs
166+
for vm in $(kubectl get vm -n default --no-headers -o custom-columns=':metadata.name'); do
167+
virtctl start "$vm" -n default 2>/dev/null
168+
done
169+
```
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Introduction
6+
7+
Install the KubeVirt environment, including k3s + KubeVirt + network configuration + port forwarding as a complete set.
8+
9+
## Add Swap Memory
10+
11+
:::tip
12+
Adding some swap prevents the host from running out of memory.
13+
:::
14+
15+
Unit conversion: entering 1024 creates 1GB of SWAP virtual memory. Virtual memory uses disk space. When actual memory runs out, virtual memory is used automatically, but this brings high I/O and CPU usage.
16+
17+
It is recommended to create swap no larger than twice the actual memory size.
18+
19+
International
20+
21+
```shell
22+
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
23+
```
24+
25+
China
26+
27+
```shell
28+
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
29+
```
30+
31+
## Environment Installation
32+
33+
- Supported OS: Debian 11+, Ubuntu 20.04+
34+
- Automatically installs k3s (lightweight Kubernetes)
35+
- Automatically deploys KubeVirt operator and CDI (Containerized Data Importer)
36+
- Automatically configures Flannel network plugin and port forwarding
37+
- Automatically detects public IPv6 address and configures IPv6 network (if present)
38+
- Supports x86_64 and ARM64 architecture servers
39+
40+
International
41+
42+
```shell
43+
bash <(wget -qO- https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/kubevirtinstall.sh)
44+
```
45+
46+
China
47+
48+
```shell
49+
bash <(wget -qO- https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/kubevirtinstall.sh)
50+
```
51+
52+
:::tip
53+
After installation, it is recommended to run `kubectl get pods -n kubevirt` to verify that the KubeVirt environment is working correctly. All Pods should be in `Running` state.
54+
:::
55+
56+
:::warning
57+
The k3s + KubeVirt installation takes some time (usually 5–15 minutes). Please run it inside a screen or tmux session to avoid installation failure due to SSH disconnection.
58+
:::
59+
60+
## Uninstall KubeVirt Environment
61+
62+
One-click uninstall of the complete environment, including all virtual machines, k3s, KubeVirt, and auxiliary files:
63+
64+
International
65+
66+
```shell
67+
bash <(wget -qO- https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/kubevirtuninstall.sh)
68+
```
69+
70+
China
71+
72+
```shell
73+
bash <(wget -qO- https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/kubevirt/main/scripts/kubevirtuninstall.sh)
74+
```
75+
76+
:::warning
77+
The script will require you to enter `yes` to confirm before execution. This operation is irreversible. Content deleted includes all virtual machines, images, k3s and all KubeVirt components.
78+
Reset procedure: run uninstall first, then run install again to verify the entire installation process from scratch.
79+
:::

0 commit comments

Comments
 (0)