I'm running an lxc container through libvirt.

First I've created a container with lxc-create -n test-container -t download -- -d ubuntu -r focal -a amd64

Then I create a new virsh guest with virsh -c lxc:// define test-container.xml where the contents of test-container.xml is the following:

<domain type='lxc'>
  <clock offset='utc'/>
    <filesystem type='mount'>
      <source dir='/var/lib/lxc/test-container/rootfs'/>
      <target dir='/'/>
    <interface type='network'>
      <source network='default'/>
    <console type='pty'/>

I was able to limit memory and cpu but since container filesystem is a directory on a host machine and not a qemu image, I was wondering if it is possible to limit the container filesystem size in some way ?

Thanks in advance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.