cannot access storage file (as uid:107, gid:107) permission denied
解决方法:
Changing /etc/libvirt/qemu.conf make working things.
Uncomment user/group to work as root.
首先尝试在 Virtual Machine Manager 里面安装。遇到的问题如下:
一直停留在 starting windows 界面。
解决方法:修改 video model 为 Cirrus,问题解决
apt-get install virt-manager
apt-get install qemu
virt-manager
apt-get install kvm
qemu-img create -f raw /root/ubuntu16.04.1.raw 20G
virt-install --virt-type kvm --name ubuntu16.04.1 --ram 10240
--cdrom=/root/ubuntu-16.04.1-server-amd64.iso
--disk /root/ubuntu16.04.1.raw,format=raw
--network network=default
--graphics vnc,listen=0.0.0.0 --noautoconsole
--os-type=linux --os-variant=ubuntutrusty
virsh list --all
virsh vncdisplay ubuntu16.04.1
virsh start trusty --paused
virsh attach-disk --type cdrom --mode readonly ubuntu16.04.1 "" hdc
virsh resume ubuntu16.04.1
apt-get install cloud-init
dpkg-reconfigure cloud-init
/sbin/shutdown -h now
virt-sysprep -d ubuntu16.04.1
rm -rf /etc/udev/rules.d/70-persistent-net.rules
GRUB_CMDLINE_LINUX_DEFAULT="text console=tty0 console=ttyS0,115200n8"
update-grub
openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
qemu-img convert -f qcow2 -O raw precise-cloudimg.img precise-cloudimg.raw
qemu-img convert -c -O qcow2 oldfile newfile
virt-install --virt-type kvm --name centos --ram 10240
--disk /root/CentOS7.raw,format=raw
--network network=default
--graphics vnc,listen=0.0.0.0 --noautoconsole
--os-type=linux --os-variant=rhel7
--location=/root/CentOS-7-x86_64-DVD-1511.iso
qemu-img create -f qcow2 win7.qcow2 20G
virt-install --connect qemu:///system
--name win7 --ram 10240 --vcpus 4
--network network=default,model=virtio
--disk path=/root/win7/win7.qcow2,format=qcow2,device=disk,bus=virtio
--cdrom /root/win7/cn_windows_7_ultimate_x64_dvd_x15-66043.iso
--disk path=/root/win7/virtio-win-0.1.126.iso,device=cdrom
--vnc --os-type windows --os-variant win2k8
消除image空洞
virt-sparsify -x Ubuntu14_Server_Base.qcow2 --convert qcow2 Ubuntu14_Server_Base.qcow2.tmp
压缩image
qemu-img convert -pc -O qcow2 Ubuntu14_Server_Base.qcow2.tmp Ubuntu14_Server_Base.img