code: def start_capture(self, adapter_number, output_file):
          
  
          try:
              adapter = self._ethernet_adapters[adapter_number]
          except KeyError:
              raise VMwareError("Adapter {adapter_number} doesn't exist on VMware VM '{name}'".format(name=self.name,
                                                                                                      adapter_number=adapter_number))
  
          nio = adapter.get_nio(0)
  
          if not nio:
              raise VMwareError("Adapter {} is not connected".format(adapter_number))
  
          if nio.capturing:
              raise VMwareError("Packet capture is already activated on adapter {adapter_number}".format(adapter_number=adapter_number))
  
          nio.startPacketCapture(output_file)
  
          if self._started:
              yield from self._start_ubridge_capture(adapter_number, output_file)
  
          log.info("VMware VM '{name}' [{id}]: starting packet capture on adapter {adapter_number}".format(name=self.name,
                                                                                                           id=self.id,
                                                                                                           adapter_number=adapter_number))
docs: Starts a packet capture.
  
          :param adapter_number: adapter number
          :param output_file: PCAP destination file for the capture