.. title:: Persistent Data Persistent Data =============== Overview -------- Kasm Server allows administrators to configure folders to be mapped inside a Kasm each time it is provisioned. This is done by configuring the **Volume Mappings** field on the `Kasm Image <../guide/custom_images.html>`_. .. figure:: /images/volume_mappings/volume_mappings.png :width: 90% :align: center **Configuring Volume Mappings on the Kasm Image** Volume Mappings may also be applied as a `Group Setting <../guide/groups.html#group-settings>`_ . This may be useful if a certain set of users should have the mapping. When applied at the group level, all Kasms created by members of this group will have the mapping applied. .. figure:: /images/volume_mappings/group_volume_mappings.png :width: 60% :align: center **Configuring Volume Mappings as a Group Setting** In this guide we will configure a folder on the host ``/var/kasm_persistent_data`` to be mapped inside the Kasm Desktop image to a folder named ``/data``. This effectively will act as a file share. All users's who have access to provision the image will have access to this folder. Create Host Directory --------------------- On the Kasm Server create the directory and change the ownership to user and group **1000**. .. note:: If Kasm is installed in a multi-server deployment, this process must be repeated on each server that runs the Kasm Agent service. ``/var/kasm_persistent_data`` in this example should represent a centralized share that is mapped to each agent. .. code-block:: Bash sudo mkdir /var/kasm_persistent_data sudo chown 1000:1000 /var/kasm_persistent_data/ echo "test" > /var/kasm_persistent_data/test.txt Configure Image Volume Mappings ------------------------------- * Log into the Kasm UI as an administrator. * Select Images, and click edit (pencil) next to the Kasm Desktop image * In the Volume Mappings field, paste the following configuration and click Submit .. code-block:: JSON { "/var/kasm_persistent_data":{ "bind":"/data", "mode":"rw" } } .. note:: Although this guide demonstrate mapping a single volume, multiple volume mappings can be defined. .. code-block:: JSON { "/var/kasm_persistent_data1":{ "bind":"/data1", "mode":"rw" }, "/var/kasm_persistent_data2":{ "bind":"/data2", "mode":"ro" } } Verify Access ------------- * Launch the Kasm Desktop Image. * Verify the user can read and write to the ``/data`` location. .. figure:: /images/volume_mappings/verification.png :width: 90% :align: center **Verifying Volume Access**