Error playing sound in virtual box virtual machine

Hello PsychoPy community,
I am fairly new to Python (but not to coding) this interesting library. I was having some trouble getting psychopy to play a sound in a virtual box (Version 6.1.16 r140961) virtual machine running Ubuntu 20.04.1 and Python 3.8.5.

When I save this code to playsoundDemo3.py and run it (see code here ), I get this error:

ALSA lib pcm.c:8526:(snd_pcm_recover) 

but it played sounds intermittently (progress lol)!

[Ran some code in between the above and below to change preferences that I can’t remember]

Then, when I run from python3 prompt:

from psychopy import prefs
prefs.hardware['audioLib'] = ['PTB', 'pyo','pygame']

and then the script again, I get this error, no sound and ctrl-c doesn’t even break execution:

$ python3 playsoundDemo3.py 
Using sounddevice (with None) for sounds
done
0.2332 	INFO 	Loaded SoundDevice with PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4
0.2334 	INFO 	sound is using audioLib: sounddevice
0.2335 	WARNING 	We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
0.3042 	EXP 	Sound  set volume 0.800

Then, when I run from python3 prompt:

from psychopy import prefs
prefs.hardware['audioLib'] = ['pyo','PTB','pygame','sounddevice']

and then the script again, I get this error, no sound and ctrl-c doesn’t even break execution:

$ python3 playsoundDemo3.py 
Using sounddevice (with None) for sounds
done
0.2409 	INFO 	Loaded SoundDevice with PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4
0.2412 	INFO 	sound is using audioLib: sounddevice
0.2412 	WARNING 	We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
0.3173 	EXP 	Sound  set volume 0.800

I get a similar error after running this in python prompt

prefs.hardware['audioLib'] = ['PTB']

It seems from the error output that it is failing to change the order of which audiolib it uses. Is anyone able to help? Much appreciated if so. My plan was to try each one to see if it worked but I don’t remember what the original order was. Is doing things like this even possible from a virtual machine?
Thank you!
~Brandon