部分场景下,需要在VMware ESXi虚拟机中安装iStoreOS/OpenWRT等软路由器系统,由于这些系统只提供img格式,VMware没法直接安装。
搜索了一下,网上基本上都是通过将img格式转换为vmdk格式,再导入。
本文介绍另外一种方式,核心步骤是:
1、创建虚拟机后,通过Ubuntu Desktop或者其他Linux ISO进入无盘系统;
2、将iStoreOS/OpenWRT软路由img文件dd到/dev/sda磁盘中;
3、重启系统即可。
详细步骤:
1、进入无盘Ubuntu桌面系统后,创建root密码
ubuntu@ubuntu:~$ sudo passwd
New password:
BAD PASSWORD: The password fails the dictionary check – it is based on a dictionary word
Retype new password:
passwd: password updated successfully
ubuntu@ubuntu:~$ su
Password:
New password:
BAD PASSWORD: The password fails the dictionary check – it is based on a dictionary word
Retype new password:
passwd: password updated successfully
ubuntu@ubuntu:~$ su
Password:
2、下载软件路由系统文件,并解压缩。
注意:VMWare虚拟机中启动方式为EFI的话,就选择下载efi.img文件;否则下载传统的img文件。
root@ubuntu:/home/ubuntu# cd Downloads/
root@ubuntu:/home/ubuntu/Downloads# wget https://fw0.koolcenter.com/iStoreOS/x86_64_efi/istoreos-22.03.5-2023092815-x86-64-squashfs-combined-efi.img.gz
root@ubuntu:/home/ubuntu/Downloads# gunzip istoreos-22.03.5-2023092815-x86-64-squashfs-combined-efi.img.gzgzip: istoreos-22.03.5-2023092815-x86-64-squashfs-combined-efi.img.gz: decompression OK, trailing garbage ignored
root@ubuntu:/home/ubuntu/Downloads#
3、将解压缩后的img文件,直接dd到虚拟机的硬盘中。
本文示例中的VMWare虚拟硬盘是/dev/sda,不确定的话,可以通过fdisk查看。
root@ubuntu:/home/ubuntu/Downloads# dd if=istoreos-22.03.5-2023092815-x86-64-squashfs-combined-efi.img of=/dev/sda
4981311+0 records in
4981311+0 records out
2550431232 bytes (2.6 GB, 2.4 GiB) copied, 65.3447 s, 39.0 MB/s
root@ubuntu:/home/ubuntu/Downloads#
4981311+0 records in
4981311+0 records out
2550431232 bytes (2.6 GB, 2.4 GiB) copied, 65.3447 s, 39.0 MB/s
root@ubuntu:/home/ubuntu/Downloads#
oot@ubuntu:/home/ubuntu/Downloads# fdisk -l /dev/sda
GPT PMBR size mismatch (4981279 != 209715199) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
The backup GPT table is not on the end of the device.
Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: Virtual disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5797074E-99FC-3788-CACE-EC2CD9D5BB00Device Start End Sectors Size Type
/dev/sda1 512 262655 262144 128M Linux filesystem
/dev/sda2 262656 786943 524288 256M Linux filesystem
/dev/sda3 786944 4981247 4194304 2G Linux filesystem
/dev/sda128 34 511 478 239K BIOS bootPartition table entries are not in disk order.
GPT PMBR size mismatch (4981279 != 209715199) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
The backup GPT table is not on the end of the device.
Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: Virtual disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5797074E-99FC-3788-CACE-EC2CD9D5BB00Device Start End Sectors Size Type
/dev/sda1 512 262655 262144 128M Linux filesystem
/dev/sda2 262656 786943 524288 256M Linux filesystem
/dev/sda3 786944 4981247 4194304 2G Linux filesystem
/dev/sda128 34 511 478 239K BIOS bootPartition table entries are not in disk order.
4、重启虚拟机。
root@ubuntu:/home/ubuntu/Downloads#reboot
Leave a Reply