Score:0

error while loading shared libraries: libxshmfence.so.1:

cn flag

I'm trying to install VS Code inside a docker container and run it from there.

This is my Dockerfile:

FROM ubuntu:latest
RUN apt-get update && apt-get install -y firefox
RUN apt install -y xauth
CMD ["/usr/bin/firefox"]

And then I run xhost + to let access to everyone to my display (I know it has a security risk, I just want it to work at first then I'll fix these things one by one).

Then I use this command:

docker run --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" my-app

And Firefox runs perfectly from inside the container.

Then I use docker exec -it container_id bash to get an interactive bash inside the container and I run these commands to install VS Code:

apt install wget
wget https://go.microsoft.com/fwlink/?LinkID=760868
mv downloaded_file vscode.deb
apt install vscode.deb -y

And VS Code gets installed. But when I want to run it I get this error:

code --user-data-dir="~/.vscode-root"

/usr/share/code/bin/../code: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory

How should I fix this?

Knud Larsen avatar
by flag
On-line search : https://packages.ubuntu.com/search?mode=filename&suite=focal&section=all&arch=amd64&keywords=libxshmfence.so.1&searchon=contents → Package name = **libxshmfence1** .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.