Added automatic establishment and closure of connection to hypervisor