我在Centos 6上创build了一个Windows 7虚拟机,运行以下命令:
virt-install --name=W7VIRT64 --ram=768 --disk path=/var/lib/libvirt/images/guest1-win7-32,size=8 --vnc --network network=default --os-type=windows --os-variant=win7 --cdrom=/root/win7.iso
我能够成功安装客户操作系统,并启动它。
如何使用非gui工具将磁盘映像大小增加到20G?
首先find你的图像目录。 然后确保你的图像是原始types。 你可以使用它来检查它
qemu-img info your_image
。 如果不是原始types,可以使用
qemu-img转换
将其转换为原始types。 然后:
dd if = / dev / zero = temp bs = 1G count = 0 seek = 20#创build20GB的临时文件
cat temp >> your_image#将临时文件放到图片的末尾
接下来,您可以使用gparted或分区魔法来调整您的分区大小。 最后但并非最不重要的只是重新启动你的Windows,并让检查磁盘工具来完成其任务。 祝你好运… C:
从qemu-img手册页
qemu-img resize filename [+ | -]size Change the disk image as if it had been created with size. Before using this command to shrink a disk image, you MUST use file system and partitioning tools inside the VM to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss! After using this command to grow a disk image, you must use file system and partitioning tools inside the VM to actually begin using the new space on the device.