virsh cmd

create virtual disk

qemu-img create -f qcow2 /app/kvm/erp01.c.qcow2 60G
qemu-img create -f qcow2 /app/kvm/erp01.d.qcow2 80G

create a windows vm boot by iso, and mount virtio driver iso

virt-install --connect qemu:///system \
  --name erp01 --ram 8192 --vcpus 4 \
  --network network=default,model=virtio \
  --disk path=/app/kvm/erp01.c.qcow2,format=qcow2,device=disk,bus=virtio \
  --disk path=/app/kvm/erp01.d.qcow2,format=qcow2,device=disk,bus=virtio \
  --disk path=/app/pub/iso/SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_ChnSimp_-2_MLF_X21-22842.iso,device=cdrom \
  --disk path=/app/pub/iso/virtio-win-0.1.126.iso,device=cdrom \
  --os-type windows --os-variant win2k12r2 --video qxl --channel spicevmc \
  --check path_in_use=off --graphics vnc,listen=0.0.0.0,port=6901 \
  --boot hd,cdrom,network,menu=on \
 --network bridge=br0 \
  --noautoconsole

open vnc client, and connect the HOST:6901
when boot by install iso , select disk driver: viostor
after install, need to install all driver

pass through usb key to vm

lsusb
Bus 001 Device 006: ID 1312:2012 ICS Electronics
virsh edit erp01
   
      
        
        
      
    
  



virsh destroy --graceful erp01
virsh start erp01

virsh edit vm to bridge


    
    
       # try this if you experience problems with VLANs
 

你可能感兴趣的:(virsh cmd)