Advertisement
7thCore

Untitled

Nov 16th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. [Unit]
  2. Description=Qemu Windows Server VM Service
  3. After=network.target
  4.  
  5. [Service]
  6. Type=forking
  7. WorkingDirectory=/nas/qemu/windows-server
  8. User=kacm
  9. ExecStartPre=/usr/bin/cp /usr/share/ovmf/x64/OVMF_VARS.fd /tmp/OVMF_VARS.fd
  10. ExecStartPre=/usr/bin/cp /usr/share/ovmf/x64/OVMF_CODE.fd /tmp/OVMF_CODE.fd
  11. ExecStart=/usr/bin/screen -dmSL Qemu-Windows-Server-VM bash -c 'qemu-system-x86_64 \
  12. -enable-kvm \
  13. -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=VM \
  14. -smp cores=2,threads=2 \
  15. -m 8G -mem-prealloc \
  16. -soundhw hda \
  17. -serial none \
  18. -parallel none \
  19. -vnc none \
  20. -netdev bridge,br=intel-br0,id=ndev -device virtio-net-pci,mac=52:54:00:00:38:33,id=nic0,netdev=ndev \
  21. -vga qxl -spice port=5905,password=password -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent \
  22. -device ich9-usb-ehci1,id=usb \
  23. -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,multifunction=on \
  24. -device ich9-usb-uhci2,masterbus=usb.0,firstport=2 \
  25. -device ich9-usb-uhci3,masterbus=usb.0,firstport=4 \
  26. -chardev spicevmc,name=usbredir,id=usbredirchardev1 \
  27. -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
  28. -chardev spicevmc,name=usbredir,id=usbredirchardev2 \
  29. -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
  30. -chardev spicevmc,name=usbredir,id=usbredirchardev3 \
  31. -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 \
  32. -chardev socket,path=/tmp/qemu-ga-windows-server.sock,server,nowait,id=qga1 \
  33. -device virtio-serial \
  34. -device virtserialport,chardev=qga1,name=org.qemu.guest_agent.1 \
  35. -device usb-tablet \
  36. -drive if=pflash,format=raw,readonly,file=/tmp/OVMF_CODE.fd \
  37. -drive if=pflash,format=raw,file=/tmp/OVMF_VARS.fd \
  38. -drive format=raw,file=/nas/qemu/windows-server/img/windows-server.img \
  39. -drive file=/nas/qemu/windows-server/iso/windows_server_2016.iso,index=1,media=cdrom \
  40. -drive file=/nas/qemu/windows-server/iso/virtio-win-0.1.141.iso,index=2,media=cdrom \
  41. -monitor unix:/tmp/qemu-monitor-windows-server.sock,server,nowait,nodelay'
  42. ExecStop=/bin/bash -c 'echo system_powerdown | socat stdio,ignoreeof /tmp/qemu-monitor-windows-server.sock'
  43. Restart=on-failure
  44. RestartSec=300
  45.  
  46. [Install]
  47. WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement