def get_attached_preparation_create_kwargs(self, action, volume_container, volume_alias, kwargs=None):
        """
        Generates keyword arguments for the Docker client to prepare an attached container (i.e. adjust user and
        permissions).

        :param action: Action configuration.
        :type action: dockermap.map.runner.ActionConfig
        :param volume_container: Name of the container that shares the volume.
        :type volume_container: unicode | str
        :param volume_alias: Volume alias that is used for map references, for looking up paths.
        :type volume_alias: unicode | str
        :param kwargs: Additional keyword arguments to complement or override the configuration-based values.
        :type kwargs: dict | NoneType
        :return: Resulting keyword arguments.
        :rtype: dict
        """
        client_config = action.client_config
        config_id = action.config_id
        policy = self._policy
        if client_config.features['volumes']:
            path = PREPARATION_TMP_PATH
        else:
            path = resolve_value(policy.default_volume_paths[config_id.map_name][volume_alias])
        user = policy.volume_users[config_id.map_name][volume_alias]
        permissions = policy.volume_permissions[config_id.map_name][volume_alias]
        cmd = ' && '.join(get_preparation_cmd(user, permissions, path))
        if not cmd:
            return None
        c_kwargs = dict(
            image=policy.core_image,
            command=cmd,
            user='root',
            network_disabled=True,
        )
        hc_extra_kwargs = kwargs.pop('host_config', None) if kwargs else None
        use_host_config = client_config.features['host_config']
        if use_host_config:
            if client_config.features['volumes']:
                c_kwargs['volumes'] = [PREPARATION_TMP_PATH]
            hc_kwargs = self.get_attached_preparation_host_config_kwargs(action, None, volume_container,
                                                                         kwargs=hc_extra_kwargs)
            if hc_kwargs:
                if use_host_config == USE_HC_MERGE:
                    c_kwargs.update(hc_kwargs)
                else:
                    c_kwargs['host_config'] = HostConfig(version=client_config.version, **hc_kwargs)
        update_kwargs(c_kwargs, kwargs)
        return c_kwargs