You can make a (semi) dedicated, collapsing work bench out of a 2"x12" or 2"x10". Cut your worktop to a length which is stowable somewhere onboard, & then use the rest of the board to make 2 legs.
You attach the legs with hinges; piano, door, or quick detaching, & they can fold up underneath of the part which you sit on. That, or if you use quick detaching hinges, then the legs are removable.
The final piece, is a longitudinal to fit between the legs when they're folded down, so that they stay in a locked open position.
A picture of which can be found in Bruce Bingham's The Sailor's Sketchbook.
The longitudinal for the bench's legs, plus his version of a workbench. Albeit I don't thik that his version is collapsable, or multi-mountable.
And of course, on one end, you can mount the vise. Permanently, or not. That, & if you go with the detachable legs route
, you can design it so that the worktop portion fits/can be bolted to one, or several locations in/on the boat. Be it in the V-berth, akin to what Ann describes. Or to a certain spot in the cockpit.
Plus, it's mobile. You can take it ashore, or over to another boat for a job, in a snap.
Or, there are the pre-made variants. Arguably less sturdy, but still handy:
Black & Decker's folding Workmate's.
And Brion Toss's "Utility Vise", the BTYR VISE - Z-Vise Brion Toss Yacht Riggers, Sailboat Rigging::Rigging Tools