How do I resolve a "Too many open files" error that prevents opening the virtual machine console?
Solution
-
Try the following steps to resolve the issue:
-
Log in to the host system where the virtual machine resides.
-
Run the following command to check the maximum number of open files allowed by the system:
[root@localhost ~]# ulimit -n //default output is 1024 -
Run the following command to open the
limits.confconfiguration file and add the following entries to set the maximum number of open files to 262144:[root@localhost ~]# vim /etc/security/limits.conf ... soft nofile 262144 hard nofile 262144 soft nproc 10240 hard nproc 10240 -
Run the following commands to restart the libvirtd and virtlogd services:
[root@localhost ~]# service libvirtd restart [root@localhost ~]# service virtlogd restart -
After the host reconnects successfully, open the virtual machine console.