When starting a new VPS, you may encounter connection errors related to the libvirt hypervisor service. This typically happens when the libvirtd service is not running on the host system. The error message "failed to connect to the hypervisor" or "No such file or directory" for the libvirt socket indicates that the virtualization service needs to be started before the VPS can be launched.

How to Fix It

  1. Step 1: Check the libvirtd service status

    First, verify whether the libvirtd service is running on your server:

    systemctl status libvirtd.service

    This command will show you if the service is active, inactive, or stopped.

  2. Step 2: Start the libvirtd service

    If the service is down or stopped, start it with the following command:

    systemctl start libvirtd.service
  3. Step 3: Launch the VPS from the admin panel

    Once the libvirtd service is running, return to your admin panel and start the VPS. The connection error should now be resolved, and the VPS should start successfully.

Common Issues

  • Service fails to start: If the libvirtd service fails to start, check system logs with journalctl -xe for detailed error messages.
  • Socket permission errors: Ensure your user has the necessary permissions to access /var/run/libvirt/libvirt-sock.