Skip to content

Instantly share code, notes, and snippets.

@dasJ
Last active August 29, 2017 19:36
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dasJ/875da2c1ad543cdb224e to your computer and use it in GitHub Desktop.
Save dasJ/875da2c1ad543cdb224e to your computer and use it in GitHub Desktop.
Qemu final
#!/bin/bash
xhost local:root > /dev/null
if ! [ -d /sys/fs/cgroup/cpuset/windows ]; then
sudo cgcreate -t $USER:users -a $USER:users -g cpuset:windows
fi
/bin/echo "2-7" > /sys/fs/cgroup/cpuset/windows/cpuset.cpus
/bin/echo "0" > /sys/fs/cgroup/cpuset/windows/cpuset.mems
/usr/lib/synergy/synergys -f --no-tray --debug ERROR -n Acerola -c ~/.config/synergy.conf -a :24800 &
synpid=$!
cgexec -g cpuset:windows sudo QEMU_AUDIO_DRV=alsa qemu-system-x86_64 \
-enable-kvm -M q35 -localtime -usb -name Windows `# General options` \
-monitor /dev/tty -nographic -vga none -serial none `# Graphic options` \
-cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -smp 6,sockets=1,cores=6,threads=1 `# CPU Options` \
-m 8192 -mem-path /dev/hugepages `# Memory` \
-bios /usr/share/qemu/bios.bin `# BIOS` \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 `# PCIe Bus` \
-device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on `# Graphics card` \
-device vfio-pci,host=04:00.1,bus=root.1,addr=00.1 `# Graphics card sound` \
-soundhw hda `# Sound` \
-device virtio-scsi-pci,id=scsi `# SCSI controller` \
-drive file=/dev/sde,id=ssd,format=raw,if=none -device scsi-hd,drive=ssd `# SSD` \
-drive file=/dev/sdd,id=hdd,format=raw,if=none -device scsi-hd,drive=hdd `# HDD` \
-net nic,model=virtio -net bridge,br=br0 `# External networking` \
-net nic,model=virtio -net bridge,br=intnet `# Internal networking` \
-usbdevice host:03f0:0024 `# HP Keyboard` \
-usbdevice host:046d:c050 `# Logitech Mouse` \
-usbdevice host:045e:0719 `# Xbox Receiver` \
-usbdevice host:28de:1142 `# Steam receiver` \
#-device ich9-intel-hda,bus=pcie.0,addr=1b.0,id=sound0 -device hda-duplex,id=sound0-codec,bus=sound0.0,cad=0 `# Sound` \
##-drive file=/home/$USER/Downloads/virtio-win-0.1.96.iso,id=virtisocd,if=none -device ide-cd,bus=ide.1,drive=virtisocd \
##-drive file=/home/$USER/Downloads/de_windows_10_education_n_x64_dvd_6847304.iso,id=isocd,if=none -device scsi-cd,drive=isocd \
kill $synpid
reset # Fixes weird bug. Neither enter nor Ctrl+[CZ] will work after the monitor was closed. This fixes that
@dasJ
Copy link
Author

dasJ commented Nov 6, 2015

@dasJ
Copy link
Author

dasJ commented Nov 6, 2015

Revision 6: Fix random qemu monitor bug. Or feature? I don't know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment