When the Messenger of Allah ﷺ was on a journey and wished to say voluntary prayer, he made his she-camel face the qiblah and uttered the takbir (Allah is most great), then prayed in whatever direction his mount made his face. (Using translation from Abū Dāʾūd 1225)
أَنَّ رَسُولَ اللهِ ﷺ كَانَ إِذَا سَافَرَ فَأَرَادَ أَنْ يَتَطَوَّعَ بِالصَّلَاةِ اسْتَقْبَلَ بِنَاقَتِهِ الْقِبْلَةَ فَكَبَّرَ ثُمَّ صَلَّى حَيْثُ تَوَجَّهَتْ بِهِ النَّاقَةُ