update config
This commit is contained in:
parent
829d5ab694
commit
50783d144f
20
startvm
20
startvm
@ -15,15 +15,19 @@ sudo mount -o remount /var/lib/libvirt/images/ # remove this if you're not me
|
|||||||
echo "Reserving hugepages and some other shit"
|
echo "Reserving hugepages and some other shit"
|
||||||
echo $HUGEPAGES_MB | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
|
echo $HUGEPAGES_MB | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
|
||||||
|
|
||||||
echo 1 | sudo tee /sys/bus/pci/devices/$MAIN_GPU/rescan
|
#echo 1 | sudo tee /sys/bus/pci/devices/$MAIN_GPU/rescan
|
||||||
sleep 1
|
sleep 1
|
||||||
sudo ./binddev $ALL_PARTS
|
#sudo ./binddev $ALL_PARTS
|
||||||
|
asusctl graphics -m vfio
|
||||||
#fi
|
#fi
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo 3 | sudo tee /proc/sys/vm/drop_caches
|
echo 3 | sudo tee /proc/sys/vm/drop_caches
|
||||||
echo 1 | sudo tee /proc/sys/vm/compact_memory
|
echo 1 | sudo tee /proc/sys/vm/compact_memory
|
||||||
echo 0-15 | sudo tee /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus
|
#echo 0-15 | sudo tee /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus
|
||||||
|
sudo vfio-isolate cpuset-delete /host.slice cpuset-delete /machine.slice
|
||||||
|
echo "ERROR ABOVE IS OK"
|
||||||
|
sudo vfio-isolate cpuset-create --cpus C0-1 /host.slice cpuset-create --cpus C0-15 -nlb /machine.slice move-tasks / /host.slice
|
||||||
echo "Starting Network"
|
echo "Starting Network"
|
||||||
virsh --connect=qemu:///system net-start default
|
virsh --connect=qemu:///system net-start default
|
||||||
sudo systemctl start smb nmb # comment out if you dont have smb share for linux
|
sudo systemctl start smb nmb # comment out if you dont have smb share for linux
|
||||||
@ -33,14 +37,14 @@ virsh --connect=qemu:///system start $VMNAME
|
|||||||
echo "Starting Scream"
|
echo "Starting Scream"
|
||||||
scream -o pulse -i virbr0 & # scream audio
|
scream -o pulse -i virbr0 & # scream audio
|
||||||
echo "Starting Looking Glass"
|
echo "Starting Looking Glass"
|
||||||
looking-glass-client -d -g egl -a -K $LOOKING_GLASS_FPS -j -m $LOOKING_GLASS_ESCAPE -S &
|
looking-glass-client -d -g egl -a -j -m $LOOKING_GLASS_ESCAPE -S &
|
||||||
# if looking glass crashes, press enter to restart it. if you want to stop VM, type "stop" (then enter)
|
# if looking glass crashes, press enter to restart it. if you want to stop VM, type "stop" (then enter)
|
||||||
|
|
||||||
while [ "$command" != "stop" ]; do
|
while [ "$command" != "stop" ]; do
|
||||||
if jobs | grep looking | grep Running; then
|
if jobs | grep looking | grep Running; then
|
||||||
read command
|
read command
|
||||||
else
|
else
|
||||||
looking-glass-client -d -g egl -a -K $LOOKING_GLASS_FPS -j -m $LOOKING_GLASS_ESCAPE -S &
|
looking-glass-client -d -g egl -a -j -m $LOOKING_GLASS_ESCAPE -S &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sudo whoami # regain root access
|
sudo whoami # regain root access
|
||||||
@ -57,9 +61,11 @@ while [ "$vmstate" != "shut off" ]; do
|
|||||||
done
|
done
|
||||||
sleep 1
|
sleep 1
|
||||||
echo "VM is off"
|
echo "VM is off"
|
||||||
echo "Freeing up memory"
|
echo "Freeing up memory and CPU"
|
||||||
|
sudo vfio-isolate cpuset-delete /host.slice cpuset-delete /machine.slice
|
||||||
echo 0 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
|
echo 0 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
|
||||||
echo "Unbinding from vfio-pci and removing devices"
|
echo "Unbinding from vfio-pci and removing devices"
|
||||||
sudo ./unbinddev $ALL_PARTS
|
asusctl graphics -m integrated
|
||||||
|
#sudo ./unbinddev $ALL_PARTS
|
||||||
|
|
||||||
sudo systemctl stop smb nmb # stop SMB if in use
|
sudo systemctl stop smb nmb # stop SMB if in use
|
||||||
|
82
win10.xml
Executable file → Normal file
82
win10.xml
Executable file → Normal file
@ -13,12 +13,9 @@ or other application using the libvirt API.
|
|||||||
<libosinfo:os id="http://microsoft.com/win/10"/>
|
<libosinfo:os id="http://microsoft.com/win/10"/>
|
||||||
</libosinfo:libosinfo>
|
</libosinfo:libosinfo>
|
||||||
</metadata>
|
</metadata>
|
||||||
<memory unit='KiB'>16777216</memory>
|
<memory unit='KiB'>12582912</memory>
|
||||||
<currentMemory unit='KiB'>16777216</currentMemory>
|
<currentMemory unit='KiB'>12582912</currentMemory>
|
||||||
<memoryBacking>
|
<vcpu placement='static' current='14'>16</vcpu>
|
||||||
<hugepages/>
|
|
||||||
</memoryBacking>
|
|
||||||
<vcpu placement='static' current='12'>16</vcpu>
|
|
||||||
<vcpus>
|
<vcpus>
|
||||||
<vcpu id='0' enabled='yes' hotpluggable='no'/>
|
<vcpu id='0' enabled='yes' hotpluggable='no'/>
|
||||||
<vcpu id='1' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='1' enabled='yes' hotpluggable='yes'/>
|
||||||
@ -26,8 +23,8 @@ or other application using the libvirt API.
|
|||||||
<vcpu id='3' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='3' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='4' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='4' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='5' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='5' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='6' enabled='no' hotpluggable='yes'/>
|
<vcpu id='6' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='7' enabled='no' hotpluggable='yes'/>
|
<vcpu id='7' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='8' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='8' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='9' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='9' enabled='yes' hotpluggable='yes'/>
|
||||||
<vcpu id='10' enabled='yes' hotpluggable='yes'/>
|
<vcpu id='10' enabled='yes' hotpluggable='yes'/>
|
||||||
@ -39,27 +36,28 @@ or other application using the libvirt API.
|
|||||||
</vcpus>
|
</vcpus>
|
||||||
<iothreads>1</iothreads>
|
<iothreads>1</iothreads>
|
||||||
<cputune>
|
<cputune>
|
||||||
<vcpupin vcpu='0' cpuset='2'/>
|
<vcpupin vcpu='0' cpuset='4'/>
|
||||||
<vcpupin vcpu='1' cpuset='3'/>
|
<vcpupin vcpu='1' cpuset='5'/>
|
||||||
<vcpupin vcpu='2' cpuset='4'/>
|
<vcpupin vcpu='2' cpuset='6'/>
|
||||||
<vcpupin vcpu='3' cpuset='5'/>
|
<vcpupin vcpu='3' cpuset='7'/>
|
||||||
<vcpupin vcpu='4' cpuset='6'/>
|
<vcpupin vcpu='4' cpuset='8'/>
|
||||||
<vcpupin vcpu='5' cpuset='7'/>
|
<vcpupin vcpu='5' cpuset='9'/>
|
||||||
<vcpupin vcpu='8' cpuset='8'/>
|
<vcpupin vcpu='6' cpuset='10'/>
|
||||||
<vcpupin vcpu='9' cpuset='9'/>
|
<vcpupin vcpu='7' cpuset='11'/>
|
||||||
<vcpupin vcpu='10' cpuset='10'/>
|
<vcpupin vcpu='8' cpuset='12'/>
|
||||||
<vcpupin vcpu='11' cpuset='11'/>
|
<vcpupin vcpu='9' cpuset='13'/>
|
||||||
<vcpupin vcpu='12' cpuset='12'/>
|
<vcpupin vcpu='10' cpuset='14'/>
|
||||||
<vcpupin vcpu='13' cpuset='13'/>
|
<vcpupin vcpu='11' cpuset='15'/>
|
||||||
|
<vcpupin vcpu='12' cpuset='2'/>
|
||||||
|
<vcpupin vcpu='13' cpuset='3'/>
|
||||||
<emulatorpin cpuset='0-1'/>
|
<emulatorpin cpuset='0-1'/>
|
||||||
<iothreadpin iothread='1' cpuset='14-15'/>
|
<iothreadpin iothread='1' cpuset='0-1'/>
|
||||||
</cputune>
|
</cputune>
|
||||||
<os>
|
<os>
|
||||||
<type arch='x86_64' machine='pc-q35-5.0'>hvm</type>
|
<type arch='x86_64' machine='pc-q35-5.0'>hvm</type>
|
||||||
<loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/x64/OVMF_CODE.fd</loader>
|
<loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/x64/OVMF_CODE.fd</loader>
|
||||||
<nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
|
<nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
|
||||||
<boot dev='hd'/>
|
<bootmenu enable='yes'/>
|
||||||
<bootmenu enable='no'/>
|
|
||||||
</os>
|
</os>
|
||||||
<features>
|
<features>
|
||||||
<acpi/>
|
<acpi/>
|
||||||
@ -73,23 +71,13 @@ or other application using the libvirt API.
|
|||||||
<synic state='on'/>
|
<synic state='on'/>
|
||||||
<stimer state='on'/>
|
<stimer state='on'/>
|
||||||
<reset state='on'/>
|
<reset state='on'/>
|
||||||
<vendor_id state='on' value='087D1028'/>
|
|
||||||
<frequencies state='on'/>
|
<frequencies state='on'/>
|
||||||
</hyperv>
|
</hyperv>
|
||||||
<kvm>
|
|
||||||
<hidden state='on'/>
|
|
||||||
</kvm>
|
|
||||||
<vmport state='off'/>
|
<vmport state='off'/>
|
||||||
</features>
|
</features>
|
||||||
<cpu mode='host-passthrough' check='none' migratable='off'>
|
<cpu mode='host-passthrough' check='none' migratable='on'>
|
||||||
<topology sockets='1' dies='1' cores='8' threads='2'/>
|
<topology sockets='1' dies='1' cores='8' threads='2'/>
|
||||||
<cache mode='passthrough'/>
|
<cache mode='passthrough'/>
|
||||||
<feature policy='require' name='topoext'/>
|
|
||||||
<feature policy='require' name='svm'/>
|
|
||||||
<feature policy='require' name='apic'/>
|
|
||||||
<feature policy='require' name='hypervisor'/>
|
|
||||||
<feature policy='require' name='invtsc'/>
|
|
||||||
<feature policy='disable' name='amd-stibp'/>
|
|
||||||
</cpu>
|
</cpu>
|
||||||
<clock offset='localtime'>
|
<clock offset='localtime'>
|
||||||
<timer name='rtc' present='no' tickpolicy='catchup'/>
|
<timer name='rtc' present='no' tickpolicy='catchup'/>
|
||||||
@ -103,22 +91,24 @@ or other application using the libvirt API.
|
|||||||
<on_reboot>restart</on_reboot>
|
<on_reboot>restart</on_reboot>
|
||||||
<on_crash>destroy</on_crash>
|
<on_crash>destroy</on_crash>
|
||||||
<pm>
|
<pm>
|
||||||
<suspend-to-mem enabled='yes'/>
|
<suspend-to-mem enabled='no'/>
|
||||||
<suspend-to-disk enabled='no'/>
|
<suspend-to-disk enabled='no'/>
|
||||||
</pm>
|
</pm>
|
||||||
<devices>
|
<devices>
|
||||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
<disk type='file' device='disk'>
|
<disk type='file' device='disk'>
|
||||||
<driver name='qemu' type='qcow2' cache='writeback' io='threads' discard='unmap'/>
|
<driver name='qemu' type='qcow2' cache='none' io='threads'/>
|
||||||
<source file='/var/lib/libvirt/images/win10.qcow2'/>
|
<source file='/var/lib/libvirt/images/win10.qcow2'/>
|
||||||
<target dev='sda' bus='scsi'/>
|
<target dev='sda' bus='scsi'/>
|
||||||
|
<boot order='1'/>
|
||||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||||
</disk>
|
</disk>
|
||||||
<disk type='file' device='cdrom'>
|
<disk type='file' device='cdrom'>
|
||||||
<driver name='qemu' type='raw'/>
|
<driver name='qemu' type='raw'/>
|
||||||
<source file='/home/cole/Downloads/SW_DVD5_WIN_ENT_LTSC_2019_64-bit_English_MLF_X21-96425_KMS38_ESD.iso'/>
|
<source file='/home/cole/sync/iso/18363.449.19H2_ALL_PLUS_1809_LTSC_ALL_CLIENTMULTI_FAT32_X64_EN-US.iso'/>
|
||||||
<target dev='sdb' bus='scsi'/>
|
<target dev='sdb' bus='sata'/>
|
||||||
<readonly/>
|
<readonly/>
|
||||||
|
<boot order='2'/>
|
||||||
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
|
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
|
||||||
</disk>
|
</disk>
|
||||||
<disk type='file' device='cdrom'>
|
<disk type='file' device='cdrom'>
|
||||||
@ -126,6 +116,7 @@ or other application using the libvirt API.
|
|||||||
<source file='/home/cole/Downloads/virtio-win-0.1.171.iso'/>
|
<source file='/home/cole/Downloads/virtio-win-0.1.171.iso'/>
|
||||||
<target dev='sdc' bus='sata'/>
|
<target dev='sdc' bus='sata'/>
|
||||||
<readonly/>
|
<readonly/>
|
||||||
|
<boot order='3'/>
|
||||||
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
|
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
|
||||||
</disk>
|
</disk>
|
||||||
<controller type='sata' index='0'>
|
<controller type='sata' index='0'>
|
||||||
@ -232,44 +223,47 @@ or other application using the libvirt API.
|
|||||||
<gl enable='no' rendernode='/dev/dri/by-path/pci-0000:04:00.0-render'/>
|
<gl enable='no' rendernode='/dev/dri/by-path/pci-0000:04:00.0-render'/>
|
||||||
</graphics>
|
</graphics>
|
||||||
<video>
|
<video>
|
||||||
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
|
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
||||||
</video>
|
</video>
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
|
<driver name='vfio'/>
|
||||||
<source>
|
<source>
|
||||||
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
||||||
</source>
|
</source>
|
||||||
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
<source>
|
<source>
|
||||||
<address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
|
<address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
|
||||||
</source>
|
</source>
|
||||||
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
<source>
|
<source>
|
||||||
<address domain='0x0000' bus='0x01' slot='0x00' function='0x2'/>
|
<address domain='0x0000' bus='0x01' slot='0x00' function='0x2'/>
|
||||||
</source>
|
</source>
|
||||||
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
<source>
|
<source>
|
||||||
<address domain='0x0000' bus='0x01' slot='0x00' function='0x3'/>
|
<address domain='0x0000' bus='0x01' slot='0x00' function='0x3'/>
|
||||||
</source>
|
</source>
|
||||||
<address type='pci' domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
<memballoon model='virtio'>
|
<memballoon model='virtio'>
|
||||||
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
||||||
</memballoon>
|
</memballoon>
|
||||||
<shmem name='looking-glass'>
|
<shmem name='looking-glass'>
|
||||||
<model type='ivshmem-plain'/>
|
<model type='ivshmem-plain'/>
|
||||||
<size unit='M'>32</size>
|
<size unit='M'>64</size>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||||
</shmem>
|
</shmem>
|
||||||
</devices>
|
</devices>
|
||||||
<qemu:commandline>
|
<qemu:commandline>
|
||||||
<qemu:arg value='-acpitable'/>
|
<qemu:arg value='-acpitable'/>
|
||||||
<qemu:arg value='file=/home/cole/vfio/acpitable.bin'/>
|
<qemu:arg value='file=/home/cole/vfio/acpitable.bin'/>
|
||||||
|
<qemu:arg value='-overcommit'/>
|
||||||
|
<qemu:arg value='cpu-pm=on'/>
|
||||||
</qemu:commandline>
|
</qemu:commandline>
|
||||||
</domain>
|
</domain>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user