One of the problems I’ve run into with Kasm Workspaces is storage space. When creating a new Kasm environment, regardless of the size of the virtual machine or the VM’s storage space, Kasm always installs with 80GB of storage. With the wealth of containers available in the Kasm registries, 80GB disappears quickly.
At least for my scenario, where I’m hosting Kasm in a 200GB Ubuntu Server 24.04LTS VM, below are steps for allocating more storage. Note that commands, paths, variables, etc. may be different for your scenario. If you set up Kasm by following my previous tutorials, the below should be accurate, but is worth double-checking before copying and pasting commands in steps 5 and 6:
Step 1: Verify available storage in Docker:
sudo df -h /var/lib/docker
Step 2: Check to see if Docker is on an LVM volume
Running the lsblk command will show the partitions… check to see if /var/lib/docker is shown as the mountpoint for an lvm partition. If configured as described in previous articles, this should be the case.
lsblk
Step 3: Check the LV name and path
Run this command to see the logical volume name and path… my path is /dev/ubuntu-vg/ubuntu-lv and the logical volume name is ubuntu-lv. You’ll need this info for steps 5 and 6.
sudo lvdisplay
Step 4: Check the free space in the volume group
sudo vgdisplay
Step 5: Extend the LV
As long as there is free space, we can extend the logical volume. Note that the volume group, volume name, and volume path may be different for you, so check this against your results from Step 3 above.
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Step 6: Resize the file system.
Again, be sure that your volume path matches your system:
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
Step 7: Verify that everything worked:
df -h /var/lib/docker
Before:
After:
And for the true test, check your Admin → Workspaces → Registry page in Kasm to check the available storage. I didn’t have to restart the VM or Container or any services… the storage just update automatically.