windows_init/src/vm.sh

29 lines
784 B
Bash
Raw Normal View History

2021-09-18 04:38:08 +00:00
#!/bin/sh
# install qemu for qemu-system-x86_64
# install spice-client-gtk for spicy
# install spice-vdagent for spice and vdagent
# libvirt-daemon for /shrug
SPICE_PORT=5930
CHARDEV_ID='spicechannel0'
2021-09-27 17:31:13 +00:00
DRIVE='/dev/sdb' # change drive if needed
ISO='win.iso'
2021-09-18 04:38:08 +00:00
qemu-system-x86_64 \
-enable-kvm \
-daemonize \
-cpu host \
-smp 4 \
-net nic \
-net user,hostname=windowsvm \
-m 4G \
2021-09-18 04:38:08 +00:00
-boot d \
2021-09-27 17:31:13 +00:00
-cdrom ${ISO} \
-drive file=${DRIVE},format=raw,cache=none,if=virtio \
-vga qxl \
-device virtio-serial-pci \
-spice port=${SPICE_PORT},disable-ticketing=on \
-device virtserialport,chardev=${CHARDEV_ID},name=com.redhat.spice.0 \
-chardev spicevmc,id=${CHARDEV_ID},name=vdagent
2021-09-18 04:38:08 +00:00
exec spicy --title Windows 127.0.0.1 -p ${SPICE_PORT}