gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Unable to run Firefox in Gitpod workspace or Unable to install Firefox with snap

Open shaal opened this issue 1 year ago • 4 comments

Bug description

When trying to run Firefox in a Gitpod workspace through VNC, it fails with an error that Firefox needs to be installed via Snap. However, installing Snap and running Snap packages in Gitpod workspaces is problematic.

Steps to reproduce

  1. Open https://gitpod.io/#https://github.com/gitpod-samples/template-x11-vnc

Workspace affected

No response

Expected behavior

Firefox should open and run in the Gitpod workspace when launched through the VNC server.

Actual behavior

When trying to run Firefox from command line firefox, I am getting this error -

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

snap install firefox

When running snap install firefox, I am getting this error -

error: cannot communicate with server: Post "http://localhost/v2/snaps/firefox": dial unix /run/snapd.socket: connect: no such file or directory

Example repository

https://github.com/gitpod-samples/template-x11-vnc

Anything else?

It seems there are challenges getting Snap working properly in Gitpod. An alternative solution would be finding a way to install Firefox without using Snap.

shaal avatar Jan 20 '24 17:01 shaal

@shaal Try running the following command (you can also add it in your ~Gitpod Dockerfile~ or Gitpod yml file):

sudo apt-get update && sudo apt-get install firefox

It should work:

image

Siddhant-K-code avatar Jan 21 '24 18:01 Siddhant-K-code

@Siddhant-K-code thank you! When I add Firefox in dockerfile - it does NOT work, but if I add it in .gitpod.yml - it works as expected.

I see the same issue in the PR you opened, where Firefox is installed in dockerfile, but doesn't appear in vnc - https://github.com/gitpod-samples/template-x11-vnc/pull/1

shaal avatar Jan 22 '24 05:01 shaal

Yeah, I tested it yesterday on that PR, it was not working as intended. But, When I manually run the command (via .gitpod.yml) it worked somehow 🤷🏼‍♂️

Siddhant-K-code avatar Jan 22 '24 05:01 Siddhant-K-code

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 23 '24 15:05 github-actions[bot]