def _get_localhost_ssh_port():
for line in _get_vm_config():<EOL><INDENT>if line.startswith('<STR_LIT>'):<EOL><INDENT>spec = line.split('<STR_LIT:=>')[<NUM_LIT:1>].strip('<STR_LIT:">')<EOL>name, protocol, host, host_port, target, target_port = spec.split('<STR_LIT:U+002C>')<EOL>if name == '<STR_LIT>' and protocol == '<STR_LIT>' and target_port == '<STR_LIT>':<EOL><INDENT>return host_port<EOL><DEDENT><DEDENT><DEDENT>raise ValueError('<STR_LIT>')<EOL>
Something in the VM chain, either VirtualBox or Machine, helpfully
    sets up localhost-to-VM forwarding on port 22. We can inspect this
    rule to determine the port on localhost which gets forwarded to
    22 in the VM.