Start the GNS3 VM.
323169
def start(self):
        

        # get a NAT interface number
        nat_interface_number = yield from self._look_for_interface("nat")
        if nat_interface_number < 0:
            raise GNS3VMError("The GNS3 VM: {} must have a NAT interface configured in order to start".format(self.vmname))

        hostonly_interface_number = yield from self._look_for_interface("hostonly")
        if hostonly_interface_number < 0:
            raise GNS3VMError("The GNS3 VM: {} must have a host only interface configured in order to start".format(self.vmname))

        vboxnet = yield from self._look_for_vboxnet(hostonly_interface_number)
        if vboxnet is None:
            raise GNS3VMError("VirtualBox host-only network could not be found for interface {} on GNS3 VM".format(hostonly_interface_number))

        if not (yield from self._check_dhcp_server(vboxnet)):
            raise GNS3VMError("DHCP must be enabled on VirtualBox host-only network: {} for GNS3 VM".format(vboxnet))

        vm_state = yield from self._get_state()
        log.info('"{}" state is {}'.format(self._vmname, vm_state))

        if vm_state == "poweroff":
            yield from self.set_vcpus(self.vcpus)
            yield from self.set_ram(self.ram)

        if vm_state in ("poweroff", "saved"):
            # start the VM if it is not running
            args = [self._vmname]
            if self._headless:
                args.extend(["--type", "headless"])
            yield from self._execute("startvm", args)
        elif vm_state == "paused":
            args = [self._vmname, "resume"]
            yield from self._execute("controlvm", args)
        ip_address = "127.0.0.1"
        try:
            # get a random port on localhost
            with socket.socket() as s:
                s.bind((ip_address, 0))
                api_port = s.getsockname()[1]
        except OSError as e:
            raise GNS3VMError("Error while getting random port: {}".format(e))

        if (yield from self._check_vbox_port_forwarding()):
            # delete the GNS3VM NAT port forwarding rule if it exists
            log.info("Removing GNS3VM NAT port forwarding rule from interface {}".format(nat_interface_number))
            yield from self._execute("controlvm", [self._vmname, "natpf{}".format(nat_interface_number), "delete", "GNS3VM"])

        # add a GNS3VM NAT port forwarding rule to redirect 127.0.0.1 with random port to port 3080 in the VM
        log.info("Adding GNS3VM NAT port forwarding rule with port {} to interface {}".format(api_port, nat_interface_number))
        yield from self._execute("controlvm", [self._vmname, "natpf{}".format(nat_interface_number),
                                               "GNS3VM,tcp,{},{},,3080".format(ip_address, api_port)])

        self.ip_address = yield from self._get_ip(hostonly_interface_number, api_port)
        self.port = 3080
        log.info("GNS3 VM has been started with IP {}".format(self.ip_address))
        self.running = True
1329627
def start(self, ccallbacks=None):
        """"""

        self.__manage_g = gevent.spawn(self.__manage_connections, ccallbacks)
        self.__ready_ev.wait()
90530
def start():
    '''
    
    '''
    from wsgiref.simple_server import make_server

    # When started outside of salt-api __opts__ will not be injected
    if '__opts__' not in globals():
        globals()['__opts__'] = get_opts()

        if __virtual__() is False:
            raise SystemExit(1)

    mod_opts = __opts__.get(__virtualname__, {})

    # pylint: disable=C0103
    httpd = make_server('localhost', mod_opts['port'], application)

    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        raise SystemExit(0)
249290
def init():
    """"""
    if not os.path.isdir('venv'):
        print(cyan('\nCreating the virtual env...'))

        local('pyvenv-3.4 venv')

        print(green('Virtual env created.'))

    print(green('Virtual Environment ready.'))
536378
def run_init(device_type, args):
    """"""
    util.setup_logging(verbosity=args.verbose)
    log.warning('This GPG tool is still in EXPERIMENTAL mode, '
                'so please note that the API and features may '
                'change without backwards compatibility!')

    verify_gpg_version()

    # Prepare new GPG home directory for hardware-based identity
    device_name = os.path.basename(sys.argv[0]).rsplit('-', 1)[0]
    log.info('device name: %s', device_name)
    homedir = args.homedir
    if not homedir:
        homedir = os.path.expanduser('~/.gnupg/{}'.format(device_name))

    log.info('GPG home directory: %s', homedir)

    if os.path.exists(homedir):
        log.error('GPG home directory %s exists, '
                  'remove it manually if required', homedir)
        sys.exit(1)

    check_call(['mkdir', '-p', homedir])
    check_call(['chmod', '700', homedir])

    agent_path = util.which('{}-gpg-agent'.format(device_name))

    # Prepare GPG agent invocation script (to pass the PATH from environment).
    with open(os.path.join(homedir, 'run-agent.sh'), 'w') as f:
        f.write(r"""#!/bin/sh
export PATH={0}
{1} \
-vv \
--pin-entry-binary={pin_entry_binary} \
--passphrase-entry-binary={passphrase_entry_binary} \
--cache-expiry-seconds={cache_expiry_seconds} \
$*
""".format(os.environ['PATH'], agent_path, **vars(args)))
    check_call(['chmod', '700', f.name])
    run_agent_script = f.name

    # Prepare GPG configuration file
    with open(os.path.join(homedir, 'gpg.conf'), 'w') as f:
        f.write("""# Hardware-based GPG configuration
agent-program {0}
personal-digest-preferences SHA512
default-key \"{1}\"
""".format(run_agent_script, args.user_id))

    # Prepare a helper script for setting up the new identity
    with open(os.path.join(homedir, 'env'), 'w') as f:
        f.write("""#!/bin/bash
set -eu
export GNUPGHOME={0}
COMMAND=$*
if [ -z "${{COMMAND}}" ]
then
    ${{SHELL}}
else
    ${{COMMAND}}
fi
""".format(homedir))
    check_call(['chmod', '700', f.name])

    # Generate new GPG identity and import into GPG keyring
    pubkey = write_file(os.path.join(homedir, 'pubkey.asc'),
                        export_public_key(device_type, args))
    verbosity = ('-' + ('v' * args.verbose)) if args.verbose else '--quiet'
    check_call(keyring.gpg_command(['--homedir', homedir, verbosity,
                                    '--import', pubkey.name]))

    # Make new GPG identity with "ultimate" trust (via its fingerprint)
    out = check_output(keyring.gpg_command(['--homedir', homedir,
                                            '--list-public-keys',
                                            '--with-fingerprint',
                                            '--with-colons']))
    fpr = re.findall('fpr:::::::::([0-9A-F]+):', out)[0]
    f = write_file(os.path.join(homedir, 'ownertrust.txt'), fpr + ':6\n')
    check_call(keyring.gpg_command(['--homedir', homedir,
                                    '--import-ownertrust', f.name]))

    # Load agent and make sure it responds with the new identity
    check_call(keyring.gpg_command(['--homedir', homedir,
                                    '--list-secret-keys', args.user_id]))
1180574
def start(self):
        '''
        
        '''
        if self.use_xauth:
            self._setup_xauth()
        EasyProcess.start(self)

        # https://github.com/ponty/PyVirtualDisplay/issues/2
        # https://github.com/ponty/PyVirtualDisplay/issues/14
        self.old_display_var = os.environ.get('DISPLAY', None)

        self.redirect_display(True)

        # wait until X server is active
        start_time = time.time()
        ok = False
        d = self.new_display_var
        while time.time() - start_time < X_START_TIMEOUT:
            try:
                exit_code = EasyProcess('xdpyinfo').call().return_code
            except EasyProcessError:
                log.warn('xdpyinfo was not found, X start can not be checked! Please install xdpyinfo!')
                time.sleep(X_START_WAIT)    # old method
                ok = True
                break

            if exit_code != 0:
                pass
            else:
                log.info('Successfully started X with display "%s".', d)
                ok = True
                break

            time.sleep(X_START_TIME_STEP)
        if not ok:
            msg = 'Failed to start X on display "%s" (xdpyinfo check failed).'
            raise XStartTimeoutError(msg % d)
        return self
383451
def Start(self):
    """"""
    self.state.shadows = []
    self.state.raw_device = None

    self.CallClient(
        server_stubs.WmiQuery,
        query="SELECT * FROM Win32_ShadowCopy",
        next_state="ListDeviceDirectories")
893480
def _set_vcpus_ram(self, vcpus, ram):
        

        # memory must be a multiple of 4 (VMware requirement)
        if ram % 4 != 0:
            raise GNS3VMError("Allocated memory {} for the GNS3 VM must be a multiple of 4".format(ram))

        available_vcpus = psutil.cpu_count(logical=False)
        if vcpus > available_vcpus:
            raise GNS3VMError("You have allocated too many vCPUs for the GNS3 VM! (max available is {} vCPUs)".format(available_vcpus))

        try:
            pairs = VMware.parse_vmware_file(self._vmx_path)
            pairs["numvcpus"] = str(vcpus)
            pairs["memsize"] = str(ram)
            VMware.write_vmx_file(self._vmx_path, pairs)
            log.info("GNS3 VM vCPU count set to {} and RAM amount set to {}".format(vcpus, ram))
        except OSError as e:
            raise GNS3VMError('Could not read/write VMware VMX file "{}": {}'.format(self._vmx_path, e))
497235
def start(self, device):
        

        super(NativeBLEVirtualInterface, self).start(device)
        self.set_advertising(True)
304668
def run(self, **options):
        """"""
        if not self.is_setup:
            self.setup()

        if self.twisted:
            self.run_with_twisted(**options)
        elif self.gunicorn:
            self.run_with_gunicorn(**options)
        else:
            self.run_with_werkzeug(**options)
249884
def begin(self, vccstate=SSD1306_SWITCHCAPVCC):
        """"""
        # Save vcc state.
        self._vccstate = vccstate
        # Reset and initialize display.
        self.reset()
        self._initialize()
        # Turn on the display.
        self.command(SSD1306_DISPLAYON)
31691
function start() {
      // Listen to the port
      app.listen(hrsConfigs.port, function (err) {
        if (err) {
          info(err);
        }
        info('Running on http://%s:%s', hrsConfigs.address, hrsConfigs.port);
      });
    }
1220748
def _import_gns3_gui_conf(self):
        
        config_file = os.path.join(os.path.dirname(self._config_file), "gns3_gui.conf")
        if os.path.exists(config_file):
            with open(config_file) as f:
                data = json.load(f)
                server_settings = data.get("Servers", {})
                for remote in server_settings.get("remote_servers", []):
                    try:
                        yield from self.add_compute(
                            host=remote.get("host", "localhost"),
                            port=remote.get("port", 3080),
                            protocol=remote.get("protocol", "http"),
                            name=remote.get("url"),
                            user=remote.get("user"),
                            password=remote.get("password")
                        )
                    except aiohttp.web.HTTPConflict:
                        pass  # if the server is broken we skip it
                if "vm" in server_settings:
                    vmname = None
                    vm_settings = server_settings["vm"]
                    if vm_settings["virtualization"] == "VMware":
                        engine = "vmware"
                        vmname = vm_settings.get("vmname", "")
                    elif vm_settings["virtualization"] == "VirtualBox":
                        engine = "virtualbox"
                        vmname = vm_settings.get("vmname", "")
                    else:
                        engine = "remote"
                        # In case of remote server we match the compute with url parameter
                        for compute in self._computes.values():
                            if compute.host == vm_settings.get("remote_vm_host") and compute.port == vm_settings.get("remote_vm_port"):
                                vmname = compute.name

                    if vm_settings.get("auto_stop", True):
                        when_exit = "stop"
                    else:
                        when_exit = "keep"

                    self.gns3vm.settings = {
                        "engine": engine,
                        "enable": vm_settings.get("auto_start", False),
                        "when_exit": when_exit,
                        "headless": vm_settings.get("headless", False),
                        "vmname": vmname
                    }
                self._settings = {}
672452
def _work(self):
        """"""
        super(HyperVNeutronAgent, self)._work()
        if self._nvgre_enabled:
            self._nvgre_ops.refresh_nvgre_records()
        self._port_enable_control_metrics()
495443
def start
      if ENV['rvm_path']
        sh "rvmsudo vhost run #{run_options}"
      else
        vhost = File.expand_path('../../bin/vhost', __dir__)
        sh "bundle exec sudo env PATH=#{ENV['PATH']} #{vhost} run #{run_options}"
      end
      sleep 1
      self.device = @device if @device
    end
1065511
def start(self):
		""""""
		if self._send_greenlet is None:
			self._send_greenlet = gevent.spawn(self._send_loop)
878056
def _start_instance(self):
        
        try:
            vm_start = self.compute.virtual_machines.start(
                self.running_instance_id, self.running_instance_id
            )
        except Exception as error:
            raise AzureCloudException(
                'Unable to start instance: {0}.'.format(error)
            )

        vm_start.wait()