qemu命令总结

../_images/Qemu-logo-small.png
  1. spice端口

    netstat -ntpl | grep qemu
    virsh domdisplay --type spice {Id or Name}
    
  2. 创建镜像

    qemu-img create -f qcow2 ubuntu-14.04.qcow2 20G
    qemu-img info ubuntu-14.04.qcow2
    
  3. 镜像压缩

    qemu-img convert -p -c -O qcow2 source.img destination.qcow2
    
  4. 创建快照

    qemu-img create -f qcow2 -b base.qcow2 snapshot.qcow2
    
  5. resize

    qemu-img resize source.qcow2 +10G
    

声卡

  1. 查询支持的声卡

    [localhost ~] $ sudo /usr/libexec/qemu-kvm --soundhw ?
    Valid sound card names (comma separated):
    ac97        Intel 82801AA AC97 Audio
    hda         Intel HD Audio
    pcspk       PC speaker
    
    -soundhw all will enable all of the above
    

2 增加声卡

[localhost ~] $ sudo /usr/libexec/qemu-kvm --soundhw all

Creating Guests with PXE

Red Hat Enterprise Linux 6 Virtualization Host Configuration and Guest Installation Guide