This question already has an answer here:

For an experiment I'm trying to start as many VM's as possible through libvirt, however with a little over 1000 VM's running I get an error saying: "Failed to create pipe: Too many open files". Any idea of how to fix this?

I've set ulimit soft and high limits for all users to 4096, but when checking: /proc/'process pid of the libvirt daemon'/limits it still says the soft limit is 1024 (hard limit has been set to 4096). When checking the ulimit for any user through 'ulimit -Sn' or 'ulimit -Hn' the limits seems to be set as intended.

This is happening on Ubuntu 12.04 Server, using libvirtd 0.9.8

marked as duplicate by Michael Hampton Dec 18 '17 at 2:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • "I've set ulimit soft and high limits for all users to 4096" - how did you do that? (since clearly its not working) – symcbean Jul 5 '17 at 16:26

You probably need to increase the number of open files handled by the kernel, e.g. by

sysctl -w fs.file-max=100000

Adjust the value to taste (sysctl fs.file-max tells you the current value). The file /etc/sysctl.conf is used to set the configuration at boot.

  • Thank you for the response. But this is set to 384180 by default, so I do not think this is the limitation. I've also tried running simple scripts creating a large number of files, and these are able to create as many files as the soft limit dictates. I believe my problem is the soft limit within the libvirtd process, but I don't know how to change this. – Jon Mar 2 '13 at 16:50
  • I found a solution for this problem. serverfault.com/questions/20387/debian-too-many-open-files The second answer, from Janning, explains the solution. By adding ulimit commands to /etc/defaults/libvirt-bin I was able to increase the limit for open files. – Jon Mar 7 '13 at 9:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.