Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # QEMU name and PID
- OPTS="-name windows-10-pro"
- OPTS="$OPTS -pidfile /tmp/windows-10-pro.pid"
- # Processor
- OPTS="$OPTS -cpu host,kvm=off"
- OPTS="$OPTS -smp 8,sockets=1,cores=4,threads=2"
- OPTS="$OPTS -enable-kvm"
- # Machine
- OPTS="$OPTS -machine type=pc-i440fx-2.1,accel=kvm"
- #OPTS="$OPTS -machine type=q35,accel=kvm"
- OPTS="$OPTS -global PIIX4_PM.disable_s3=0"
- # Memory
- OPTS="$OPTS -m 8G"
- OPTS="$OPTS -mem-path /dev/hugepages"
- OPTS="$OPTS -mem-prealloc"
- OPTS="$OPTS -balloon none"
- # Hardware clock
- OPTS="$OPTS -rtc clock=host,base=utc"
- # Sound hardware
- QEMU_PA_SAMPLES=128
- export QEMU_AUDIO_DRV=pa
- OPTS="$OPTS -soundhw hda"
- # Graphic card passthrough (Gigabyte GeForce GTX 970 G1 Gaming)
- OPTS="$OPTS -device vfio-pci,host=03:00.0,multifunction=on"
- OPTS="$OPTS -device vfio-pci,host=03:00.1"
- # USB 3.0 passthrough (NEC/Renesas)
- # XBOX CONTROLLER
- OPTS="$OPTS -usb -usbdevice host:045e:02d1"
- #ALIENWARE MOUSE
- #OPTS="$OPTS -usb -usbdevice host:187c:0515"
- # Keyboard layout
- OPTS="$OPTS -k de"
- # Boot priority
- OPTS="$OPTS -boot order=c"
- # OVMF
- cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd /home/tom/virtualmachine/my_vars.fd
- OPTS="$OPTS -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd"
- OPTS="$OPTS -drive if=pflash,format=raw,file=/home/tom/virtualmachine/my_vars.fd"
- # System drive
- OPTS="$OPTS -drive id=disk0,if=none,cache=unsafe,format=raw,file=/home/tom/virtualmachine/windows10.img"
- OPTS="$OPTS -device driver=virtio-scsi-pci,id=scsi0"
- OPTS="$OPTS -device scsi-hd,drive=disk0"
- # Other drive
- OPTS="$OPTS -drive id=disk1,if=none,cache=none,aio=native,format=raw,file=/dev/disk/by-id/ata-ST1000DM003-1ER162_Z4Y29PNX-part2"
- OPTS="$OPTS -device driver=virtio-scsi-pci,id=scsi1"
- OPTS="$OPTS -device scsi-hd,drive=disk1"
- # Windows 10 Pro installer
- OPTS="$OPTS -drive id=cd0,if=none,format=raw,readonly,file=/home/tom/virtualmachine/Win8.1_German_x64.iso"
- OPTS="$OPTS -device driver=ide-cd,bus=ide.0,drive=cd0"
- # Virtio driver
- OPTS="$OPTS -drive id=virtiocd,if=none,format=raw,file=/home/tom/virtualmachine/virtio-win.iso"
- OPTS="$OPTS -device driver=ide-cd,bus=ide.1,drive=virtiocd"
- OPTS="$OPTS -device piix3-usb-uhci"
- # Network
- OPTS="$OPTS -net nic -net user,net=192.168.1.0/24"
- #OPTS="$OPTS -net nic,model=virtio,vlan=0 -net user"
- sudo taskset -c 0-7 qemu-system-x86_64 $OPTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement