@@ -24,20 +24,39 @@ We will use the Alinux3 disk image file from [here](https://mirrors.aliyun.com/a
24
24
1 . Download the Alinux3 disk image file (KVM x86_64 version with Microsoft Virtual PC format):
25
25
26
26
``` sh
27
- wget https://alinux3.oss-cn-hangzhou.aliyuncs.com/aliyun_3_x64_20G_nocloud_alibase_20250117.vhd
27
+ wget https://alinux3.oss-cn-hangzhou.aliyuncs.com/aliyun_3_x64_20G_nocloud_alibase_20250117.qcow2
28
28
```
29
29
30
30
2 . Convert the disk image file:
31
31
32
32
Here we will encrypt the disk image file with a provided passphrase (GkdQgrmLx8LkGi2zVnGxdeT) and configs from ` ./config_dir/ ` directory. The second parameter is the output file name.
33
33
34
34
``` sh
35
- cryptpilot-convert --in ./aliyun_3_x64_20G_nocloud_alibase_20250117.vhd --out ./aliyun_3_x64_20G_nocloud_alibase_20250117_cc.vhd -c ./config_dir/ --passphrase GkdQgrmLx8LkGi2zVnGxdeT
35
+ cryptpilot-convert --in ./aliyun_3_x64_20G_nocloud_alibase_20250117.qcow2 --out ./encrypted.qcow2 -c ./config_dir/ --passphrase GkdQgrmLx8LkGi2zVnGxdeT
36
36
```
37
37
38
- > Note: You can also use the --package parameter to install some packages/rpms to the converted disk.
38
+ > Note: You can also use the --package parameter to install some packages/rpms to the disk, before the encryption .
39
39
40
- 3 . Upload the converted disk image file to Aliyun and boot from it.
40
+
41
+ 3 . (optional) Test the converted disk image file:
42
+
43
+ You can launch a virtual machine with the converted disk image file and check that it works.
44
+
45
+ > Note: If you are using a ` .vhd ` file, you have to convert it to a ` .qcow2 ` file first, before you launch it with qemu.
46
+
47
+ ``` sh
48
+ yum install -y qemu-kvm
49
+
50
+ /usr/libexec/qemu-kvm \
51
+ -m 4096M \
52
+ -smp 4 \
53
+ -nographic \
54
+ -drive file=./encrypted.qcow2,format=qcow2,if=virtio,id=hd0,readonly=off \
55
+ -drive file=./seed.img,if=virtio,format=raw
56
+ ```
57
+ After you finished your tests, you can use Ctrl-A C to get to the qemu console, and enter 'quit' to exit qemu.
58
+
59
+ 4 . Upload the converted disk image file to Aliyun and boot from it.
41
60
42
61
### Convert a real system disk
43
62
0 commit comments