Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open window in docker headless even tried xvfb, no-sand-box #243

Open
dlintw opened this issue Jan 6, 2020 · 2 comments
Open

Can't open window in docker headless even tried xvfb, no-sand-box #243

dlintw opened this issue Jan 6, 2020 · 2 comments
Labels
electron Issues related to the underlying Electron instance

Comments

@dlintw
Copy link

dlintw commented Jan 6, 2020

I'm runing Arch Linux with these packages installed

  • electron 7.1.7-1
  • xorg-server-xvfb 1.20.6-3
  • julia 2:1.3.1-1

In command line shell, I could run electron by 'electron --no-sandbox', here is the command for launch julia

export ELECTRON_PATH=/usr/bin/electron
xvfb-run julia

In the julia, I type in these command

using Blink
w = Window(Dict("webPreferences.sandbox"=>false))

Still got the following error messages

ERROR: IOError: connect: connection refused (ECONNREFUSED)
Stacktrace:
 [1] connect at /build/julia/src/julia-1.3.1/usr/share/julia/stdlib/v1.3/Sockets/src/Sockets.jl:555 [inlined]
 [2] connect(::Sockets.IPv4, ::Int64) at /build/julia/src/julia-1.3.1/usr/share/julia/stdlib/v1.3/Sockets/src/Sockets.jl:541
 [3] #try_connect#5(::Float64, ::Int64, ::typeof(Blink.AtomShell.try_connect), ::Sockets.IPv4, ::Vararg{Any,N} where N) at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/process.jl:79
 [4] try_connect at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/process.jl:77 [inlined]
 [5] #init#6(::Bool, ::typeof(Blink.AtomShell.init)) at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/process.jl:93
 [6] #init at ./none:0 [inlined]
 [7] #shell#9(::Bool, ::typeof(shell)) at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/process.jl:129
 [8] shell at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/process.jl:127 [inlined]
 [9] #Window#14(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type{Window}, ::Dict{String,Bool}) at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/window.jl:89
 [10] Window(::Dict{String,Bool}) at /home/dlin/.julia/packages/Blink/4FM8Y/src/AtomShell/window.jl:89
 [11] top-level scope at REPL[6]:1
@dlintw dlintw changed the title Can't open window in docker headless even tryed xvfb, no-sand-box Can't open window in docker headless even tried xvfb, no-sand-box Jan 6, 2020
@twavv
Copy link
Member

twavv commented Jan 6, 2020

I can reproduce this using the Julia 1.3 image.

docker run --rm -it julia:1.4

# At container prompt
apt update && apt install -y unzip xvfb
julia -e 'using Pkg; Pkg.add("Blink")'
julia -e 'using Blink; w = Window()'

@twavv twavv added the electron Issues related to the underlying Electron instance label Jan 7, 2020
@adrien-le-franc
Copy link

Hi,
I had a similar problem and I found the following workaround: you can open a window in your browser, similar to what people do for reading a jupyter notebook from docker.

First, start docker with

docker run --rm -it -p 8700:8700 julia:1.4

then in the Julia prompt, start the server as follows:

using Sockets
using MeshCat
vis = Visualizer(MeshCat.CoreVisualizer(ip"0.0.0.0", 8700), ["meshcat"])

you should be able to reach the url at http://localhost:8700/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron Issues related to the underlying Electron instance
Projects
None yet
Development

No branches or pull requests

3 participants