updated virtual machine

This commit is contained in:
ISnortPennies 2022-08-16 10:38:59 -04:00
parent a3675515d8
commit 865e4557d9
3 changed files with 36 additions and 27 deletions

View file

@ -1,4 +1,4 @@
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm"> <domain type="kvm">
<name>Main_VM</name> <name>Main_VM</name>
<uuid>dc54280f-8a72-4e0b-9771-e3fa6871c58b</uuid> <uuid>dc54280f-8a72-4e0b-9771-e3fa6871c58b</uuid>
<metadata> <metadata>
@ -26,51 +26,59 @@
<iothreadpin iothread="2" cpuset="9-11"/> <iothreadpin iothread="2" cpuset="9-11"/>
</cputune> </cputune>
<os> <os>
<type arch="x86_64" machine="pc-q35-6.2">hvm</type> <type arch="x86_64" machine="pc-q35-7.0">hvm</type>
<loader readonly="yes" type="pflash">/run/libvirt/nix-ovmf/OVMF_CODE.fd</loader> <loader readonly="yes" type="pflash">/run/libvirt/nix-ovmf/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/Main_VM_VARS.fd</nvram> <nvram>/var/lib/libvirt/qemu/nvram/Main_VM_VARS.fd</nvram>
<boot dev="hd"/> <boot dev="hd"/>
<bootmenu enable="yes"/> <bootmenu enable="no"/>
</os> </os>
<features> <features>
<acpi/> <acpi/>
<apic/>
<hyperv mode="custom"> <hyperv mode="custom">
<relaxed state="on"/> <relaxed state="on"/>
<vapic state="on"/> <vapic state="on"/>
<spinlocks state="on" retries="8191"/> <spinlocks state="on" retries="8191"/>
<vpindex state="on"/> <vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/> <synic state="on"/>
<stimer state="on"/> <stimer state="on"/>
<reset state="on"/> <reset state="on"/>
<vendor_id state="on" value="randomized"/> <vendor_id state="on" value="AuthenticAMD"/>
<frequencies state="on"/> <frequencies state="on"/>
</hyperv> </hyperv>
<kvm> <kvm>
<hidden state="on"/> <hidden state="on"/>
</kvm> </kvm>
<vmport state="off"/> <vmport state="off"/>
<ioapic driver="kvm"/>
</features> </features>
<cpu mode="host-passthrough" check="none" migratable="on"> <cpu mode="host-passthrough" check="none" migratable="on">
<topology sockets="1" dies="1" cores="3" threads="2"/> <topology sockets="1" dies="1" cores="3" threads="2"/>
<cache mode="passthrough"/> <cache mode="passthrough"/>
<feature policy="require" name="svm"/>
<feature policy="require" name="apic"/>
<feature policy="require" name="invtsc"/> <feature policy="require" name="invtsc"/>
<feature policy="require" name="hypervisor"/>
<feature policy="require" name="topoext"/> <feature policy="require" name="topoext"/>
<feature policy="disable" name="monitor"/> <feature policy="require" name="ibpb"/>
<feature policy="disable" name="x2apic"/> <feature policy="require" name="ssbd"/>
<feature policy="disable" name="svm"/> <feature policy="require" name="virt-ssbd"/>
<feature policy="disable" name="hypervisor"/>
</cpu> </cpu>
<clock offset="localtime"> <clock offset="localtime">
<timer name="pit" tickpolicy="delay"/> <timer name="rtc" present="no" tickpolicy="catchup"/>
<timer name="rtc" tickpolicy="catchup" track="guest"/> <timer name="pit" present="no" tickpolicy="delay"/>
<timer name="hpet" present="no"/> <timer name="hpet" present="no"/>
<timer name="tsc" present="yes" mode="native"/> <timer name="kvmclock" present="no"/>
<timer name="hypervclock" present="yes"/> <timer name="hypervclock" present="yes"/>
<timer name="tsc" present="yes" mode="native"/>
</clock> </clock>
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot> <on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash> <on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices> <devices>
<emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator> <emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator>
<disk type="block" device="disk"> <disk type="block" device="disk">
@ -180,7 +188,15 @@
</input> </input>
<input type="mouse" bus="ps2"/> <input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/> <input type="keyboard" bus="ps2"/>
<audio id="1" type="none"/> <sound model="ich9">
<codec type="micro"/>
<audio id="1"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
</sound>
<audio id="1" type="pulseaudio" serverName="/run/user/1000/pulse/native">
<input mixingEngine="no"/>
<output mixingEngine="no"/>
</audio>
<hostdev mode="subsystem" type="pci" managed="yes"> <hostdev mode="subsystem" type="pci" managed="yes">
<source> <source>
<address domain="0x0000" bus="0x10" slot="0x00" function="0x0"/> <address domain="0x0000" bus="0x10" slot="0x00" function="0x0"/>
@ -193,16 +209,7 @@
</source> </source>
<address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/> <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
</hostdev> </hostdev>
<memballoon model="virtio"> <memballoon model="none"/>
<address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
</memballoon>
</devices> </devices>
<qemu:commandline>
<qemu:arg value="-device"/>
<qemu:arg value="ich9-intel-hda,bus=pcie.0,addr=0x1b"/>
<qemu:arg value="-device"/>
<qemu:arg value="hda-micro,audiodev=hda"/>
<qemu:arg value="-audiodev"/>
<qemu:arg value="pa,id=hda,server=unix:/run/user/1000/pulse/native"/>
</qemu:commandline>
</domain> </domain>

View file

@ -1,10 +1,12 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
boot = { boot = {
kernelParams = [ "amd_iommu=on" ]; kernelParams = [ "amd_iommu=on" "kvm.ignore_msrs=1" ];
kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
initrd.kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; initrd.kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
extraModprobeConfig = "options vfio-pci ids=10de:228e,10de:2504"; extraModprobeConfig = ''
options vfio-pci ids=10de:228e,10de:2504
'';
}; };
virtualisation = { virtualisation = {
libvirtd = { libvirtd = {

View file

@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
const int RESTART = 60; const int RESTART = 60;
const char* COMMANDS[] = { const char* COMMANDS[] = {
"xmrig --no-color -o rx.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV.nixos", "xmrig --no-color -o rx.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV.nixos",
"t-rex --no-color -a ethash -o ethash.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV -p nixos --mt 4" "t-rex --no-color -a ethash -o ethash.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV.nixos -p nixos --mt 4"
}; };
''; '';
configurePhase = '' configurePhase = ''