Gitpod sudo in workspace

I’m running Gitpod self hosted, and wonder if sudo in the workspace is supported?
Also which versions of Ubuntu, Docker and Kubernetes needs to be installed to enable this feature.

Thanks in advance!

Hi @ranzbak!

That’s awesome! :raised_hands:

Yes, sudo in Gitpod was rolled out behind a flag in December 2020, and made generally available in March 2021 (so any Self-Hosted release after March 2021 should have sudo working out-of-the-box with no extra configuration required).

In general, I would follow the version requirements of Gitpod Self-Hosted. sudo itself should reliably work with pretty much any supported Linux distribution (e.g. Ubuntu, Debian, Alpine, Amazon Linux).

If you encounter any specific bug, please report it here and we’ll do our best to get it resolved. :slight_smile:

The thing is that I don’t know if it’s a bug or it’s a configuration error on my side.

When I try to use Sudo

sudo apt-get install wget
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the ‘nosuid’ option set or an NFS file system without root privileges?

I have the ‘Enable Feature Preview’ box ticked.

I’m running one install on CentOS 8, and the other test one on Ubuntu 20.10.
Rancher 2.5.7 with Kubernetes 1.20.6, Flannel network, Docker 20.10.2

On Ubuntu the ShiftFS module is loaded

The workspaces are created on local disk.

I can provide more information about my configuration if needed.

I still get the error, after going through every suggested fix I could find, hence my question above.

I did some more digging, and using strace I found :
geteuid() = 33333

It seems the syscall doesn’t give the correct uid.

I’ve downgraded to Kubernetes 17.17 on RKE, using Flannel as the network layer.
The nodes are running Ubuntu 20.10, 4 CPU cores 16Gb each, 3 nodes total.
The shiftfs kernel module is loaded

lsmod | grep shift
shiftfs                28672  0

The storage the Workspace file system are located on are on local disk, not NFS.
/var/lib/docker/overlay2

The error:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

Still the error persists, what do I miss where should I look, as you @jan say that the feature should work out of the box?

Cheers, Paul