Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Unit]
- Description=Qemu Windows Server VM Service
- After=network.target
- [Service]
- Type=forking
- WorkingDirectory=/nas/qemu/windows-server
- User=kacm
- ExecStartPre=/usr/bin/cp /usr/share/ovmf/x64/OVMF_VARS.fd /tmp/OVMF_VARS.fd
- ExecStartPre=/usr/bin/cp /usr/share/ovmf/x64/OVMF_CODE.fd /tmp/OVMF_CODE.fd
- ExecStart=/usr/bin/screen -dmSL Qemu-Windows-Server-VM bash -c 'qemu-system-x86_64 \
- -enable-kvm \
- -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=VM \
- -smp cores=2,threads=2 \
- -m 8G -mem-prealloc \
- -soundhw hda \
- -serial none \
- -parallel none \
- -vnc none \
- -netdev bridge,br=intel-br0,id=ndev -device virtio-net-pci,mac=52:54:00:00:38:33,id=nic0,netdev=ndev \
- -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 \
- -device ich9-usb-ehci1,id=usb \
- -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,multifunction=on \
- -device ich9-usb-uhci2,masterbus=usb.0,firstport=2 \
- -device ich9-usb-uhci3,masterbus=usb.0,firstport=4 \
- -chardev spicevmc,name=usbredir,id=usbredirchardev1 \
- -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
- -chardev spicevmc,name=usbredir,id=usbredirchardev2 \
- -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
- -chardev spicevmc,name=usbredir,id=usbredirchardev3 \
- -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 \
- -chardev socket,path=/tmp/qemu-ga-windows-server.sock,server,nowait,id=qga1 \
- -device virtio-serial \
- -device virtserialport,chardev=qga1,name=org.qemu.guest_agent.1 \
- -device usb-tablet \
- -drive if=pflash,format=raw,readonly,file=/tmp/OVMF_CODE.fd \
- -drive if=pflash,format=raw,file=/tmp/OVMF_VARS.fd \
- -drive format=raw,file=/nas/qemu/windows-server/img/windows-server.img \
- -drive file=/nas/qemu/windows-server/iso/windows_server_2016.iso,index=1,media=cdrom \
- -drive file=/nas/qemu/windows-server/iso/virtio-win-0.1.141.iso,index=2,media=cdrom \
- -monitor unix:/tmp/qemu-monitor-windows-server.sock,server,nowait,nodelay'
- ExecStop=/bin/bash -c 'echo system_powerdown | socat stdio,ignoreeof /tmp/qemu-monitor-windows-server.sock'
- Restart=on-failure
- RestartSec=300
- [Install]
- WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement