static void attach() {
        for (VirtualMachineDescriptor virtualMachineDescriptor : VirtualMachine.list()) {
            try {
                VirtualMachine virtualMachine = virtualMachineDescriptor.provider().attachVirtualMachine(virtualMachineDescriptor);
                try {
                    String propertyName = Libra.class.getName() + ".installed";
                    Properties systemProperties = virtualMachine.getSystemProperties();
                    Properties agentProperties = virtualMachine.getAgentProperties();
                    String installed = agentProperties.getProperty(propertyName, systemProperties.getProperty(propertyName));
                    if(installed == null || Boolean.valueOf(installed) == false) {
                        String javaClassPath = systemProperties.getProperty("java.class.path");
                        String location = Libra.class.getProtectionDomain().getCodeSource().getLocation().getFile();
                        if(javaClassPath.contains(location)) {
                            virtualMachine.loadAgent(location, propertyName + "=true");
                            log.info("Libra installed in " + virtualMachineDescriptor);
                        }
                    } else {
                        log.info("Libra already installed in " + virtualMachineDescriptor);
                    }
                }
                finally {
                    virtualMachine.detach();
                }
            }
            catch(Exception e) {
                log.warning("Failed to install Libra into " + virtualMachineDescriptor + ": " + e.getMessage());
            }
        }
    }