Last summer, the finished-restored P-51D "Twilight Tear" had the real guns fitted and had actual ammunition (not blanks) loaded up, and several people involved with the restoration were able to take turns in the cockpit, firing off the guns. The owner of the aircraft is also the owner of a large earth-moving and construction-related company, and he also owns a lot of land on the airport where the aircraft are housed, so he was able to make a dug-out firing pit and range for the aircraft. The aircraft/gun sight was bore-sighted and all, as according to original wartime practice.
Just doing this alone, required paper work and permits to be granted and connections with the ATF, etc. The aircraft cannot fly with the actual guns fitted, so they are locked up in a gun locker at the museum/hangar, with real-looking replicas fitted to the aircraft.
I don't have any photos of the guns being fired, but here are some photos leading up to it. As can be seen, a large head-on profile of a Bf 109 was used as the target, and they had this on display with the aircraft at Oshkosh, full of bullet holes from the event: