Narrated Ibn ‘Umar: While travelling the Messenger of Allah (peace be upon him) would pray voluntary prayer on his riding beast in whatever direction it turned; and he would observe witr prayer, but he did not offer the obligatory prayers upon it.
Sunan Abi Dawud, Book 4, Hadith 27