Sharing bike trainer between 11spd and 8spd bikes
The 11 speed shifter, derailleur and chain will not shift properly with the 8 speed cassette.

As the number of sprockets in cassettes increased, the spacing was made progressively narrower, and chains were made progressively also. Your 11 speed shifter/derailleur combination will not move the chain far enough to shift properly on an 8 speed cassette.

If you leave the shifter in a single gear it will run, but you'll have to mess with the indexing to get it correct on the sprocket. You'll then have to re-adjust the indexing when you go back to the 11 speed cassette.