Skip to content

Instantly share code, notes, and snippets.

@ilude
Last active June 12, 2023 18:58
Show Gist options
  • Save ilude/a083934402ee761c402b7ab3ae9bcda7 to your computer and use it in GitHub Desktop.
Save ilude/a083934402ee761c402b7ab3ae9bcda7 to your computer and use it in GitHub Desktop.
KVM virt-install command
qemu-img create -f qcow2 /pool/vms/xp.qcow2 50G
sudo virt-install --connect qemu:///system -n xp -r 512 --disk path=/pool/vms/xp.qcow2,size=50 \
-c /pool/iso/windows/en_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73974.iso \
--graphics vnc,listen=0.0.0.0,port=65322 --noautoconsole \
--os-type windows --os-variant winxp
qemu-img create -f qcow2 /pool/vms/win10.qcow2 50G
virt-install \
--name=windows10
--ram=4096 \
--cpu=host
--vcpus=2 \
--os-type=windows \
--os-variant=win8.1 \
--disk path=/pool/vms/win10.qcow2,size=50 \
--disk /pool/iso/windows/SW_DVD9_Win_Pro_10_1511.2_64BIT_English_MLF_X20-99426.iso,device=cdrom,bus=ide \
--disk /pool/iso/virtio/virtio-win-0.1.118.iso,device=cdrom,bus=ide \
--network bridge=virbr0 \
--graphics vnc,listen=0.0.0.0
virt-install --virt-type kvm --name win10 --ram 4096 --connect qemu:///system \
--cdrom=/pool/iso/windows/SW_DVD9_Win_Pro_10_1511.2_64BIT_English_MLF_X20-99426.iso \
--disk path=/pool/vms/win10.qcow2,device=disk,bus=virtio \
--disk /pool/iso/virtio/virtio-win-0.1.118.iso,device=cdrom \
--network network=default,model=virtio \
--graphics vnc,listen=0.0.0.0 --noautoconsole \
--os-type=windows --os-variant=win8.1 --boot cdrom
virt-install --connect qemu:///system --arch=x86_64 -n serv12 -r 4096 --cpu host --vcpus=2 --hvm \
--disk path=/pool/vms/win10.qcow2,size=50,bus=virtio \
-c /pool/iso/windows/SW_DVD9_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_-4_MLF_X19-82891.iso \
--disk path=/pool/iso/virtio/virtio-win-0.1.118.iso,device=cdrom,perms=ro \
--os-type windows --os-variant win2k8 --network network=default,model=virtio \
--graphics vnc,listen=0.0.0.0 --noautoconsole
virt-install --connect qemu:///system -n serv12 -r 2048 --cpu host --vcpus=2 \
--disk path=/pool/vms/win10.qcow2,size=50,bus=virtio \
--disk /pool/iso/windows/SW_DVD9_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_-4_MLF_X19-82891.iso,device=cdrom,bus=ide \
--disk /pool/iso/virtio/virtio-win-0.1.118.iso,device=cdrom,bus=ide \
--os-type windows --os-variant win2k8 --network network=default,model=virtio \
--graphics vnc,listen=0.0.0.0,port=65322 --noautoconsole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment