虚拟机磁盘格式
创建一个raw格式的虚拟机磁盘
[[email protected] opt]# qemu-img create -f raw CentOS-7.2-x86_64.raw 10G Formatting ‘CentOS-7.2-x86_64.raw‘, fmt=raw size=10737418240 [[email protected] opt]# ll -h total 16K -rw-r--r-- 1 root root 10G May 22 19:23 CentOS-7.2-x86_64.raw drwx------ 2 root root 16K May 22 19:03 lost+found
使用物理机上面的安装盘制作一个ISO文件放到KVM虚拟机里面,会比较耗时,因为要从物理机里面要一份到虚拟机里面
[[email protected] opt]# dd if=/dev/cdrom of=/opt/CentOS-7.2.iso 8456192+0 records in 8456192+0 records out 4329570304 bytes (4.3 GB) copied, 78.9541 s, 54.8 MB/s
[[email protected] opt]# ll -h total 4.1G -rw-r--r-- 1 root root 4.1G May 22 19:32 CentOS-7.2.iso -rw-r--r-- 1 root root 10G May 22 19:23 CentOS-7.2-x86_64.raw drwx------ 2 root root 16K May 22 19:03 lost+found
下面创建虚拟机
[[email protected] opt]# virt-install --name CentOS-7-x86_64 --virt-type kvm --ram 1024 --cdrom=/opt/CentOS-7.2.iso --disk path=/opt/CentOS-7.2-x86_64.raw --network network=default --graphics vnc,listen=0.0.0.0 --noautoconsole
原文地址:https://www.cnblogs.com/kelamoyujuzhen/p/9071181.html
时间: 2024-10-29 22:07:30