All currently supported versions of VSX are based on Linux network namespaces rather than the old VRF extensions. As long as you're running a current version, the easiest way to run a command in a given VS is this:
ip nets exec <namespace name> <command>
The namespaces have predictable names in the form CTX##### where ##### is the VSID padded out to five digits with leading zeroes. For example, VSID 4 is CTX00004 and VSID 196 is CTX00196.
For example, to run the command 'netstat -rn' in VSID 2, I use:
ip netns exec CTX00002 netstat -rn
You can get a list of all of the namespace names using 'ip nets list'. Note that this list includes switch contexts.