Vmware Workstation Linux Not Working

I recently got a new laptop and I tried getting VMware Workstation working on my new machine since I'll need VMs for things from time to time, i keep running into issues after installation because the kernel modules won't build. In the file /tmp/vmware-$USER/vmware-13985.log i see the following error

2024-07-12T20:47:58.913Z In(05) host-13985   The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0

2024-07-12T20:47:58.913Z In(05) host-13985   You are using:           gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0


This makes no sense, those are both THE SAME gcc version. After furiously searching on Google, i was finally able to come across this forum posting: https://discussion.fedoraproject.org/t/cannot-compile-vmware-workstation-modul-after-upgrade-kernel-5-14-9/77525/12


Below is the solution in case for some reason im no longer able to access this forum:

git clone https://github.com/mkubecek/vmware-host-modules.git

cd vmware-host-modules

git checkout workstation-16.1.2 #I think this is optional

make

sudo make install

sudo systemctl restart vmware.service