161 Commits

Author SHA1 Message Date
Jared J
f09714d0a1 pinVcpus partial rewrite with new functions.
Add function getQemuThreads for future functions to request the pid's
tasklist.
2023-09-20 12:54:15 +10:00
Jared J
1e68f5d3ae Add missing pid argument to getVcpuCount 2023-09-17 10:32:43 +10:00
Jared J
622a11b568 Move pinVcpus chrt step to own function setPidPrio 2023-09-17 10:29:30 +10:00
Jared J
9b8e0d8bf9 Rename checkVcpuCount function to getVcpus and add replacement. 2023-09-16 20:40:59 +10:00
Jared J
8a4a157b00 Minor dry check change for the permissions manager 2023-09-14 12:50:10 +10:00
Jared J
e52c509487 Add -noBios/-legacy/-legacyboot boot option.
For supporting MBR boot options.
2023-09-14 12:47:52 +10:00
Jared J
a8f1b900f8 Fix usage of -secureBoot alone not using secboot 2023-05-29 18:55:01 +10:00
Jared J
65bc5377b1 Add -force to have the script try and continue
For special cases where one may wish to continue
running (despite errors) in the name of debugging.
2023-05-29 09:07:20 +10:00
Jared J
75853dee7c Add script issue tracker to bridging function 2023-05-04 11:01:38 +10:00
Jared J
9637ba183e Change bridging error text, improve logic 2023-05-04 10:42:19 +10:00
Jared J
a21cfc3a51 Drop test branch. Not ready. Accidental commit 2023-04-29 21:14:10 +10:00
Jared J
50cf4cb35e Add kvm check with helpful troubleshooting output
Had commit f04352397e18c7bcdf2e625f23c623f82cf01f72 from the ubuntu
branch Tue Mar 1 21:55:03 2022 +1100 however it is so far out of date at
this point (And the check so basic) it's not worth porting.

Made this check which responds if /dev/kvm is missing as the script
needs it. If the script can't get the kvm modules going it'll comb dmesg
for pointers to help the user solve the issue when applicable.
2023-04-29 21:07:52 +10:00
Jared J
d51f98ff5c Fix some broken print colors and some indendation. 2023-04-29 19:27:15 +10:00
Jared J
9935b9864a Implement more compatible host cpu+thread counter.
Including superior guest thread printing for when `-pinvcpus` isn't used.
and a better hyperthreading check, long overdue.
2023-04-29 19:24:56 +10:00
Jared J
1ed9fd4454 Guest cpu allocation more clear without -pinvcpus 2023-04-29 15:46:32 +10:00
Jared J
2cb55a5729 Update README.md 2023-03-14 10:46:36 +11:00
Jared J
f0e81f2897 Update README.md 2023-03-14 10:42:28 +11:00
Jared J
5c8d4c3256 Typo fixup 2023-03-14 10:04:29 +11:00
Jared J
075055dd4b Set guest CPUs to be half of host when unspecified
Discussed in issue#15
2023-02-05 20:07:22 +11:00
Jared J
fd0bb564e7 No need to shift -killx 2023-02-05 17:16:36 +11:00
Jared J
75988c56ba Add sudo to looking-glass rm... 2023-02-05 16:57:12 +11:00
Jared J
64d739fc9d Make looking-glass shm removal automatic 2023-02-05 16:54:49 +11:00
Jared
b63578a2c5 Handle swtpm cleanup better 2023-01-08 15:00:32 +11:00
Jared J
dcc4e5c741 Wrap swtpm cleanup in curly braces
To avoid an unnecessary cleanup attempt.
2023-01-03 22:55:29 +11:00
Jared J
244d655565 Add Win11 support
Add -tpm argument to start a software TPM.

Add -secureboot argument to autosearch for an OVMF_CODE.
  Still only applicable for Archlinux but maybe I can poke
  /etc/os-release and have a lookup table to better support
  other Distros without people having to do manual arguments.

Add -biosvars to specify a unique OVMF_VARS copy for a guest to boot
with.

Add -win11 which activates both -tpm and -secureboot to get started
quickly.

Move dependency checker to own function, only check for certain deps
when a user actually uses flags relevant to them.
2023-01-03 17:57:44 +11:00
Jared J
be2c1e9a06 Drop redundant semicolons 2023-01-02 21:33:10 +11:00
Jared J
b028c137d5 Fix vfio-pci modprobe regression. 2023-01-02 20:30:25 +11:00
Jared J
e31443dbea remove duplicate dhclient dep check 2023-01-02 14:50:15 +11:00
Jared J
6843d5ee48 Add newer -iommu flag to README and script help. 0.7.1 2022-12-28 18:12:16 +11:00
Jared J
d2a122b213 Fix temp trouble in PCI rebinding.
Some script cleanup also.
2022-12-28 11:16:13 +11:00
Jared J
02042d5261 Advise on vfio-pci module issue if new kernel seen. 2022-12-28 10:40:20 +11:00
Jared J
cdb388b9f7 Further script cleanup. Improve PCI output details 2022-12-28 09:07:52 +11:00
Jared J
832c02ec9a Fix inconsistent description on port forwarding
Now uses colons
2022-12-23 18:09:56 +11:00
Jared J
9b65d36c4a Fix Xorg detection before going after other pids. 2022-12-23 10:06:07 +11:00
Jared J
456be31db7 Print less for dry PCI enumeration 2022-12-23 10:05:20 +11:00
Jared J
1fcdecb6a9 Add sudo to fuser.
To see Xorg if present on certain configurations.
2022-12-23 10:05:20 +11:00
Jared J
af8e1fc930 Fix hugepage allocation in special circumstances
Clean up some of the script
2022-12-23 10:05:20 +11:00
Jared J
b75fed023e Multi-GPU VFIO without killing X PCI funct rewrite
+ Cleaned up some hyperlinks in README.md
+ Added new documentation area regarding helpful config info and tips on how to do VFIO on a PC with two GPUs without killing X on the primary GPU.
  Including an xorg.conf example for Nvidia and coverage regarding certain configurations
+ Remade some of the subfunctions in `enumeratePCIs` to better handle unbinding a GPU dynamically, when IN USE by the host's X server, or a child process of one.
+ Added new flag -killX for when a user is OK with killing X to start their VM (Would be needed for Single GPU Passthrough anyway)

Some important changes:

1. The script now checks for all open handles on a GPU dynamically and doesn't necessarily have to kill Xorg if your X server has been configured to only use one GPU and leave others alone (Sample xorg configuration included in README.md!).

   This is designed to support graphical sessions which have been configured to use only one card and leave the other alone (Or however many cards you have).

   Taking advantange of this update means you can have two GPUs (same model even; doesn't matter), both bound to the NVIDIA driver but your X session is only using one. With this configuration you can still use both cards in CUDA operations, but can also unbind your second GPU at any time without losing your graphical environment!

2.  The script will however kill any processes that are using a GPU intended for the guest which are not Xorg (Firefox, Chrome, xdg-desktop-portal-gnome, others love to touch hardware X was told to ignore). The script attempts to start these back up for you after your guest GPU is successfully bound to vfio-pci, if it gets there.
2022-12-23 10:05:20 +11:00
Jared J
f19c6f105b Add -iommu extra optional flag to check groups.
Also move iommu active check to own function. Improved its text for when
something doesn't look right.
2022-12-23 10:03:49 +11:00
Jared J
c8bc8fa702 Only check for IOMMU when doing PCI passthrough 2022-12-23 09:49:57 +11:00
Jared J
4102527d87 Add -portforward 2022-12-11 13:59:12 +11:00
Jared J
908e89f976 iothread clarification 2022-12-05 10:27:37 +11:00
Jared J
8fa1ce0b1f Update README.md
Of course I notice errors only immediately after I've set a release.
2022-12-04 23:41:53 +11:00
Jared J
dd22f19458 Create LICENSE 0.7 2022-12-04 23:18:50 +11:00
Jared J
c2d354d98e Cleaning
Tidyup
2022-12-04 23:16:21 +11:00
Jared J
258b8e8558 Usual spring cleanup of old stuff. Some new stuff.
0. A couple function name changes here and there. Script documentation brushup too.

1. added flags [-avoidVirtio/-noVirtio] to use generic virtual hardware such as e1000e for guest Ethernet among other comprompises for special cases.
   * If you don't have the virtio ISO handy during installation or are booting a kernel/initrd directly without virtio drivers baked in, this is a savior.

2. Added flags [-cputhreads / -showpairs / -showthreads / -showcpu] to easily and quickly show host CPU core thread pairings on the fly.

4. Added flags [-ignorevtcon / -ignoreframebuffer / -leavefb / -leaveframebuffer / -leavevtcon] optional workaround for kernel Bug 216475 on Nvidia cards.
   * (Unbinding and rebinding vtcon0/1 causes a null pointer dereference in fbcon.c with certain video drivers).
   * With this my 2080Ti can go from guest to host login screen again as many times as I want in a boot,
   * at the cost of the virtual consoles on my single gpu setup.
   * I like my virtual consoles though so hopefully this is fixed soon.

5. Squashed vcpu pinning bug introduced in earlier commit (Had the ampersand in the wrong spot, damn)
2022-12-04 23:06:19 +11:00
Jared J
9b5ea0b302 More formatting cleanup for the argument parser 2022-11-30 15:52:14 +11:00
Jared J
2629feee7f Add ss call to pick next available spice port.
For looking glass if other VMs runniing.
Will need further work to support multiple guests using looking glass at once.
2022-11-30 02:09:29 +11:00
Jared J
532d98e1a0 Add -kernel, -cmdline and -initrd options. 2022-11-30 01:47:39 +11:00
Jared J
b16c7cd373 Add -m as memory shorthand option. 2022-11-29 23:23:07 +11:00