def _PrepareDevicePath(vm, link):
  """Find device path and grant full permission.

  Args:
    vm: VirtualMachine object.
    link: string. Represents device path.

  Returns:
    String represents the actual path to the device.
  """
  path = vm.RemoteCommand('readlink -f %s' % link)[0][:-1]
  vm.RemoteCommand('sudo chmod 777 %s' % path)
  return path