Quantcast
Channel: Recent Gists from luqmana
Viewing all articles
Browse latest Browse all 41

valo.sh

$
0
0
valo.sh
#!/bin/sh
# mkdir qemu-bionic
# cd qemu-bionic
# apt source qemu-kvm/bionic
# cd qemu-2.11*
# patch -p1 < ~/Develop/qemu-stuff/qemu-audio-fix.patch
# patch -p1 < ~/Develop/qemu-stuff/qemu-bionic-on-focal-fixes.patch
# DEBEMAIL="Luqman Aden <me@luqman.ca>" debchange -lluqman
# dpkg-buildpackage -rfakeroot -uc -b
# ~/valo/qemu-bionic/qemu-2.11+dfsg/debian/qemu-system-x86/usr/bin/qemu-system-x86_64
# qemu-img create -f qcow2 base.img 60G
# qemu-img create -f qcow2 -F qcow2 -b base.img snapshot.img
#cp /usr/share/OVMF/OVMF_CODE.fd .
#cp /usr/share/OVMF/OVMF_VARS.fd .
#sudoip tuntap add dev valonet mode tap
#sudoip link set dev valonet master vmbr
#sudoip link set dev valonet up
#sudo ip link set dev valonet nomaster
#sudo ip link del valonet
# -drive if=pflash,format=raw,readonly,file=/home/luqman/valo/OVMF_CODE.fd \
# -drive if=pflash,format=raw,file=/home/luqman/valo/OVMF_VARS.fd \
# -device ide-cd,drive=installdisk,id=cd-disk1,unit=0,bus=ide.0 \
# -drive file=/lfs/ISOs/OSs/en_windows_10_business_editions_version_2004_updated_nov_2020_x64_dvd_29ee42db.iso,if=none,id=installdisk,media=cdrom \
# -device ide-cd,drive=virtio-disk,id=cd-disk2,unit=0,bus=ide.1 \
# -drive file=/lfs/ISOs/Support/virtio-win.iso,if=none,id=virtio-disk,media=cdrom \
# Newer QEMU
# -audiodev pa,id=hda,server=localhost,out.stream-name=valovm \
# -device intel-hda -device hda-duplex,audiodev=hda \
# Skylake-Client-noTSX-IBRS
echo -n "Binding GFX Card..."
fordevin"0000:01:00.0""0000:01:00.1";do
vendor=$(cat /sys/bus/pci/devices/${dev}/vendor)
device=$(cat /sys/bus/pci/devices/${dev}/device)
if [ -e /sys/bus/pci/devices/${dev}/driver ];then
echo"${dev}"| tee /sys/bus/pci/devices/${dev}/driver/unbind > /dev/null
while [ -e /sys/bus/pci/devices/${dev}/driver ];do
sleep 0.1
done
fi
echo"${vendor}${device}"| tee /sys/bus/pci/drivers/vfio-pci/new_id > /dev/null
done
echo"done"
export QEMU_AUDIO_DRV=pa
export QEMU_PA_SERVER="tcp:luq-home-pc:4713 tcp6:luq-home-pc:4713"
export QEMU_PA_ADJUST_LATENCY_IN=0
#/usr/bin/qemu-system-x86_64 \
/home/luqman/valo/qemu-bionic/qemu-2.11+dfsg/debian/qemu-system-x86/usr/bin/qemu-system-x86_64 \
-name guest=valo,debug-threads=on \
-serial none \
-enable-kvm \
-nodefaults \
-no-user-config \
-M q35,accel=kvm,kernel_irqchip=on,mem-merge=off \
-m 8192 -mem-prealloc -no-hpet \
-cpu host,kvm=off,l3-cache=on,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=3dfx,+invtsc \
-smp 8,sockets=1,cores=4,threads=2 \
-smbios 'type=0,vendor=American Megatrends Inc.,version=F2b,date=10/26/2017,release=5.12' \
-smbios 'type=1,manufacturer=Gigabyte Technology Co.,, Ltd.,product=Z370N WIFI,uuid=ec1fcce2-283f-41da-bf77-c177d8f3ecfd' \
-global kvm-pit.lost_tick_policy=discard \
-rtc base=localtime \
-boot order=c \
-usb \
-device pcie-root-port,bus=pcie.0,id=root_port1,chassis=0,slot=0 \
-device vfio-pci,host=01:00.0,id=hostdev1,bus=root_port1,addr=0x00,multifunction=on \
-device vfio-pci,host=01:00.1,id=hostdev2,bus=root_port1,addr=0x00.1 \
-drive if=pflash,format=raw,readonly,file=/home/luqman/valo/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/luqman/valo/OVMF_VARS.fd \
-drive if=none,id=drivec,file=/home/luqman/valo/snapshot.img,format=qcow2,cache=none,aio=threads \
-object iothread,id=iothread1 \
-device virtio-blk-pci,drive=drivec,scsi=off,iothread=iothread1 \
-monitor unix:/tmp/monitor.sock,server,nowait \
-device virtio-mouse-pci,id=input0 \
-device virtio-keyboard-pci,id=input1 \
-object input-linux,id=kbd1,evdev=/dev/input/by-id/usb-DELL_Alienware_Advanced_Gaming_Keyboard_AW568_000000000000-if01-event-kbd,grab_all=yes,repeat=on \
-object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse \
-netdev tap,ifname=valonet,id=net0,script=no,downscript=no \
-device e1000,netdev=net0,mac=52:54:00:2f:60:f6 \
-device ich9-intel-hda -device hda-duplex
valo.xml
<domainxmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"type="kvm">
<name>valo</name>
<uuid>a1948fa9-3945-491e-a07e-cde9ba4a0ece</uuid>
<title>Valorant VM</title>
<metadata>
<libosinfo:libosinfoxmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:osid="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memoryunit="KiB">8388608</memory>
<currentMemoryunit="KiB">8388608</currentMemory>
<vcpuplacement="static">8</vcpu>
<iothreads>1</iothreads>
<cputune>
<vcpupinvcpu="0"cpuset="2"/>
<vcpupinvcpu="1"cpuset="8"/>
<vcpupinvcpu="2"cpuset="3"/>
<vcpupinvcpu="3"cpuset="9"/>
<vcpupinvcpu="4"cpuset="4"/>
<vcpupinvcpu="5"cpuset="10"/>
<vcpupinvcpu="6"cpuset="5"/>
<vcpupinvcpu="7"cpuset="11"/>
<emulatorpincpuset="0,6"/>
<iothreadpiniothread="1"cpuset="0,6"/>
</cputune>
<os>
<typearch="x86_64"machine="pc-q35-2.11">hvm</type>
<loaderreadonly="yes"type="pflash">/usr/share/OVMF/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/valo_VARS.fd</nvram>
</os>
<features>
<acpi/>
<apic/>
<hyperv>
<relaxedstate="on"/>
<vapicstate="on"/>
<spinlocksstate="on"retries="8191"/>
<vpindexstate="on"/>
<runtimestate="on"/>
<synicstate="on"/>
<stimerstate="on"/>
<vendor_idstate="on"value="SHHHHHHHHHHH"/>
<evmcsstate="off"/>
</hyperv>
<kvm>
<hiddenstate="on"/>
</kvm>
<vmportstate="off"/>
<ioapicdriver="kvm"/>
</features>
<cpumode="host-passthrough"check="none">
<topologysockets="1"cores="4"threads="2"/>
<cachemode="passthrough"/>
<featurepolicy="require"name="invtsc"/>
</cpu>
<clockoffset="localtime">
<timername="rtc"present="no"tickpolicy="catchup"/>
<timername="pit"present="no"tickpolicy="discard"/>
<timername="hpet"present="no"/>
<timername="kvmclock"present="no"/>
<timername="hypervclock"present="yes"/>
<timername="tsc"present="yes"mode="native"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-memenabled="no"/>
<suspend-to-diskenabled="no"/>
</pm>
<devices>
<emulator>/usr/local/bin/qemu-2.11-system-x86_64</emulator>
<disktype="file"device="disk">
<drivername="qemu"type="qcow2"cache="writeback"io="threads"/>
<sourcefile="/var/lib/libvirt/images/valo.qcow2"/>
<targetdev="vda"bus="virtio"/>
<bootorder="1"/>
<addresstype="pci"domain="0x0000"bus="0x03"slot="0x00"function="0x0"/>
</disk>
<controllertype="usb"index="0"model="qemu-xhci"ports="15">
<addresstype="pci"domain="0x0000"bus="0x02"slot="0x00"function="0x0"/>
</controller>
<controllertype="sata"index="0">
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x1f"function="0x2"/>
</controller>
<controllertype="pci"index="0"model="pcie-root"/>
<controllertype="pci"index="1"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="1"port="0x8"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x0"multifunction="on"/>
</controller>
<controllertype="pci"index="2"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="2"port="0x9"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x1"/>
</controller>
<controllertype="pci"index="3"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="3"port="0xa"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x2"/>
</controller>
<controllertype="pci"index="4"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="4"port="0xb"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x3"/>
</controller>
<controllertype="pci"index="5"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="5"port="0xc"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x4"/>
</controller>
<controllertype="pci"index="6"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="6"port="0xd"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x5"/>
</controller>
<controllertype="pci"index="7"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="7"port="0xe"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x6"/>
</controller>
<controllertype="pci"index="8"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="8"port="0xf"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x01"function="0x7"/>
</controller>
<controllertype="pci"index="9"model="pcie-root-port">
<modelname="pcie-root-port"/>
<targetchassis="9"port="0x10"/>
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x02"function="0x0"/>
</controller>
<interfacetype="network">
<macaddress="52:54:00:eb:de:68"/>
<sourcenetwork="guest-vm-net"/>
<modeltype="e1000e"/>
<addresstype="pci"domain="0x0000"bus="0x01"slot="0x00"function="0x0"/>
</interface>
<serialtype="pty">
<targettype="isa-serial"port="0">
<modelname="isa-serial"/>
</target>
</serial>
<consoletype="pty">
<targettype="serial"port="0"/>
</console>
<inputtype="keyboard"bus="virtio">
<addresstype="pci"domain="0x0000"bus="0x07"slot="0x00"function="0x0"/>
</input>
<inputtype="mouse"bus="virtio">
<addresstype="pci"domain="0x0000"bus="0x08"slot="0x00"function="0x0"/>
</input>
<inputtype="mouse"bus="ps2"/>
<inputtype="keyboard"bus="ps2"/>
<soundmodel="ich9">
<addresstype="pci"domain="0x0000"bus="0x00"slot="0x1b"function="0x0"/>
</sound>
<hostdevmode="subsystem"type="pci"managed="yes">
<source>
<addressdomain="0x0000"bus="0x01"slot="0x00"function="0x0"/>
</source>
<addresstype="pci"domain="0x0000"bus="0x04"slot="0x00"function="0x0"/>
</hostdev>
<hostdevmode="subsystem"type="pci"managed="yes">
<source>
<addressdomain="0x0000"bus="0x01"slot="0x00"function="0x1"/>
</source>
<addresstype="pci"domain="0x0000"bus="0x05"slot="0x00"function="0x0"/>
</hostdev>
<memballoonmodel="virtio">
<addresstype="pci"domain="0x0000"bus="0x06"slot="0x00"function="0x0"/>
</memballoon>
</devices>
<qemu:commandline>
<qemu:argvalue="-object"/>
<qemu:argvalue="input-linux,id=kbd1,evdev=/dev/input/by-id/usb-DELL_Alienware_Advanced_Gaming_Keyboard_AW568_000000000000-if01-event-kbd,grab_all=yes,repeat=on"/>
<qemu:argvalue="-object"/>
<qemu:argvalue="input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"/>
<qemu:argvalue="-smbios"/>
<qemu:argvalue="type=0,vendor=American Megatrends Inc.,version=F2b,date=10/26/2017,release=5.12"/>
<qemu:argvalue="-smbios"/>
<qemu:argvalue="type=1,manufacturer=Gigabyte Technology Co.,, Ltd.,product=Z370N WIFI,uuid=ec1fcce2-283f-41da-bf77-c177d8f3ecfd"/>
<qemu:envname="QEMU_AUDIO_DRV"value="pa"/>
<qemu:envname="QEMU_PA_SERVER"value="tcp:luq-home-pc:4713 tcp6:luq-home-pc:4713"/>
<qemu:envname="QEMU_PA_ADJUST_LATENCY_IN"value="0"/>
</qemu:commandline>
</domain>

Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>