Sound Driver Emulation of PC Speaker
This only works on Linux. My sound card happens to be snd_hda_intel, that driver actually can emulate a PC Speaker itself with the beep_mode parameter:
beep_mode: Select HDA Beep registration mode (0=off, 1=on) (default=1). (array of bool)
Moreover it's on by default.
Set-Up and Configuration
You'll have to set up the permissions once -- adding yourself to the proper group. Without this, you'll get an error like this in your VBox.log
Ensure the pcspkr module is loaded with lsmod | grep pcspkr, if you don't see it, load it
sudo modprobe pcspkr
This will expose a device file /dev/input/by-path/platform-pcspkr-event-spkr
Ensure that your group can write to the device file exposed above (ls -lah). On Ubuntu it's owned by input, for this you'll have to run something like
usermod -aG input "$USER"
Now, log off and log back in
- Verify that you're in that right group by running
groups which will tell what groups your user is in
Confirm setup was successful
From now on you just need to do the following,
- Run
modprobe pcspkr, you'll have to do this every time or remove pcskr from your blacklist so it's added on boot. I just run it before I start virtual box.
Run xkbbell or in xterm (I wouldn't use gnome-terminal, or xfce-terminal, or konqueror for this because they may swallow it) run printf "\a" if you do not hear anything then run the following and try again
xset b 100
# or whatever the source control is for the beeper
amixer sset Beep 100%
Lastly, you'll have to enable PC Speaker pass-through,
For the last step, you'll need to enable PC Speaker pass-through from the VirtualBox Advanced FAQ, you can do this with VBoxManage. The GUI has yet no method to accomplish this.
VBoxManage setextradata "VM name" "VBoxInternal/Devices/i8254/0/Config/PassthroughSpeaker" 100
Now you just have to the following from now on,
That's it. Now just startup Virtual box and launch TempleOS. You should be able to play God Songs. You do not need to reinstall TempleOS.
No Sound Driver Emulation of PC Speaker
I believe this is only possible in one of two ways, hypothetically
If the host operating system can virtualize a PC Speaker which Virtual Box can pass through. I believe PC Speakers can be passed through with Virtual Box on Linux. I have yet to find anything that can emulate a PC Speaker on the host and work with something like beep though. If this can be made functional, then something like this should do the pass-through. From the VirtualBox Advanced FAQ
VBoxManage setextradata "VM name" "VBoxInternal/Devices/i8254/0/Config/PassthroughSpeaker" 100
I asked a question on this on Unix.SE, Can Pulse Audio emulate a virtual PC Speaker?
If Virtual Box can emulate a PC Speaker which it can not currently do, afaik.
I don't think there is a solution or much attention to this as even for older DOS Systems that used PWM on the PC Speaker, support for Sound Blaster was ubiquitous and Virtual Box can emulate a sound-blaster compatible device.