I personally recommend the Aten US224 - I've found it has the best compatibility out of the cheaper devices for this (there are variants that can be connected to more than 2 machines as well).
Synergy does this not used it myself but seems to get good reviews and works on different OS's aswell
https://symless.com/synergy