云环境需要一个iso,但我只有qcow2虚机,所以测试一下用工具将qcow2转换位iso镜像

首先使用安装qemu

sudo apt-get install qemu-utils 
y

得到

Created symlink /etc/systemd/system/multi-user.target.wants/run-qemu.mount → /lib/systemd/system/run-qemu.mount.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...

然后上传qcow2

root@vultr:~# ls
fortios.qcow2  install.sh  snap
root@vultr:~# 

使用以下命令将 qcow2 镜像转换为 raw 镜像

 qemu-img convert -f qcow2 -O raw fortios.qcow2 fortios.raw 
root@vultr:~# ls
fortios.qcow2  fortios.raw  install.sh  snap
root@vultr:~# 

使用以下命令将 raw 镜像转换为 iso 文件

sudo apt install mkisofs
mkisofs -o fortios.iso fortios.raw

成功

Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
1048750 extents written (2048 MB)

最后,下载 iso 文件验证一下。
废物不能用emmm
再找找看

posted @ 2024-07-21 16:54  Aggy梁工  阅读(141)  评论(0)    收藏  举报  来源