I'm using the latest version of VMware Workstation (11.1.0) on Windows 7 x64 and I want to be able to do a keystroke of "Ctrl + 1" to go to VM #1, "Ctrl + 2" to go to VM #2, and "Ctrl + 3" to go to VM #3.
Sounds simple right? It isn't.
On Mac OS X, achieving this functionality is trivial with VMware Fusion in combination with Spaces / Mission Control - you can simply put each VM on a separate space and then define whatever space hotkeys you want. I'm migrating from OS X and want this same functionality.
For reference, here are some potential solutions that I've tried and can verify that they don't work:
1) AutoHotkey
AutoHotkey can be used to make hotkeys like so:
^1::WinActivate, Win7(1) - VMware Workstation
^2::WinActivate, Win7(2) - VMware Workstation
^3::WinActivate, Win7(3) - VMware Workstation
These work to enter the VMs, but not to exit; Workstation will feed the "Ctrl + 1" to the VM and AutoHotkey does not take precedence, even if AutoHotkey is run as an administrator.
2) Suspend/Unsuspend with AutoHotkey
This promising post from Nick Sturgess suggests that suspending and that unsuspending AutoHotkey while the VMware window is active will fix the problem.
However, even after copying the exact code and making the necessary string modifications, I can't get it to work with Workstation.
3) Remote Desktop and/or VNC
One possible solution, if all 3 of the VMs in question were running Windows, would be to use Microsoft's Remote Desktop feature. However, one or more of the VMs that I intend to use will be running Linux.
On Linux, it is possible to just use VNC. However, VNC has considerable drawbacks when compared to the native VMware Workstation console window: there is no sound, the resolution won't automatically scale, the performance will be bad, and so forth.
Lastly, the VMs will be on 1) networks that won't be connected to the host via a bridged NIC (with the NIC disabled on the host) and 2) using a VPN without any split tunnel. So there will be no connectivity for either remote desktop or VNC in the first place.
4) A Windows Keyboard Hook
Liuk explains how to use a Windows hook to intercept keystrokes using C++ in this informative post.
However, after testing with the demo program, it seems that this method does not intercept keystrokes sent to VMware Workstation.
5) FullScreenSwitch.directKey
It seems that in VMware Workstation used to have this kind of functionality built in, as documented in this SuperUser thread.
However, VMware's documentations states that this is for VMware Workstation 5.0. I tried adding these strings to my VMX file and they had no effect, so it appears that this functionality may have been depreciated somewhere along the lines between Workstation 5 and 11.
6) PSExec
Wade Hatler mentions that he accomplishes this using PSExec to activate the appropriate AutoHotkey script on the host machine in this forum post.
This solution is questionable in that you have to keep the password of your host machine in plaintext in order to pass it to PSExec.
Regardless, this solution will not work for the reasons also described in #3 above: the VMs in question will be on 1) networks that won't be connected to the host via a bridged NIC (with the NIC disabled on the host) and 2) using a VPN without any split tunnel. So there will not be guaranteed connectivity between the host and the guest.
7) Execute a "Host" keystroke between every "Ctrl + #" keystroke
I use "Ctrl" as my VMware Workstation Host hotkey rather than the default of "Ctrl + Alt", because it is much faster to activate. Even with this optimization, I have to press and completely release Ctrl in order for input to be relinquished from a VM. Only then can I utilize my AutoHotkey hotkeys from #1 above.
This becomes problematic in the situation where I need to quickly flip through different VMs and perform a bit of work (keystrokes) on each one. The amount of keyboard input in order to switch to each VM is essentially doubled, so this is not an adequate solution.
8) Use the "Host + Left/Right Arrow" hotkey and/or VMware-KVM.exe for cycling functionality
This is problematic in that when I have 10 or more VMs open at a time, rotating through all of them becomes incredibly cumbersome and inefficient.
9) Programs that emulate OS X Spaces / Mission Control
Windows programs such as Dexpot, Desktops, and Virtual Dimensions all allow Spaces-like functionality on Windows. However, these 3 programs in particular all have the same problem that AutoHotkey has - the hotkeys to activate a particular desktop are preempted by VMware workstation and not passed to the host machine.