mirror of
https://github.com/oneclickvirt/oneclickvirt.github.io.git
synced 2026-06-09 00:10:16 +08:00
Update lxd_lxc.md
This commit is contained in:
@@ -41,24 +41,23 @@ Support for customizing the system of the chicken, do not fill out the default u
|
||||
The version number has ended the long-term maintenance of the general no longer have an official mirror, temporarily did not find the archive address of the historical mirror, if you find welcome to leave a message I will add support!
|
||||
:::
|
||||
|
||||
#### 示例
|
||||
#### Example
|
||||
|
||||
以下为开设的示例小鸡的信息:
|
||||
|
||||
| 属性 | 值 |
|
||||
|---------------------------|----------------|
|
||||
| 小鸡名字 | test |
|
||||
| SSH登录的用户名 | root |
|
||||
| SSH登录的密码 | 随机生成 |
|
||||
| CPU核数 | 1 |
|
||||
| 内存大小 | 256MB |
|
||||
| 磁盘大小 | 2G |
|
||||
| 内外网映射端口一致的区间 | 20002到20025 |
|
||||
| 上传带宽 | 500Mbit |
|
||||
| 下载带宽 | 500Mbit |
|
||||
| 自动设置外网IPV6地址 | N |
|
||||
| 系统 | debian11 |
|
||||
Here is the information about the example chick that is being raised:
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------------------------|-----------------|
|
||||
| Chicken's Name | test |
|
||||
| Username for SSH Login | root |
|
||||
| Password for SSH Login | Randomly generated |
|
||||
| Number of CPU Cores | 1 |
|
||||
| Memory Size | 256MB |
|
||||
| Disk Size | 2G |
|
||||
| Range of Internal and External Port Mapping | 20002 to 20025 |
|
||||
| Upload Bandwidth | 500Mbit |
|
||||
| Download Bandwidth | 500Mbit |
|
||||
| Automatically Set External IPv6 Address | No |
|
||||
| Operating System | Debian 11 |
|
||||
|
||||
```
|
||||
./buildone.sh test 256 2 20001 20002 20025 500 500 N
|
||||
@@ -67,7 +66,7 @@ The version number has ended the long-term maintenance of the general no longer
|
||||
If you need to see the information, run
|
||||
|
||||
```shell
|
||||
cat 小鸡名字
|
||||
cat ct_name_change_me
|
||||
```
|
||||
|
||||
For example, the information for the query example is
|
||||
@@ -144,12 +143,12 @@ The last line of the following command opens **10** chicks with the chick name p
|
||||
|
||||
Sometimes there is a problem with the path where last.sh is run, in this case it is recommended to force the root directory to run by adding sudo in front of it.
|
||||
|
||||
## 自定义批量生成版本
|
||||
## Custom Batch Generation of Versions
|
||||
|
||||
- 可自定义内存和硬盘大小
|
||||
- 有执行过上面的手动批量生成过也没问题,配置是继承的不覆盖
|
||||
- Customizable memory and hard disk sizes
|
||||
- It's also fine if you have manually executed the above batch generation before; the configuration inherits without overwriting
|
||||
|
||||
如果需要多次批量生成小鸡,可使用
|
||||
If you need to batch-generate servers multiple times, you can use the following:
|
||||
|
||||
Command:
|
||||
|
||||
@@ -164,8 +163,8 @@ Can be run multiple times to batch generate chicks, and inherit the previous par
|
||||
After opening the chicks, the specific information will be generated in the log file in the current directory, with the following format
|
||||
|
||||
```shell
|
||||
1号服务器名称 密码 ssh端口 外网端口起始 外网端口终止
|
||||
2号服务器名称 密码 ssh端口 外网端口起始 外网端口终止
|
||||
Server_1_Name Password SSH_Port Public_Port_Start Public_Port_End
|
||||
Server_2_Name Password SSH_Port Public_Port_Start Public_Port_End
|
||||
```
|
||||
|
||||
To view it, simply print the log file by executing the following command in the current directory
|
||||
@@ -178,42 +177,42 @@ cat log
|
||||
Don't use the chicks opened by this script as a production environment, LXC virtualization doesn't support changing kernel, dd, turning on bbr, etc.
|
||||
:::
|
||||
|
||||
## 部分常用LXD命令
|
||||
## Some common LXD commands
|
||||
|
||||
查看所有
|
||||
View all containers:
|
||||
|
||||
```bash
|
||||
lxc list
|
||||
```
|
||||
|
||||
查看个例
|
||||
View details of a specific container:
|
||||
|
||||
```bash
|
||||
lxc info 服务器名字
|
||||
lxc info container_name
|
||||
```
|
||||
|
||||
启动个例
|
||||
Start a specific container:
|
||||
|
||||
```bash
|
||||
lxc start 服务器名字
|
||||
lxc start container_name
|
||||
```
|
||||
|
||||
停止个例
|
||||
Stop a specific container:
|
||||
|
||||
```bash
|
||||
lxc stop 服务器名字
|
||||
lxc stop container_name
|
||||
```
|
||||
|
||||
删除个例
|
||||
Delete a specific container:
|
||||
|
||||
```bash
|
||||
lxc delete -f 服务器名字
|
||||
lxc delete -f container_name
|
||||
```
|
||||
|
||||
进入内部
|
||||
Enter the container's shell:
|
||||
|
||||
```bash
|
||||
lxc exec 服务器名字 /bin/bash
|
||||
lxc exec container_name /bin/bash
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
Reference in New Issue
Block a user