Xen: Device xxx (x) could not be connected. Failed to find an unused loop device

If you are using Xen and get an error Device xxxxx (xxx) could not be connected. Failed to find an unused loop device when you try to create a guest. This is because you are out of loop devices.

Run this on command line:
echo "options loop max_loop=32" > /etc/modprobe.d/xen

With the value 32 you are able to run 16 Guests on your host, assuming you aren’t using loop devices for other purposes. Use a number suitable for your needs.

Shutdown your guests and run this on command line:
rmmod loop && modprobe loop

Show all loop devices:
ls -l /dev/ | grep loop