docker-ubuntu-desktop icon indicating copy to clipboard operation
docker-ubuntu-desktop copied to clipboard

unprivilieged user

Open vilinski opened this issue 8 years ago • 6 comments

Hi, is it somehow possible to make it working with an unprivilieged user? Some apps (e.g. visual studio code ) won't work under root account

vilinski avatar Dec 08 '16 13:12 vilinski

It's just a docker container.. I believe you should be able to add a non-priviledged user via the terminal and su into the user and/or launch the app with that user

queeno avatar Dec 08 '16 14:12 queeno

sure, but I thought it were possible to do with Dockerfile to get a vnc user session. Tried it myself with no success so far

# add user
ENV user developer
ENV HOME /home/$user
RUN useradd -d $HOME -ms /bin/bash $user && \
    echo "$user:$user" | chpasswd && adduser $user sudo
RUN mkdir $HOME/.vnc
ADD xstartup $HOME/.vnc/xstartup
ADD passwd $HOME/.vnc/passwd
RUN chmod 600 $HOME/.vnc/passwd
RUN chown -R $user $HOME

# start vnc server
USER $user
CMD /usr/bin/vncserver :1 -geometry 1280x800 -depth 24 && tail -f $HOME/.vnc/*:1.log
vscode_1  | xauth:  file /home/developer/.Xauthority does not exist
vscode_1  |
vscode_1  | New 'X' desktop is dafe3263e851:1
vscode_1  |
vscode_1  | Starting applications specified in /home/developer/.vnc/xstartup
vscode_1  | Log file is /home/developer/.vnc/dafe3263e851:1.log
vscode_1  |
vscode_1  | 09/12/16 11:05:59 Copyright (C) 1999 AT&T Laboratories Cambridge
vscode_1  | 09/12/16 11:05:59 All Rights Reserved.
vscode_1  | 09/12/16 11:05:59 See http://www.tightvnc.com/ for information on TightVNC
vscode_1  | 09/12/16 11:05:59 Desktop name 'X' (dafe3263e851:1)
vscode_1  | 09/12/16 11:05:59 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
vscode_1  | 09/12/16 11:05:59 Listening for VNC connections on TCP port 5901
vscode_1  | Font directory '/usr/share/fonts/X11/Type1/' not found - ignoring
vscode_1  | Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
vscode_1  | Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
vscode_1  | sh: 1: /home/developer/.vnc/xstartup: not found

vilinski avatar Dec 09 '16 11:12 vilinski

Same issue here. Google Chrome and tor won't allow it to run in root mode. @vilinski Where you able to get this working?

cesarandreslopez avatar Dec 16 '16 17:12 cesarandreslopez

it must be something obvious, but no, still no luck for me

vilinski avatar Dec 21 '16 21:12 vilinski

@vilinski I decided to go with my own repository and build this: https://github.com/cesarandreslopez/docker-ubuntu-mate-desktop-nomachine It might be helpful. It runs on none root, and uses nomachine which is way better performance for remote sessiones.

cesarandreslopez avatar Dec 22 '16 23:12 cesarandreslopez

@cesarandreslopez thanks for sharing! i will try it

vilinski avatar Dec 23 '16 00:12 vilinski