Skip to content

Instantly share code, notes, and snippets.

@itapai
Last active August 19, 2021 20:09
Show Gist options
  • Select an option

  • Save itapai/4ed8cfa65dd19389a8ae8b81adea1f0c to your computer and use it in GitHub Desktop.

Select an option

Save itapai/4ed8cfa65dd19389a8ae8b81adea1f0c to your computer and use it in GitHub Desktop.
headless virt-install windows server
#!/usr/bin/env bash
qemu-img create -f qcow2 /var/lib/libvirt/vms/win-server-2019.iso 50G
virt-install \
--name=win-server-2019 \
--os-type=windows \
--memory=4096 \
--cpu=host \
--vcpus=2 \
--network bridge=virbr0,model=virtio \
--disk path=/var/lib/libvirt/vms/win-server-2019.qcow2 \
--disk path=/var/lib/libvirt/images/virtio-win.iso,device=cdrom \
--cdrom=/var/lib/libvirt/images/win-server-2019.iso \
--graphics vnc,listen=0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment