Leonardo - always on power, status remains between computer reboots?
Is it possible to power a Leonardo to be always on, separate from the power from the USB host


Yes, that is what the barrel jack is for.


  I've tried with a full size Leonardo and a power adapter but for some reason the code didn't run when I did that.


Then your code is wrong. Are you using while (!Serial); or something similar near the top of your code?


  For a start avoid it's boot up time


The most certain way of doing that is to not use the bootloader. Instead program the board directly with a hardware programmer disabling (or erasing) the bootloader.


  Obviously that means the Arduino will see it's USB host disappear then come back online, will that automatically reset it and thus start it from the beginning again, or can I set it so that with always on power it will carry on doing what it is, irregardless of it's connecting to the host?


The Leonardo only reboots if you open the serial port at 1200 baud, or toggle the RESET pin / button.


  Do I need to change code, or libraries to achieve any of this?


It sounds like you may need to, yes - since it's not working at the moment when if the code were correct it should work.



IMPORTANT

Most computers will not recognize the Leonardo until the operating system is fully booted. This means you cannot use the Leonardo to interact with the BIOS or boot menu. The Leonardo does not implement the "Boot Protocol" keyboard which is required to interact with the BIOS or other pre-boot environment.