consol / docker-headless-vnc-container Goto Github PK
View Code? Open in Web Editor NEWCollection of Docker images with headless VNC environments
License: Apache License 2.0
Collection of Docker images with headless VNC environments
License: Apache License 2.0
Thx to Gerassimos, the version v1.2.0
has a small bug in the sartup scirpt.
TODO: add -p
to mkdir
Hello
Thank you in advance for any help you can provide
I have an issue related the docker image "consol/centos-xfce-vnc"
I have created a running container with the following command:
# docker run -d -p 5901:5901 -p 6901:6901 --name centos7-xfce-vnc consol/centos-xfce-vncthen I have stopped the container :
# docker stop centos7-xfce-vncWhen I try to (re)start the container I get the following error
# docker start -i centos7-xfce-vnc USER_ID: 1984, GROUP_ID: 0 nss_wrapper location: /usr/lib64/libnss_wrapper.so ------------------ update chromium-browser.init ------------------ ... set window size 1280 x 1024 as chrome window size! ------------------ change VNC password ------------------ mkdir: cannot create directory ‘/headless/.vnc’: File exists
Do I miss something ???
Than you.
Regards
Gerassimos
On newer kernel or docker versions it is possible, that the chrome won't start. This error occurs, because of the cgroup permissions.
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
Solution: start the chromium with the flag --no-sandbox
=> add this to the default config in the Dockerfile
Chrome won't come up in new version, maybe wrapper script doesn't work any more :/
docker run -it -p 6901:6901 consol/centos-xfce-vnc:dev chromium-browser
....
/usr/bin/chromium-browser: line 57: /headless/install/chromium-wrapper: No such file or directory
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
[1:1:0901/144950.448916:FATAL:zygote_host_impl_linux.cc(182)] Check failed: ReceiveFixedMessage(fds[0], kZygoteBootMessage, sizeof(kZygoteBootMessage), &boot_pid).
#0 0x7f60675e3017 base::debug::StackTrace::StackTrace()
#1 0x7f6067601d77 logging::LogMessage::~LogMessage()
#2 0x7f6061929cb3 content::ZygoteHostImpl::LaunchZygote()
#3 0x7f6061928d5c content::ZygoteCommunication::Init()
#4 0x7f606192927e content::CreateZygote()
#5 0x7f606159315f content::BrowserMainLoop::EarlyInitialization()
#6 0x7f6061596179 content::BrowserMainRunnerImpl::Initialize()
#7 0x7f606158f632 content::BrowserMain()
#8 0x7f6061c2f868 content::ContentMainRunnerImpl::Run()
#9 0x7f604e5c8322 service_manager::Main()
#10 0x7f6061c2e3e1 content::ContentMain()
#11 0x00f0ecd95d44 <unknown>
#12 0x7f6050f3db35 __libc_start_main
#13 0x00f0ecd95be2 <unknown>
Received signal 6
#0 0x7f60675e3017 base::debug::StackTrace::StackTrace()
#1 0x7f60675e3403 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7f6067940370 <unknown>
#3 0x7f6050f511d7 __GI_raise
#4 0x7f6050f528c8 __GI_abort
#5 0x7f60675e1de5 base::debug::BreakDebugger()
#6 0x7f6067601e05 logging::LogMessage::~LogMessage()
#7 0x7f6061929cb3 content::ZygoteHostImpl::LaunchZygote()
#8 0x7f6061928d5c content::ZygoteCommunication::Init()
#9 0x7f606192927e content::CreateZygote()
#10 0x7f606159315f content::BrowserMainLoop::EarlyInitialization()
#11 0x7f6061596179 content::BrowserMainRunnerImpl::Initialize()
#12 0x7f606158f632 content::BrowserMain()
#13 0x7f6061c2f868 content::ContentMainRunnerImpl::Run()
#14 0x7f604e5c8322 service_manager::Main()
#15 0x7f6061c2e3e1 content::ContentMain()
#16 0x00f0ecd95d44 <unknown>
#17 0x7f6050f3db35 __libc_start_main
#18 0x00f0ecd95be2 <unknown>
r8: 00007fffd6de9a00 r9: 00007f6051065ef0 r10: 0000000000000008 r11: 0000000000000202
r12: 00007fffd6de9f48 r13: 0000000000000000 r14: 00007fffd6de9a00 r15: 00007fffd6dea160
di: 0000000000000001 si: 0000000000000001 bp: 00007f6051afd3e0 bx: 00007fffd6de9f40
dx: 0000000000000006 ax: 0000000000000000 cx: 00007f6050f511d7 sp: 00007fffd6de9678
ip: 00007f6050f511d7 efl: 0000000000000202 cgf: 002b000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
failed to get d-bus connection:operation not permitted
I've had the same issue with Ubuntu and have not been able to figure out the cause. The error in the Guacamole log seems to indicate an error with the TLS encryption so I would ask for a way to disable requiring encryption to connect. I might fork and attempt to add an option myself to test.
Adjusting images that they run without modifications in the Open Shift.
Host: OS X 10.12.5 MacBook Pro
Docker version 17.06.0-ce-rc1, build 7f8486a
Running with docker run -d --rm --name vnc -p 5901:5901 -p 6901:6901 consol/ubuntu-xfce-vnc
Connecting with Screen Sharing to "vnc://localhost:5901
VNC starts up successful. I can launch chromium, and browse.
Launching UXTerm results in a warning:
uxterm tried unsuccessfully to use local en_US.UTF-8 by setting $LC_CTYPE to "en_US.UTF-8".
Clicking the 'okay' button at the lower left closes the window.
Launching normal XTerm results in the expected message:
USER_ID: 1984, GROUP_ID: 0
nss_wrapper location: /usr/lib/libnss_wrapper.so
As long as I do not click into the xterm window, everything is fine. As soon as I do, the VNC session stops accepting mouse/keyboard input at all.
Restarting the VNC session (without restarting the container) succeeds. The vnc session accepts input again.
Feels like a missing configuration, but I am not familiar enough with X config. So, not sure where to look.
Ideas?
Hi,
A new container cannot be started by this command:
docker run --name xxxx -p 8999:5901 -p 9999:6901 -e "VNC_PW=xxxx" --privileged -d consol/ubuntu-xfce-vnc
please help to check.
Thanks.
(xfsettingsd:71): xfsettingsd-WARNING **: Failed to get the _NET_NUMBER_OF_DESKTOPS property.
(xfwm4:62): xfwm4-WARNING **: Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined
/etc/xdg/xfce4/xinitrc: line 172: which: command not found
** Message: First Orage start. Searching default timezone.
** Message: Default timezone set to Zulu.
** Message: Orage **: 15:53:54 wakeup timer init 0
Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined
** Message: Orage **: 15:53:54 Created alarm list for main Orage file:
** Message: Orage **: 15:53:54 Added 0 alarms. Processed 0 events.
** Message: Orage **: 15:53:54 Found 0 alarms of which 0 are active. (Searched 0 recurring alarms.)
** (orage:93): WARNING **: Failed to connect to D-BUS daemon: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
I want to install cuda in your docker image.
The error shows that the running X server stops the installation.
Thank you very much !
@toschneck
Hi, I create a container with command 'docker run --name AAA -d -p 5902: 5901 -p 6902: 6901 consol/ubuntu-xfce-vnc',
then I put some documents to container, and commit container
docker commit AAA AAA:test
then I create new container using this new images:
docker run --name BBB -d -p 5903: 5901 -p 6903: 6901 AAA:test
but I cannot connet this container via VNC view,
I found some ps didn't start:
root@2d08a0d421eb:/# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 17964 1548 ? Ss 08:35 0:00 /bin/bash /root/scripts/vnc_startup.sh --tail-log
root 11 0.0 0.0 18000 1596 ? S 08:35 0:00 bash /root/noVNC/utils/launch.sh --vnc 172.17.0.4:5901 --listen 6901
root 24 0.1 0.0 39984 10360 ? S 08:35 0:00 python /root/noVNC/utils/websockify/run --web /root/noVNC/utils/../ 6901 172.17.0.4:5901
root 36 0.0 0.0 4380 616 ? S 08:35 0:00 tail -f /root/.vnc/556278db7553:1.log
root 37 0.6 0.0 18192 1980 ? Ss 08:35 0:00 /bin/bash
root 52 0.0 0.0 15560 1124 ? R+ 08:35 0:00 ps aux
the normal(AAA) should be:
root@556278db7553:/# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 17964 1552 ? Ss 08:10 0:00 /bin/bash /root/scripts/vnc_startup.sh --tail-log
root 12 0.0 0.0 18000 1600 ? S 08:10 0:00 bash /root/noVNC/utils/launch.sh --vnc 172.17.0.3:5901 --listen 6901
root 26 0.0 0.0 40240 10356 ? S 08:10 0:00 python /root/noVNC/utils/websockify/run --web /root/noVNC/utils/../ 6901 172.17.0.3:5901
root 39 0.0 0.0 104440 24628 ? S 08:10 0:00 Xvnc4 :1 -desktop 556278db7553:1 () -auth /root/.Xauthority -geometry 1280x1024 -depth 24 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn -fp /usr/X11R6/lib/X1
root 44 0.0 0.0 4440 648 ? S 08:10 0:00 /bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc
root 49 0.0 0.0 30656 1792 ? S 08:10 0:00 vncconfig -iconic
root 74 0.0 0.0 10620 312 ? Ss 08:10 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
root 77 0.0 0.0 24432 596 ? S 08:10 0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
root 78 0.0 0.0 39256 1264 ? Ss 08:10 0:00 //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
root 88 0.0 0.0 235564 6728 ? Sl 08:10 0:00 xfce4-session
root 90 0.0 0.0 39452 2472 ? S 08:10 0:00 /usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd
root 94 0.0 0.0 154516 9904 ? S 08:10 0:00 xfwm4
root 98 0.0 0.0 353840 14492 ? Sl 08:10 0:00 xfce4-panel
root 100 0.0 0.0 162312 6184 ? S 08:10 0:00 Thunar --daemon
root 102 0.0 0.0 488816 28624 ? Sl 08:10 0:00 xfdesktop
root 106 0.0 0.0 326004 9248 ? Ssl 08:10 0:00 xfsettingsd
root 112 0.0 0.0 356956 3532 ? Sl 08:10 0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
root 119 0.0 0.0 39124 1736 ? S 08:10 0:00 /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
root 122 0.0 0.0 124908 3288 ? Sl 08:10 0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
root 126 0.0 0.0 189620 3028 ? Sl 08:10 0:00 /usr/lib/gvfs/gvfsd
root 136 0.0 0.0 204848 3060 ? Sl 08:10 0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
root 146 0.0 0.0 356656 3724 ? Sl 08:10 0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.14 /org/gtk/gvfs/exec_spaw/0
root 150 0.0 0.0 142788 6464 ? S 08:10 0:00 /usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libsystray.so 6 14680098 systray Notification Area Area where notification
root 153 0.0 0.0 152988 8512 ? S 08:10 0:00 /usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libactions.so 2 14680099 actions Action Buttons Log out, lock or other syst
root 156 0.0 0.0 4380 616 ? S 08:10 0:00 tail -f /root/.vnc/556278db7553:1.log
root 157 0.1 0.0 18192 2000 ? Ss 08:44 0:00 /bin/bash
root 172 0.0 0.0 15560 1124 ? R+ 08:45 0:00 ps aux
Could you help me check this issue?
thanks.
Hi, beginner docker enthusiast here. I have a dumb question. If someone can shed some light on this issue it would be awesome. I want to add qt to this vnc image. I tried manually, starting a container with ubuntu-xfce-vnc, logging via vnc and then installing qt from the website. And vnc works + qt. I then commited the changes to another image (test_image). The issue is when i start a new container from my new image of vnc+qt (test_image), vnc doesn't work anymore and i have no ideea why. I thought it was something with qt, but it seems even if i do just a apt-get update and install a simple packet, like nano/ping/etc ... and commit changes, vnc doesnt work in the new container. Any idea? Am I doing something wrong? Thanks in advance
Fri Mar 17 21:20:58 2017
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: Listening for HTTP connections on all interface(s), port 5801
vncext: created VNC server for screen 0
XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
Fatal server error:
Failed to activate core devices.
Problem: Some necessary x-packages are missing like: xfonts-base xauth xinit
Thanks for this container. In ubuntu-xfce-vnc
, Firefox complains that there's an update but it lacks the permissions to perform the update. I'm using this container as a kiosk/meeting room display, and so the message popping up is not helpful.
I can disable automatic updates in Firefox, but could it be helpful to disable the updates in the core image itself?
Hello,
Very interesting software. Thanks for sharing it.
I'd like to be able to have a login window, before falling directly to the desktop. In other words, I'd like to put this docker in a server and let multiple users connect to the docker.
Any hint ?
Thanks
I invoked this locally:
docker run -d -p 5901:5901 -p 6901:6901 consol/centos-xfce-vnc
have one of the images running:
CONTAINER ID IMAGE COMMAND CREATED STATUS >PORTS NAMES
647fb595da6c consol/centos-xfce-vnc "/dockerstartup/vn..." 4 hours ago Up 4 hours 0.0.0.0:5901->5901/tcp, 0.0.0.0:6901->6901/tcp stupefied_goldberg
However, when I try to connect with vnc viewer I get a connection refused error:
Running on Mac OS X 10.10, firewall is off
To be able to prevent the VNC control access at the container startup, introduce a ENV var to set view only mode.
The container runs in bridge mode as expected, but can not started in host mode.
The problem is in the vnc_startup.sh script:
VNC_IP=$(ip addr show eth0 | grep -Po 'inet \K[\d.]+')
A workaround is to set the VNC_IP=127.0.0.1, but there should be a better solution.
set environment variable TERM
:
export TERM=xterm
@rbo is this the best way?
Hi
I suggest this patch to avoid relying on nic name
diff --git a/src/common/scripts/vnc_startup.sh b/src/common/scripts/vnc_startup.sh
index 7044bc2..8da7d87 100755
--- a/src/common/scripts/vnc_startup.sh
+++ b/src/common/scripts/vnc_startup.sh
@@ -17,7 +17,7 @@ fi
$STARTUPDIR/chrome-init.sh
## resolve_vnc_connection
-VNC_IP=$(ip addr show eth0 | grep -Po 'inet \K[\d.]+')
+VNC_IP=$(ip route get 1 | awk '{print $NF;exit}')
## change vnc password
echo -e "\n------------------ change VNC password ------------------"
when try to use -e "VNC_PW=my-new-password" the container stops and exited directly
Hello,
I have created one container with the following command:
[username@localhost ~]# docker run -d -p 5901:5901 -e VNC_RESOLUTION=1920x1080 -p 6901:6901 consol/ubuntu-xfce-vnc c6e7194d9ed19f2f291d6cd1925a4352965c37c6692adf2c502e6cf47226a91c
And then when I tired to create another container on the same host with different port number I got the following error:
[username@localhost ~]# docker run -d -p 5901:5901 -e VNC_RESOLUTION=1920x1080 -p 6902:6902 consol/ubuntu-xfce-vnc bb77aa923ed98642601049703bfdc8712cc34b2467aa5f235a61c24c41ea3341 /usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint pedantic_pasteur (1593ca8771edb808e917ee5e60a2a2d07c0e63a8fb8ed38a4d42e50cbf6145a6): Bind for 0.0.0.0:5901 failed: port is already allocated.
So, what is the right way in order to mange this scenario?
Thanks!
add like for ubuntu UTF-8 local, to be nearer to a end-user environment:
RUN locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
How do I get root access? I want to install something after launching the container, but it says I need root access.
When I type sudo
, it says:
sudo: unknown uid 1984: who are you?
Hi everyone,
I have this Dockerfile
FROM consol/ubuntu-xfce-vnc:latest
MAINTAINER Gaston Maron "[email protected]"
ENV REFRESHED_AT 2017-08-30
USER 0
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y build-essential \
&& apt-get install -y nano \
&& apt-get install -y net-tools \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:openjdk-r/ppa \
&& apt-get update \
&& apt-get install -y openjdk-7-jdk
USER 1984
ENTRYPOINT ["/dockerstartup/vnc_startup.sh"]
and when I try to run the image, the container halts itself.
The log file
------------------ VNC environment started ------------------
VNCSERVER started on DISPLAY= :1
=> connect via VNC viewer with 172.17.0.4:5901
noVNC HTML client started:
=> connect via http://172.17.0.4:6901/?password=...
...
(xfwm4:117): libxfce4ui-WARNING **: ICE I/O Error
(xfwm4:117): libxfce4ui-WARNING **: Disconnected from session manager.
(xfsettingsd:132): libxfce4ui-WARNING **: ICE I/O Error
(xfsettingsd:132): libxfce4ui-WARNING **: Disconnected from session manager.
Do you know what is the problem here?
Thanks!
Hi,
I might be wrong but it seems that $HOME variable cannot be defined and also used within the same ENV command.
I can see that these variables are set to these values:
INST_SCRIPTS=/install
NO_VNC_HOME=/noVNC
Looking at the file https://github.com/ConSol/docker-headless-vnc-container/blob/master/Dockerfile.centos.xfce.vnc
and
the details from here:
https://microbadger.com/images/consol/centos-xfce-vnc
I suppose the intention was not to move those two folders out of /headless, correct?
Thanks,
Michal Miklas
Hello,
Is there a way to start the container with an user instead of root ?
Regards,
First of all, Thank you for making such useful container!
I started the container as root, then I realized that the app that I want to run requires a non-root user, I added a user via adduser
but I couldn't get xface
to switch to it, probably not possible.
I started the container using --user $(id -u):$(id -g)
, now I'm not root, but I can't install anything, su
says Cannot determine your user name
.
commits on branch dev
won't trigger the correct docker-hub build currently.
see: http://labs-build.consol.de/job/HeadlessVNC_trigger_Docker_build/46/
consol/ubuntu-icewm-vnc
mac os x / chrome 58
remove Screensaver from all images
the terminal in vnc can't copy and paste
What is the container's root password?
Change the image, so that the Permissions will be set correctly on every inherit build
RUN $INST_SCRIPTS/set_user_permission.sh $STARTUPDIR $HOME
Since version 52 is enrolled firefox crash in the dev
container:
ExceptionHandler::GenerateDump cloned child 99
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...
Segmentation fault (core dumped)
=> use older version
hi ,thanks for your work, and I want to know what's the root password
Hi there,
I'd like to make sure that Chromium saved passwords are not visible in the VNC in a state I've saved. I'm using your Centos/XFCE distribution. The way to do this appears to be to install gnome-keyring and administer it with seahorse, thus making it the password provider for Chromium. I've added both utilities, but neither they (nor I) can understand what you've done with the "default" login (uid 1984). I can't set a password for this login (passwd tells me "cannot identify you"). Adding users results in password-less users being created... very confusing. Could you please indicate how to:
Enable a login-free desktop that nonetheless has an implicit password for a user that triggers the gnome keyring to function properly? Thank you so much in advance for your help.
Since the new version of firefox 52.02
, it reserves a lot of not needed memory. See ConSol/sakuli#276
Temporary solution: go back to previous firefox 45
TODO: Try later again to fix this issue
command to validate memory usage: ps -o rss= -p <pidof> | awk '{print $1*4/1024, "MiB"}'
Hello,
Is it possible to fit the Screen resolution to the browser's window size automatically?
Thanks!
use openJDK for all images:
remove:
### Install some basic libs and JDK8
RUN wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm" -O /root/jdk.rpm \
&& yum install -y /root/jdk.rpm unzip \
&& rm /root/jdk.rpm \
&& yum clean all -y
ENV JAVA_HOME /usr/java/jdk1.8.0_112
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.