How to enable audio and CJK in wsl

For newly installed ubuntu 22.04 with wsl2 under Windows 11, there are some issues such as no sound is output if opening a web page that plays audio, as well as that the CJK characters can not be displayed properly if the page has CJK characters, and here are some quick solutions.

Thanks to this post, after installing 2 packages below, sound output works perfectly:

$ sudo apt install sox libsox-fmt-all

and also thanks to copilot search suggestions, the CJK characters display issue can be easily solved after installation of below packages:

$ sudo apt install fonts-noto-cjk fonts-noto-color-emoji

There are still other issues like not being able to input CJK characters in either terminal or on web pages with input fields for instance, for which copilot also suggested using tools like fcitx and dbus-x11, I quickly tried but failed. Giving it up for now since the issues with sound output and CJK displays are solved to meet most WSL2 use cases as a development environment alongside the main Windows host for internet surfing.

windows