teary screen while trying to use chromium in wsl2

a huge error appears when i try booting up chromium-browser through the terminal the worst part is that the browser is extremely teary.teary image
this occured last time i used any gui app in wsl2 ie. gimp/jetbrains

    2024/03/01 13:24:56.942877 cmd_run.go:1055: WARNING: cannot start document portal: dial unix /run/user/1000/bus: connect: no such file or directory
[1033:1199:0301/132457.394982:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1199:0301/132457.395104:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1199:0301/132457.395155:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1199:0301/132457.395201:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1033:0301/132457.402909:ERROR:policy_logger.cc(157)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[1033:1199:0301/132457.423402:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1199:0301/132457.423470:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1197:0301/132457.476398:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1199:0301/132457.513921:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1199:0301/132457.513995:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1221:1221:0301/132457.523171:ERROR:viz_main_impl.cc(196)] Exiting GPU process due to errors during initialization

(chrome:1033): IBUS-WARNING **: 13:24:57.674: Failed to mkdir /home/nvn/snap/chromium/2768/.config/ibus/bus: Not a directory
[1033:1033:0301/132457.694013:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[1033:1281:0301/132457.694720:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1033:0301/132457.758513:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[1033:1197:0301/132457.758746:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1288:0301/132457.759669:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[1033:1288:0301/132457.760041:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[1033:1288:0301/132457.760400:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[1033:1033:0301/132457.775794:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[1033:1215:0301/132457.776615:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1033:0301/132457.784559:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[1033:1197:0301/132457.784798:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory
[1033:1033:0301/132457.785456:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[1284:1284:0301/132457.908216:ERROR:viz_main_impl.cc(196)] Exiting GPU process due to errors during initialization
[1263:7:0301/132457.989707:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
Asked By: Rando

||

WSL2 does not seem to install the right packages. Let’s fix it:

sudo apt update
sudo apt upgrade
sudo apt install dbus-x11
wsl --shutdown

Make sure you GPU drivers are updated on Windows. Also make sure you are using the recommended WSLg and not a custom X11 server.

Answered By: Daniel T