|
1 | | -# Setting up a Development Environment for Firecracker |
| 1 | +# 为 Firecracker 搭建开发环境 |
2 | 2 |
|
3 | | -Firecracker uses KVM for the actual resource virtualization, hence setting up a |
4 | | -development environment requires either a bare-metal machine (with hardware |
5 | | -virtualization), or a virtual machine that supports nested virtualization. The |
6 | | -different options are outlined below. Once the environment is set up, one can |
7 | | -continue with the specific steps of setting up Firecracker (e.g., as outlined in |
8 | | -the [Getting Started](getting-started.md) instructions). |
| 3 | +Firecracker 采用 KVM 实现实际资源虚拟化,因此搭建开发环境需满足以下条件之一:裸机设备(需支持硬件虚拟化)或支持嵌套虚拟化的虚拟机。环境配置完成后,即可继续执行 Firecracker 的具体安装步骤(例如参见[入门指南](getting-started.md)中的说明)。 |
9 | 4 |
|
10 | | -## Local |
| 5 | +## 本地 |
11 | 6 |
|
12 | | -### Local Bare-Metal Machine |
| 7 | +### 本地裸机 |
13 | 8 |
|
14 | 9 | `[TODO]` |
15 | 10 |
|
16 | | -### Local Virtual Machine |
17 | | - |
18 | | -#### macOS with VMware Fusion |
19 | | - |
20 | | -Note that Firecracker development on macOS has no hard dependency on VMware |
21 | | -Fusion or Ubuntu. All that is required is a Linux VM that supports nested |
22 | | -virtualization. This is but one example of that setup: |
23 | | - |
24 | | -1. Download and install |
25 | | - [VMware Fusion](https://www.vmware.com/products/fusion/fusion-evaluation.html). |
26 | | -1. Download an [Ubuntu 18.04.2 LTS](https://www.ubuntu.com/download/desktop) ISO |
27 | | - image. |
28 | | -1. Open VMware Fusion, open the **File** menu, and select **New...** to bring up |
29 | | - the **Select the Installation Method** window. |
30 | | -1. Find the ISO image you downloaded in step 2, and drag it onto the VMware |
31 | | - window opened in step 3. |
32 | | -1. You should now be at the **Create a New Virtual Machine** window. Ensure the |
33 | | - Ubuntu 18.04.2 image is highlighted, and click **Continue**. |
34 | | -1. On the **Linux Easy Install** window, leave the **Use Easy Install** option |
35 | | - checked, enter a password, and click **Continue**. |
36 | | -1. On the **Finish** window, click **Finish**, and save the `.vmwarevm` file if |
| 11 | +### 本地虚拟机 |
| 12 | + |
| 13 | +#### 搭载 VMware Fusion 的 macOS |
| 14 | + |
| 15 | +请注意,在 macOS 上开发 Firecracker 并不强制依赖 VMware Fusion 或 Ubuntu。 |
| 16 | +所需的仅是一个支持嵌套虚拟化的 Linux 虚拟机。以下仅为该配置的一个示例: |
| 17 | + |
| 18 | +1. 下载并进行安装 |
| 19 | + [VMware Fusion](https://www.vmware.com/products/fusion/fusion-evaluation.html)。 |
| 20 | +2. 安装 [Ubuntu 18.04.2 LTS](https://www.ubuntu.com/download/desktop) ISO 镜像。 |
| 21 | +3. 打开 VMware Fusion,点击**File**菜单,选择**New...**以调出 |
| 22 | + **Select the Installation Method**窗口。 |
| 23 | +4. 找到在步骤 2 中下载的 ISO 映像文件,将其拖放到步骤 3 中打开的 VMware 窗口上。 |
| 24 | +5. 您现在应处于**Create a New Virtual Machine**窗口。请确保 |
| 25 | + Ubuntu 18.04.2 镜像处于高亮状态,然后点击**Continue**。 |
| 26 | +6. 在 **Linux Easy Install** 窗口中,保持 **Use Easy Install** 选项被选中,输入密码,然后点击 **Continue**。 |
| 27 | +7. On the **Finish** window, click **Finish**, and save the `.vmwarevm` file if |
37 | 28 | prompted. |
38 | | -1. After the VM starts up, open the **Virtual Machine** menu, and select **Shut |
| 29 | +8. After the VM starts up, open the **Virtual Machine** menu, and select **Shut |
39 | 30 | Down**. |
40 | | -1. After the VM shuts down, open the **Virtual Machine** menu, and select |
| 31 | +9. After the VM shuts down, open the **Virtual Machine** menu, and select |
41 | 32 | **Settings...**. |
42 | | -1. From the settings window, select **Processors & Memory**, and then unfurl the |
43 | | - **Advanced options** section. |
44 | | -1. Check the **Enable hypervisor applications in this virtual machine** option, |
45 | | - close the settings window, open the **Virtual Machine** menu, and select |
46 | | - **Start Up**. |
47 | | -1. Network adapter setting for the VM must use auto-detect bridged networking. |
48 | | - Go to Virtual Machine, Settings, Network Adapter, select Autodetect under |
49 | | - Bridged Networking. |
50 | | -1. If you receive a **Cannot connect the virtual device sata0:1 because no |
51 | | - corresponding device is available on the host.** error, you can respond |
52 | | - **No** to the prompt. |
53 | | -1. Once the VM starts up, log in as the user you created in step 6. |
54 | | -1. After logging in, open the **Terminal** app, and run |
55 | | - `sudo apt install curl -y` to install cURL. |
56 | | -1. Now you can continue with the Firecracker |
57 | | - [Getting Started](getting-started.md) instructions to install and configure |
58 | | - Firecracker in the new VM. |
| 33 | +10. From the settings window, select **Processors & Memory**, and then unfurl the |
| 34 | + **Advanced options** section. |
| 35 | +11. Check the **Enable hypervisor applications in this virtual machine** option, |
| 36 | + close the settings window, open the **Virtual Machine** menu, and select |
| 37 | + **Start Up**. |
| 38 | +12. Network adapter setting for the VM must use auto-detect bridged networking. |
| 39 | + Go to Virtual Machine, Settings, Network Adapter, select Autodetect under |
| 40 | + Bridged Networking. |
| 41 | +13. If you receive a **Cannot connect the virtual device sata0:1 because no |
| 42 | + corresponding device is available on the host.** error, you can respond |
| 43 | + **No** to the prompt. |
| 44 | +14. Once the VM starts up, log in as the user you created in step 6. |
| 45 | +15. After logging in, open the **Terminal** app, and run |
| 46 | + `sudo apt install curl -y` to install cURL. |
| 47 | +16. Now you can continue with the Firecracker |
| 48 | + [Getting Started](getting-started.md) instructions to install and configure |
| 49 | + Firecracker in the new VM. |
59 | 50 |
|
60 | 51 | ## Cloud |
61 | 52 |
|
|
0 commit comments