Reputation: 25
I have several remote servers on which I run headless Chromium browsers. I've begun to need to be able to see the actual browser windows from the remote servers and be able to interract with them. On my local computer. At least I want to see the remote browser windows.
Is that possible at all?
The remote servers have no physical monitor/screen.
Upvotes: 1
Views: 2160
Reputation: 3138
There are several docker images of selenium for debugging, using VNC.
Here's the link to their github.
When you run the image, don't forget to bind the port for VNC.
docker run -d -p 4444:4444 -p VNC_PORT:5900 [...]
You can then download a VNC viewer here.
You'll just have to specifcy the hostname and port of your remote machine and you're ready to go.
EDIT: If you don't have docker and if you really don't want to install it, here the link to an example of debug docker file with chrome. You'll find what they do to install VNC on top of the browser.
Here's what they do:
#=====
# VNC
#=====
RUN apt-get update -qqy \
&& apt-get -qqy install \
x11vnc \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#=================
# Locale settings
#=================
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
RUN locale-gen en_US.UTF-8 \
&& dpkg-reconfigure --frontend noninteractive locales \
&& apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
language-pack-en \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#=======
# Fonts
#=======
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
fonts-ipafont-gothic \
xfonts-100dpi \
xfonts-75dpi \
xfonts-cyrillic \
xfonts-scalable \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#=========
# fluxbox
# A fast, lightweight and responsive window manager
#=========
RUN apt-get update -qqy \
&& apt-get -qqy install \
fluxbox \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#==============================
# Generating the VNC password as seluser
# So the service can be started with seluser
#==============================
RUN mkdir -p ~/.vnc \
&& x11vnc -storepasswd secret ~/.vnc/passwd
Upvotes: 2