Starting vncserver using supervisord inside a Linux container

I’m trying to start vncserver using supervisord at the bootup time for the lxc container (I don’t think being a container is relevant). The issue is that the machine starts as root. My supervisord program section looks like:

[program:vnc]
directory=/
user=ubuntu
environment=HOME="/home/ubuntu",USER="ubuntu"
priority=901
command=/usr/bin/vncserver -fg -geometry 1024x768 :1

However, I find that the log files show its trying to create a password, though there already exists a password in /home/ubuntu/.vnc/passwd

  • Deploying mean stack application to my server [closed]
  • Development workflow for a Clojure webapp with Docker
  • Why might gunicorn be hanging in this configuration?
  • how to use test-kitchen in multi node environment?
  • Docker image dns probem, name solve failed
  • Dockered Play app gives IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap
  • Wondering if I am missing something? Isn’t user supposed to change the user, $HOME and $USER before running the command?

  • docker run git checkout doesn't fetch changes in the branch?
  • Configure 3 Mesos instance with 1 master using docker and docker-compose
  • Rancher: Unsupported config option for xxx service: 'upgrade_strategy'"
  • Setting up redis with docker
  • Track docker repositories pull
  • not able to access angular2 app from docker container
  • One Solution collect form web for “Starting vncserver using supervisord inside a Linux container”

    You can define to run a container with specific user’s name (if existing) or UID without any existing user in the image/container.

    Docker documentation: https://docs.docker.com/engine/reference/run/#user

    USER

    root (id = 0) is the default user within a container. The image
    developer can create additional users. Those users are accessible by
    name. When passing a numeric ID, the user does not have to exist in
    the container.

    The developer can set a default user to run the first process with the
    Dockerfile USER instruction. When starting a container, the operator
    can override the USER instruction by passing the -u option.

    -u="": Username or UID
    

    Note: if you pass a numeric uid, it must be in the range of
    0-2147483647.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.