How to play the terminal bell/beep sound in NoMachine virtual desktops
In order to play the system terminal bell/beep sound in virtual desktops on Linux it's required that:
1) the terminal bell/beep sound is enabled on the system.
2) the terminal bell/beep sound is working properly on the physical machine (not muted).
3) PulseAudio sound system is installed.
To verifing if bell/beep is working, play the sound from speakers/headphones, not through the buzzer on the motherboard. This will ensure that the bell/beep is generated from software and NoMachine will be able to capture it.
As an alternative to 3), it could be possible to use the ALSA sound system, but this would require to install a 3rd party software able to play the system bell through ALSA. Such option, however, is not part of this article.
Depending on the Linux Desktop Manager, further actions and configurations can be necessary. You may find below some examples tested on RHEL/CentOS 6.
GNOME
Terminal
- Open the GNOME Control Center.
- Look for the Hardware section and select the Sound icon.
- In Tab "Sound Effects" Set the Alert volume.
- Make sure that Alert volume is not muted and "Sound theme" is not set to "No sounds".
KDE
Konsole (KDE Terminal)
- Open System Settings->Application and System Notifications
- Select event: terminal
- Look for 'Konsole' in the Even source box.
- From the list of possible events select those of interest, mark Play a Sound box and select a sound file to be played.
- Change the tab from Applications to Player Settings, make sure that "Use KDE sound system" is selected and not muted.
xterm
There are two alternative methods, (ii) is a permanent change that persists also when the machine is rebooted.
(i) First method
Execute the following commands:
| $pactl upload-sample /usr/share/sounds/freedesktop/stereo/message.oga beep |
| Path above can be changed to any .oga, .ogg or .wav file that has to be played as beep sound. |
| $pactl load-module module-x11-bell sample=beep |
| xset b 100 |
| Command "xset b 100" may be not needed if the system is already configured for that. |
(ii) Second method
This is a permament change and will presist after a reboot.
- Edit the /etc/pulse/default.pa file.
- Uncomment the following lines:
load-sample-lazy x11-bell /usr/share/orage/sounds/Tear.wav
Path above can be changed to any .oga, .ogg or .wav file that has to be played as beep sound.
load-module module-x11-bell sample=x11-bell
- Execute the following command (it will shutdown and restart the PulseAudio server):
| pulseaudio -k |
- Wait for PulseAudio to restart.
Fluxbox
There are two alternative methods, (ii) is a permanent change that persists also when the machine is rebooted.
They apply to both Terminal and xterm.
(i) First method
Execute the following commands:
| $pactl upload-sample /usr/share/sounds/freedesktop/stereo/message.oga beep |
| Path above can be changed to any .oga, .ogg or .wav file that has to be played as beep sound. |
| $pactl load-module module-x11-bell sample=beep |
| xset b 100 |
| Command "xset b 100" may be not needed if the system is already configured for that. |
(ii) Second method
- Edit the /etc/pulse/default.pa file.
- Uncomment the following lines:
load-sample-lazy x11-bell /usr/share/orage/sounds/Tear.wav
Path above can be changed to any .oga, .ogg or .wav file that has to be played as beep sound.
load-module module-x11-bell sample=x11-bell
- Execute the following command (it will shutdown and restart the PulseAudio server):
| pulseaudio -k |
