DEV Community

loading...

Snapd doesn't work on WSL2 Ubuntu20.04

dozo
Still alive
・1 min read

You can't install chromium browser on WSL2 Ubuntsu20.04 because Ubuntsu only support snap version.

chromium-browser --headless 

Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:

snap install chromium
error: cannot communicate with server: Post http://localhost/v2/snaps/chromium: dial unix /run/snapd.socket: connect: no such file or directory
Enter fullscreen mode Exit fullscreen mode

You can try this.

sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME

snap version
Enter fullscreen mode Exit fullscreen mode

https://github.com/microsoft/WSL/issues/5126#issuecomment-653715201

Discussion (0)