---
myst:
  html_meta:
    "description lang=en": "How to mount persistent host level folders into Kasm Workspaces for the users Home directory."
    "keywords": "Kasm, How to, How-to, Persistent Profiles, NFS, Customization, Home Folder"
    "property=og:locale": "en_US"
---
```{title} Persistent Profiles
```

## Persistent Profiles

Administrators may desire to give each user a personal persistent profile that is restored during each session. This is achieved by mounting in a host level directory into the container meaning the top level folders used for this setting should exist on the host beforehand.
When configured, the user's home directory will be stored at the specified location and mapped in each time the user loads that Workspace.
Administrators must use the `{username}` or  `{user_id}` variables in the mapping to ensure they are unique per user.
Persistent profiles are configured on a per Workspace basis and should be isolated in their pathing IE if you have a Chrome and Firefox image on your Workspaces deployment and the users are **user@kasm.local** and **admin@kasm.local** the directory structure would look like:

```
/mnt/kasm_profiles/
├── chrome
│   ├── admin@kasm.local
│   └── user@kasm.local
└── firefox
    ├── admin@kasm.local
    └── user@kasm.local
```

The only folder the administrator needs to create is `/mnt/kasm_profiles/` and the rest will be generated on Workspace launch.

### Adding a persistent profile to a Workspace

To add a persistent profile path to a Workspace from the administrator menu first click on Workspaces and edit your desired Workspace: 

```{figure} /images/persistent_profiles/profile_workspace_edit.png
:align: center
:width: 90%

**Edit a Workspace**
```

- Configure the persistent profile path on the {term}`Workspace`.

```{figure} /images/persistent_profiles/profile_path_setting.png
:align: center
:width: 90%

**Configuring the persistent profile path on an Image**
```

In this example for Firefox the path is: 

```
/mnt/kasm_profiles/firefox/{username}
```

In most cases the `{username}` is preffered to ease administration, if this is a large deployment that might have duplicate usernames/emails then please use `{user_id}` which is a unique Kasm generated string.


```{note}
If Kasm is installed in a multi-server deployment path should reference a
shared data storage solution (e.g NFS, HDFS, GFS, SMB, SSHFS) to ensure data continuity. Administrators must ensure
this path is accessible from the hosts of all Agent services. Kasm will create the directory if it does not exist.
```

### Limiting group access to persistent profiles

It may be necessary to limit which users can access the persistent profile feature, this can be achieved with a group setting. **See [Group Setting](../groups.md#group-settings) for more details.**

From the administrator menu first click on Groups and click View on your desired group: 

```{figure} /images/persistent_profiles/profile_select_group.png
:align: center
:width: 80%

**Edit a Group**
```

Under **Group Settings** find the `allow_persistent_profile` group setting and click edit:

```{figure} /images/persistent_profiles/profile_select_group_setting.png
:align: center
:width: 80%

**Select Persistent Profile Group Setting**
```

This is a Boolean value, set it to true to enable access and false to disable access for this particular group.


```{figure} /images/persistent_profiles/profile_set_group_setting.png
:align: center
:width: 80%

**Enabling Persistent Profiles at the Group Level**
```

### Utilize a persistent profile with creating a Kasm

```{figure} /images/persistent_profiles/profile_launch_option.png
:align: center
:width: 90%

**Using a persistent profile**
```

When creating a Kasm, the user will now be presented with a **Persistent Profile** Option. Multiple Settings are available.

> - **Enabled**
>   - The persistent profile path defined on the workspace will be loaded during creation.
> - **Disabled**
>   - The persistent profile will **NOT** be loaded on creation.
> - **Reset**
>   - The existing persistent profile will be deleted and re-created. The is useful if the user desires to clear old profile data and start fresh.


### Video Example

This video shows an example of configuring persistent profiles.

```{raw} html
<iframe width="560" height="315" src="https://www.youtube.com/embed/teJSUxKEbfE?start=414" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
```