code: def set_vmname(self, vmname):
          
  
          if vmname == self._vmname:
              return
  
          if self.linked_clone:
              if self.status == "started":
                  raise VirtualBoxError("You can't change the name of running VM {}".format(self._name))
              # We can't rename a VM to name that already exists
              vms = yield from self.manager.list_vms(allow_clone=True)
              if vmname in [vm["vmname"] for vm in vms]:
                  raise VirtualBoxError("You can't change the name to {} it's already use in VirtualBox".format(vmname))
              yield from self._modify_vm('--name "{}"'.format(vmname))
  
          log.info("VirtualBox VM '{name}' [{id}] has set the VM name to '{vmname}'".format(name=self.name, id=self.id, vmname=vmname))
          self._vmname = vmname
docs: Renames the VirtualBox VM.
  
          :param vmname: VirtualBox VM name