diff --git a/core/includes/config.inc b/core/includes/config.inc
index 8166e84..f6f7fe1 100644
--- a/core/includes/config.inc
+++ b/core/includes/config.inc
@@ -1,11 +1,13 @@
 <?php
 
+use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\Config;
 use Drupal\Core\Config\ConfigException;
 use Drupal\Core\Config\ConfigInstaller;
+use Drupal\Core\Config\ExtensionInstallStorage;
 use Drupal\Core\Config\FileStorage;
 use Drupal\Core\Config\StorageInterface;
-use Drupal\Core\Config\StorageComparer;
+use Drupal\Core\Config\ExtensionInstallStorageComparer;
 use Symfony\Component\Yaml\Dumper;
 
 /**
@@ -22,10 +24,33 @@
  *   The name of the module or theme to install default configuration for.
  */
 function config_install_default_config($type, $name) {
+  // Get all default configuration owned by this extension.
+  $source_storage = new ExtensionInstallStorage();
+  $config_to_install = $source_storage->listAll($name . '.');
+
+  // Work out if this extension provides default configuration for any other
+  // enabled extensions.
   $config_dir = drupal_get_path($type, $name) . '/config';
   if (is_dir($config_dir)) {
-    $source_storage = new FileStorage($config_dir);
-    $storage_comparer = new StorageComparer($source_storage, Drupal::service('config.storage'));
+    $default_storage = new FileStorage($config_dir);
+    $other_module_config = array_filter($default_storage->listAll(),
+      function ($value) use ($name) {
+        return !preg_match('/$'.$name.'\./', $value);
+      }
+    );
+    $enabled_extensions = array_keys(\Drupal::moduleHandler()->getModuleList());
+    $enabled_extensions +=  array_keys(array_filter(list_themes(), function ($theme) {return $theme->status;}));
+
+    $other_module_config = array_filter($other_module_config, function ($config_name) use ($enabled_extensions) {
+      $provider = Unicode::substr($config_name,0, strpos($config_name, '.'));
+      return in_array($provider, $enabled_extensions);
+    });
+
+    $config_to_install += $other_module_config;
+  }
+  if (!empty($config_to_install)) {
+    $storage_comparer = new ExtensionInstallStorageComparer($name, $source_storage, Drupal::service('config.storage'));
+    $storage_comparer->setSourceNames($config_to_install);
     // Only import new config. Changed config is from previous enables and
     // should not be overwritten.
     $storage_comparer->addChangelistCreate();
@@ -54,6 +79,26 @@ function config_uninstall_default_config($type, $name) {
   foreach ($config_names as $config_name) {
     Drupal::config($config_name)->delete();
   }
+
+  // If the extension supplies default configuration for a config entity defined
+  // by another module we need to remove it.
+  $config_dir = drupal_get_path($type, $name) . '/config';
+  if (is_dir($config_dir)) {
+    $default_storage = new FileStorage($config_dir);
+    $other_module_config = array_filter($default_storage->listAll(),
+      function ($value) use ($name) {
+        return !preg_match('/$'.$name.'\./', $value);
+      }
+    );
+    foreach ($other_module_config as $config_name) {
+      $original_config = $default_storage->read($config_name);
+      // Only delete is UUIDs match. They will not if the user has deleted the
+      // config entity and created a new one with the same machine name.
+      if (!isset($original_config['uuid']) || $original_config['uuid'] == Drupal::config($config_name)->get('uuid')) {
+        Drupal::config($config_name)->delete();
+      }
+    }
+  }
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php
new file mode 100644
index 0000000..5fb0266
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Config\ExtensionInstallStorage.
+ */
+
+namespace Drupal\Core\Config;
+
+use Drupal\Core\Config\InstallStorage;
+use Drupal\Core\Config\StorageException;
+
+/**
+ * Defines the file storage controller for metadata files.
+ */
+class ExtensionInstallStorage extends InstallStorage {
+
+  /**
+   * Returns a map of all config object names and their folders.
+   *
+   * The list is based on enabled modules and themes.
+   *
+   * @return array
+   *   An array mapping config object names with directories.
+   */
+  protected function getAllFolders() {
+    if (!isset($this->folders)) {
+      // Don't think we need to worry about profile because it is an enabled
+      // module and any modules it has will also be enabled or not.
+      // $this->folders = $this->getComponentNames('profile', array(drupal_get_profile()));
+      $this->folders = $this->getComponentNames('module', array_keys(\Drupal::moduleHandler()->getModuleList()));
+      $this->folders += $this->getComponentNames('theme', array_keys(array_filter(list_themes(), function ($theme) {return $theme->status;})));
+    }
+    return $this->folders;
+  }
+
+  /**
+   * Overrides \Drupal\Core\Config\InstallStorage::write().
+   *
+   * @throws \Drupal\Core\Config\StorageException
+   */
+  public function write($name, array $data) {
+    throw new StorageException('Write operation is not allowed for config extension install storage.');
+  }
+
+  /**
+   * Overrides \Drupal\Core\Config\InstallStorage::delete().
+   *
+   * @throws \Drupal\Core\Config\StorageException
+   */
+  public function delete($name) {
+    throw new StorageException('Delete operation is not allowed for config extension install storage.');
+  }
+
+  /**
+   * Overrides \Drupal\Core\Config\InstallStorage::rename().
+   *
+   * @throws \Drupal\Core\Config\StorageException
+   */
+  public function rename($name, $new_name) {
+    throw new StorageException('Rename operation is not allowed for config extension install storage.');
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Config/ExtensionInstallStorageComparer.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorageComparer.php
new file mode 100644
index 0000000..f20b9a1
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorageComparer.php
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Config\ExtensionInstallStorageComparer.
+ */
+
+namespace Drupal\Core\Config;
+
+/**
+ * Defines a config storage comparer.
+ */
+class ExtensionInstallStorageComparer extends StorageComparer {
+
+  /**
+   * The extension name.
+   *
+   * @var string
+   */
+  protected $name;
+
+  /**
+   * Constructs the Configuration storage comparer.
+   *
+   * @param string $name
+   *   The name of the extension being installed.
+   * @param \Drupal\Core\Config\StorageInterface $source_storage
+   *   Storage controller object used to read configuration.
+   * @param \Drupal\Core\Config\StorageInterface $target_storage
+   *   Storage controller object used to write configuration.
+   */
+  public function __construct($name, StorageInterface $source_storage, StorageInterface $target_storage) {
+    $this->name = $name;
+    $this->sourceStorage = $source_storage;
+    $this->targetStorage = $target_storage;
+    $this->changelist = $this->getEmptyChangelist();
+  }
+
+  /**
+   * Sets the configuration names in the source storage.
+   *
+   * @param array $source_names
+   *   List of all the configuration names in the source storage.
+   */
+  public function setSourceNames(array $source_names) {
+    $this->sourceNames = $source_names;
+    return $this;
+  }
+
+  /**
+   * Gets all the configuration names in the source storage.
+   *
+   * @return array
+   *   List of all the configuration names in the source storage.
+   */
+  protected function getSourceNames() {
+    if (empty($this->sourceNames)) {
+      $this->sourceNames = $this->sourceStorage->listAll($this->name . '.');
+    }
+    return $this->sourceNames;
+  }
+
+  /**
+   * Gets all the configuration names in the target storage.
+   *
+   * @return array
+   *   List of all the configuration names in the target storage.
+   */
+  protected function getTargetNames() {
+    if (empty($this->targetNames)) {
+      $this->targetNames = $this->targetStorage->listAll($this->name . '.');
+    }
+    return $this->targetNames;
+  }
+
+}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
index a8ca042..3e199fb 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
@@ -182,17 +182,19 @@ function testNameValidation() {
       $this->fail($message);
     }
 
-    // Verify an exception is thrown when importing configuration with an
-    // invalid name (missing a namespace).
-    $message = 'Expected ConfigNameException was thrown when attempting to install invalid configuration.';
-    try {
-      $this->enableModules(array('config_test_invalid_name'));
-      $this->installConfig(array('config_test_invalid_name'));
-      $this->fail($message);
-    }
-    catch (ConfigNameException $e) {
-      $this->pass($message);
-    }
+    // This is now impossible since we search default configuration directories
+    // for the name plus a period.
+//    // Verify an exception is thrown when importing configuration with an
+//    // invalid name (missing a namespace).
+//    $message = 'Expected ConfigNameException was thrown when attempting to install invalid configuration.';
+//    try {
+//      $this->enableModules(array('config_test_invalid_name'));
+//      $this->installConfig(array('config_test_invalid_name'));
+//      $this->fail($message);
+//    }
+//    catch (ConfigNameException $e) {
+//      $this->pass($message);
+//    }
   }
 }
 
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php
index 5431a96..2c5650f 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php
@@ -86,10 +86,11 @@ function testIntegrationModuleReinstallation() {
     $config_static = \Drupal::config($default_config);
     $this->assertIdentical($config_static->isNew(), TRUE);
 
-    // Verify the integration config still exists.
-    $config_entity = \Drupal::config($default_configuration_entity);
-    $this->assertIdentical($config_entity->isNew(), FALSE);
-    $this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
+    // This is the very opposite of what this patch is trying to achieve.
+//    // Verify the integration config still exists.
+//    $config_entity = \Drupal::config($default_configuration_entity);
+//    $this->assertIdentical($config_entity->isNew(), FALSE);
+//    $this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
 
     // Reinstall the integration module.
     module_enable(array('config_integration_test'));
@@ -99,10 +100,11 @@ function testIntegrationModuleReinstallation() {
     $this->assertIdentical($config_static->isNew(), FALSE);
     $this->assertIdentical($config_static->get('foo'), 'default setting');
 
-    // Verify the customized integration config still exists.
-    $config_entity = \Drupal::config($default_configuration_entity);
-    $this->assertIdentical($config_entity->isNew(), FALSE);
-    $this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
+    // This is the very opposite of what this patch is trying to achieve.
+//    // Verify the customized integration config still exists.
+//    $config_entity = \Drupal::config($default_configuration_entity);
+//    $this->assertIdentical($config_entity->isNew(), FALSE);
+//    $this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
   }
 
 }
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
index 224340c..5c818c7 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
@@ -34,6 +34,7 @@ public static function getInfo() {
   public function setUp() {
     parent::setUp();
     config_install_default_config('module', 'config_test');
+    config_install_default_config('module', 'locale');
   }
 
   /**
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php
new file mode 100644
index 0000000..fc77363
--- /dev/null
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\config\Tests\ConfigOtherModuleTest.
+ */
+
+namespace Drupal\config\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests default configuration provided by a module that does not own it.
+ */
+class ConfigOtherModuleTest extends WebTestBase {
+
+  /**
+   * @var \Drupal\Core\Extension\ModuleHandler
+   */
+  protected $moduleHandler;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Default configuration other modules',
+      'description' => 'Tests default configuration provided by a module that does not own it.',
+      'group' => 'Configuration',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+    $this->moduleHandler = $this->container->get('module_handler');
+  }
+
+  public function testInstallOtherModule() {
+    $this->moduleHandler->enable(array('config_other_module_config'));
+    // We can not use this entity system because the config_test entity type
+    // does not exist.
+    $config = \Drupal::config('config_test.dynamic.other_module');
+    $this->assertTrue($config->isNew(), 'Default configuration for other modules is not installed if that module is not enabled.');
+
+    // Install the module that provides the entity type. This installs the
+    // default configuration.
+    $this->moduleHandler->enable(array('config_test'));
+    $this->assertTrue(entity_load('config_test', 'other_module'));
+
+    // Uninstall the module that provides the default configuration. This should
+    // remove the default config provided by it but not the config_test module.
+    $this->moduleHandler->disable(array('config_other_module_config'));
+    $this->moduleHandler->uninstall(array('config_other_module_config'));
+    $this->assertFalse(entity_load('config_test', 'other_module', TRUE), 'Default configuration for other modules is removed when the module that provides it is uninstalled.');
+
+    // Default configuration provided by config_test should still exist.
+    $this->assertTrue(entity_load('config_test', 'dotted.default', TRUE), 'Other configuration is left alone.');
+
+    // Re-enable module to test that default config for other modules is
+    // installed when they are already enabled.
+    $this->moduleHandler->enable(array('config_other_module_config'));
+    $config_entity = entity_load('config_test', 'other_module', TRUE);
+    $this->assertTrue($config_entity, 'Re-enabling the module re-installs default config for other enabled modules.');
+
+    // Delete the config entity and creating another one with the same machine
+    // name to test that the different UUIDs will prevent it being removed.
+    $config_entity->delete();
+    $config_entity = entity_create('config_test', array(
+      'id' => 'other_module',
+      'label' => $this->randomString(),
+      'style' => $this->randomName()));
+    $config_entity->save();
+
+    $this->moduleHandler->disable(array('config_other_module_config'));
+    $this->moduleHandler->uninstall(array('config_other_module_config'));
+    $this->assertTrue(entity_load('config_test', 'other_module', TRUE), 'Since the UUIDs are different the config entity is not uninstalled even though the names match.');
+
+    $this->moduleHandler->disable(array('config_test'));
+    $this->moduleHandler->uninstall(array('config_test'));
+    // We can not use this entity system  because the config_test entity type
+    // does not exist.
+    $config = \Drupal::config('config_test.dynamic.other_module');
+    $this->assertTrue($config->isNew(), 'After uninstalling the module that provides the config entity the configuration is removed.');
+
+  }
+
+}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
index 4a507d8..3afe989 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
@@ -22,7 +22,7 @@ class ConfigSchemaTest extends DrupalUnitTestBase {
    *
    * @var array
    */
-  public static $modules = array('system', 'locale', 'image', 'config_test');
+  public static $modules = array('system', 'locale', 'field', 'image', 'config_test');
 
   public static function getInfo() {
     return array(
diff --git a/core/modules/config/tests/config_other_module_config/config/config_test.dynamic.other_module.yml b/core/modules/config/tests/config_other_module_config/config/config_test.dynamic.other_module.yml
new file mode 100644
index 0000000..b144af6
--- /dev/null
+++ b/core/modules/config/tests/config_other_module_config/config/config_test.dynamic.other_module.yml
@@ -0,0 +1,8 @@
+id: other_module
+uuid: 486f9f5c-82ed-4add-a700-b0ee3af4d17d
+label: 'Other module'
+weight: '0'
+style: ''
+status: '1'
+langcode: en
+protected_property: Default
diff --git a/core/modules/config/tests/config_other_module_config/config_other_module_config.info.yml b/core/modules/config/tests/config_other_module_config/config_other_module_config.info.yml
new file mode 100644
index 0000000..0f78017
--- /dev/null
+++ b/core/modules/config/tests/config_other_module_config/config_other_module_config.info.yml
@@ -0,0 +1,6 @@
+name: 'Config other module config'
+type: module
+package: Testing
+version: VERSION
+core: 8.x
+hidden: true
diff --git a/core/modules/config/tests/config_other_module_config/config_other_module_config.module b/core/modules/config/tests/config_other_module_config/config_other_module_config.module
new file mode 100644
index 0000000..2be1ea7
--- /dev/null
+++ b/core/modules/config/tests/config_other_module_config/config_other_module_config.module
@@ -0,0 +1,7 @@
+<?php
+
+/**
+ * @file
+ * Config test module to test a supplying a configuration entity owned by
+ * another module.
+ */
