No space left on VM

I’m trying to install kubuntu-desktop on LXD ubuntu 20.04 vm
but I got that meessage

Setting up libkf5networkmanagerqt6 (5.68.0-0ubuntu1) ...
Setting up dnsmasq-base (2.80-1.1ubuntu1) ...
Setting up libblockdev-part2:amd64 (2.23-2ubuntu3) ...
Setting up man-db (2.9.1-1) ...
Building database of manual pages ...
Traceback (most recent call last):
  File "/usr/sbin/update-apt-xapian-index", line 111, in <module>
    indexer.rebuild(opts.pkgfile)
  File "/usr/lib/python3/dist-packages/axi/indexer.py", line 759, in rebuild
    for a in self.plugins: a.send_extra_info(aptcache=self.aptcache())
  File "/usr/lib/python3/dist-packages/axi/indexer.py", line 425, in aptcache
    self.apt_cache = apt.Cache(progress=aptprogress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 170, in __init__
    self.open(progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 232, in open
    self._cache = apt_pkg.Cache(progress)
apt_pkg.Error: E:Write error - write (28: No space left on device), E:IO Error saving source cache, E:The package lists or status file could not be parsed or opened.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 144, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_sbin_update-apt-xapian-index.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/sbin/update-apt-xapian-index", line 111, in <module>
    indexer.rebuild(opts.pkgfile)
  File "/usr/lib/python3/dist-packages/axi/indexer.py", line 759, in rebuild
    for a in self.plugins: a.send_extra_info(aptcache=self.aptcache())
  File "/usr/lib/python3/dist-packages/axi/indexer.py", line 425, in aptcache
    self.apt_cache = apt.Cache(progress=aptprogress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 170, in __init__
    self.open(progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 232, in open
    self._cache = apt_pkg.Cache(progress)
apt_pkg.Error: E:Write error - write (28: No space left on device), E:IO Error saving source cache, E:The package lists or status file could not be parsed or opened.
gdbm fatal: File write error: No space left on device
Created symlink /etc/systemd/system/timers.target.wants/man-db.timer → /lib/systemd/system/man-db.timer.
man-db.service is a disabled or a static unit, not starting it.
debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: No space left on device
Warning: unable to close filehandle $fh properly: No space left on device at /usr/share/perl5/Debconf/DbDriver.pm line 55, <GEN6> line 3.
dpkg: error processing package man-db (--configure):
 installed man-db package post-installation script subprocess returned error exit status 1
Setting up fonts-thai-tlwg (1:0.7.1-3) ...
dpkg: unrecoverable fatal error, aborting:
 unable to flush /var/lib/dpkg/updates/tmp.i after padding: No space left on device

How I know that space left in VM and how to increase it?
I tried lxc storage set default volume.size 30GB but wont work

ubuntu@VKD:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            478M     0  478M   0% /dev
tmpfs            98M  596K   98M   1% /run
/dev/sda2       3.8G  3.8G     0 100% /
tmpfs           490M     0  490M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           490M     0  490M   0% /sys/fs/cgroup
/dev/sda1        99M  3.9M   95M   4% /boot/efi

To set a disk limit (requires btrfs or ZFS):

lxc config device set my-container root size 20GB

Read More here: https://stgraber.org/2016/03/26/lxd-2-0-resource-control-412/

Give us some information about the LXD storage device. The first will show your storage devices. The second

lxc storage list
lxc storage show default

Most likely you are using a loop device of some big size, which takes space from your root partition.
If you have space elsewhere, you can add another storage device and move your containers there.

See here: LXD VM - Storage problem inside VM

You can search the forum :wink:.

1 Like
+---------+-------------+--------+------------------------------------------------+---------+
|  NAME   | DESCRIPTION | DRIVER |                     SOURCE                     | USED BY |
+---------+-------------+--------+------------------------------------------------+---------+
| default |             | dir    | /var/snap/lxd/common/lxd/storage-pools/default | 2       |
+---------+-------------+--------+------------------------------------------------+---------+
xlmnxp@xlmnxp-GL502VMK:~$ lxc storage show default
config:
  source: /var/snap/lxd/common/lxd/storage-pools/default
  volume.size: 30GB
description: ""
name: default
driver: dir
used_by:
- /1.0/profiles/default
- /1.0/virtual-machines/VKD
status: Created
locations:
- none

It’s work, Thank you

That not work with Virtual machines