Kasm Workspaces 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.
Volume Mappings may also be applied as a Group Setting . This may be useful
if a certain set of users should have the mapping. When applied at the group level, all sessions created by members of this
group will have the mapping applied.
In this guide we will configure a folder on the host /var/kasm_user_share to be mapped inside the Kasm Desktop
image to a folder named /share. This effectively will act as a file share. All users’s who have access to provision
the image will have access to this folder.
The path inside the Kasm where the volume will be mounted.
mode
rw for Read-Write , ro for Read-Only.
uid
The linux user id ownership that should be given to the volume. This permission is applied to the folder on the host.
The uid must be 1000 in order for the Kasm container use to access the files.
gid
The linux group id ownership that should be given to the volume. This permission is applied to the folder on the
host. The gid must be 1000 in order for the Kasm container use to access the files.
required
If true the volume must be accessible in order to provision the Kasm when requested. If false the
system will allow the Kasm to be provision even if connectivity to the volume cannot be established. If not specified
the default is true.
timeout
When a Kasm is provisioned , the system will attempt to establish connectivity to the volume specified. The system
will wait the specified number of seconds before deeming the connectivity has failed. If not specified the default is
10 seconds
skip_check (optional)
When a Kasm is provisioned , the system will attempt to establish connectivity to the volume specified and ensure
the ownership of that directory matches the uid:gid specified with a :code:’chown’. On some filesystems such as
those mounted as read only, this check will fail or error. The administrator may choose to set this
value to true so the system will skip the check. The default is false if not specified.
The volume mapping config supports the use of {user_id} and {username} tokens in the mapping
name and bind attribute. This allows the administrator to create unique share locations per user.
On the Kasm Workspaces server, create the directory and change the ownership to user and group 1000.
Note
If Kasm is installed in a multi-server deployment, /var/kasm_user_share in this example 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.
Add the entry to /etc/exports. In this example the IP of the NFS Client is 192.168.1.3.
Note the use of all_squash, anonuid, and anongid settings
to ensure that all files are accessed and written as the default Kasm session UID 1000.
See https://linux.die.net/man/5/exports for more details.
Inspect the file from the NFS Server to ensure the permissions are UID/GID 1000.
ls -la /kasmdata/
total 8
drwxr-xr-x 2100010004096 Feb 2408:39 .
drwxr-xr-x 20 root root 4096 Feb 2316:00 ..
-rw-r--r-- 1100010000 Feb 2408:39 example.txt
You can now reference the NFS share in volume mappings or persistent profile configurations.