I've installed Ubuntu 16.04 and the latest version of V-REP on a desktop computer that we plan to use as a server. I am trying to get V-REP to run headless so that we can ssh in and run headless simulations. I can get it to run headless if I am logged in locally, but nothing will work over ssh.

When you start V-REP in headless mode, you basically run the exact same binaries as the V-REP with GUI. It is not a true headless version of V-REP. I see currently two possibilities:

You can try to run with different graphic settings and see if this makes a difference. Have a look at file system/usrset.txt. In there, try out different values for offscreenContextType, fboType, forceFboViaExt and vboOperation.

You can recompile V-REP in true headless mode by compiling V-REP with the makefile_noGui_noGl makefile. In that case however, vision sensors will only work if they rely on a plugin for image generation (e.g. v_repExtPovRay).