This will launch and configure the virtual box machine

def startup(self):
        """This will launch and configure the virtual box machine
        """

        # Do not launch the virtual machine
        if not self.browser_config.get('launch', False):
            return True

        self.info_log("Starting up...")

        try:
            vm_already_running_cmd = [
                "VBoxManage",
                "showvminfo",
                self.browser_config.get('vbname'),
                "--machinereadable",
                "|",
                "grep",
                "VMState=",
                "|",
                "cut",
                "-d'='",
                "-f2"
            ]

            output = subprocess.check_output(
                ' '.join(vm_already_running_cmd),
                stderr=subprocess.STDOUT,
                shell=True
            ).decode('utf').strip()

            print(
                "Is vm already running output: {output}"
                .format(output=output)
            )

            if output.find('running') != -1:
                return True

            # Cleanup the vbox guestproperty variable
            subprocess.call([
                'VBoxManage',
                'guestproperty',
                'delete',
                self.browser_config.get('vbname'),
                'wait_until_ready'
            ])
            subprocess.call([
                'VBoxManage',
                'guestproperty',
                'delete',
                self.browser_config.get('vbname'),
                'hub_ip'
            ])

            startvm = [
                "VBoxManage",
                "startvm",
                "'{vbname}'"
                .format(
                    vbname=self.browser_config.get('vbname')
                ),
                "--type",
                self.browser_config.get('vbox_type', 'gui')
            ]

            out = subprocess.check_output(
                ' '.join(startvm),
                stderr=subprocess.STDOUT,
                shell=True
            )
            self.info_log('VBoxManage output: {out}'.format(out=out))

            instance_ready = False
            # TODO should be configurable
            timeout = 60

            self.info_log('Waiting for instance to start...')

            for i in range(timeout):
                getproperty = [
                    'VBoxManage',
                    'guestproperty',
                    'get',
                    self.browser_config.get('vbname'),
                    'wait_until_ready'
                ]
                output = subprocess.check_output(
                    ' '.join(getproperty),
                    stderr=subprocess.STDOUT,
                    shell=True
                ).decode('utf').strip()
                self.info_log(
                    'VBoxManage guestproperty output: {output}'
                    .format(output=output)
                )

                if output.find('ready') != -1:
                    instance_ready = True
                    break

                sleep(1)

            sleep(3)
            if instance_ready:
                self.info_log('[Done] Instance ready...')
            else:
                raise Exception("Timeout error: the virtualbox machine is still not ready.")  # noqa

            # HUB IP
            hub_ip = ni.ifaddresses('en0')[2][0]['addr']

            self.info_log("Hub ip: %s" % hub_ip)

            # Start selenium on the node
            # LINUX
            if self.browser_config.get('platform').lower() == "linux":

                self.info_log('Starting the selenium node server')

                # Update the hub_ip browser config
                self.browser_config.config['hub_ip'] = hub_ip

                command = self.browser_config.get(
                    "selenium_command"
                ).format(**self.browser_config.config)
                self.execute_command(command)

            # WINDOWS
            elif self.browser_config.get('platform').lower() == "windows":

                self.info_log("Setting the guest property in Windows")

                # user_session.machine.set_guest_property(
                #     "hub_ip", "%s:%s" % (hub_ip, '4444'), ''
                # )

            return True

        except Exception as e:
            self.error_log('Exception: %s' % e)
            raise