rogaha / docker-desktop

Docker Desktop enables you to create virtual desktops that can be accessed remotely. It comes with Firefox and Libreoffice already installed!
1.15k stars 288 forks source link

issue with ssh docker-desktop #7

Closed riverhuang1107 closed 11 years ago

riverhuang1107 commented 11 years ago

my test enviroment is: the win7 notebook. I installed virtual box on win7. And I installed ubuntu 12.04 on virutal box(I also installed xpra in the ubuntu).

when I execute the following command:

river@ubuntu:~$ sudo ssh docker@192.168.59.101 -p 49153 ./docker-desktop -s 800x600 -d 10

shows the following error:

/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py:14: GtkWarning: IA__gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed
  _display = gdk.get_display()
Traceback (most recent call last):
  File "/usr/bin/xpra", line 6, in <module>
    sys.exit(xpra.scripts.main.main(__file__, sys.argv))
  File "/usr/lib/python2.7/dist-packages/xpra/scripts/main.py", line 294, in main
    return run_client(parser, options, args, mode)
  File "/usr/lib/python2.7/dist-packages/xpra/scripts/main.py", line 442, in run_client
    from xpra.client import XpraClient
  File "/usr/lib/python2.7/dist-packages/xpra/client.py", line 165, in <module>
    from xpra.platform.gui import ClientExtras
  File "/usr/lib/python2.7/dist-packages/xpra/platform/gui.py", line 16, in <module>
    from xpra.xposix.gui import *
  File "/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py", line 15, in <module>
    assert _display, "cannot open the display with GTK, is DISPLAY set?"
AssertionError: cannot open the display with GTK, is DISPLAY set?
rogaha commented 11 years ago

hi @riverhuang82,

Could you please check your docker version by typing docker version ?

Also, I have updated the documentation according to the new run command behavior since docker version 0.6.6

You should run like this: CONTAINER_ID=$(docker run -d -P [username]/docker-desktop) Now we need to use the flag -P

riverhuang1107 commented 11 years ago

I haved updated the docker. Now the version is 0.7. And I run the docker run plus -P. But the error is the same. Is it possible that the issue is about the ubuntu running in virutalbox not in bare metal?

rogaha commented 11 years ago

No. It seems to be a problem with the xpra session inside of the container. Let's check step by step:

1) Show me output of this command: sudo ssh docker@192.168.59.101 -p 49153 ./docker-desktop -s 800x600 -d 10 It should ask your password and after you type it some messages should show up.

riverhuang1107 commented 11 years ago
river@ubuntu:~$ ssh docker@192.168.59.101 -p 49153 ./docker-desktop -s 800*600 -d 10
docker@192.168.59.101's password: 
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py:14: GtkWarning: IA__gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed
  _display = gdk.get_display()
Traceback (most recent call last):
  File "/usr/bin/xpra", line 6, in <module>
    sys.exit(xpra.scripts.main.main(__file__, sys.argv))
  File "/usr/lib/python2.7/dist-packages/xpra/scripts/main.py", line 294, in main
    return run_client(parser, options, args, mode)
  File "/usr/lib/python2.7/dist-packages/xpra/scripts/main.py", line 442, in run_client
    from xpra.client import XpraClient
  File "/usr/lib/python2.7/dist-packages/xpra/client.py", line 165, in <module>
    from xpra.platform.gui import ClientExtras
  File "/usr/lib/python2.7/dist-packages/xpra/platform/gui.py", line 16, in <module>
    from xpra.xposix.gui import *
  File "/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py", line 15, in <module>
    assert _display, "cannot open the display with GTK, is DISPLAY set?"
AssertionError: cannot open the display with GTK, is DISPLAY set?
river@ubuntu:~$
rogaha commented 11 years ago

It's strange. Try to ssh the container only with ssh docker@192.168.59.101 -p 49153

rogaha commented 11 years ago

Show me the output of the ls command inside of the container.

Thanks

riverhuang1107 commented 11 years ago

ssh docker@192.168.59.101 -p 49153 runs O.K. I could login in the container. And in the container, I run ./docker-desktop, it shows the same output.

riverhuang1107 commented 11 years ago
docker@76932ed87634:~$ ls
docker-desktop  spring-desktop-wallpaper-1920x1200-0911085.jpg
rogaha commented 11 years ago

Ok. Cool. So, now type xpra --version

riverhuang1107 commented 11 years ago

the xpra version is v0.3.11

rogaha commented 11 years ago

Now try this: xpra start :10 & sleep 5; xpra stop :10 & sleep 5; xpra start :10 --start-child="Xephyr -ac -screen 800x600 -query localhost -host-cursor -reset -terminate :11" --xvfb="Xvfb +extension Composite -screen 0 800x600x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority" & sleep 5 ; DISPLAY=:$DISPLAY_1 fluxbox & DISPLAY=:11 rox --pinboard=Default &

riverhuang1107 commented 11 years ago

the output is:

docker@76932ed87634:~$ xpra start :10 & sleep 5; xpra stop :10 & sleep 5; xpra start :10 --start-child="Xephyr -ac -screen 800x600 -query localhost -host-cursor -reset -terminate :11" --xvfb="Xvfb +extension Composite -screen 0 800x600x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority" & sleep 5 ; DISPLAY=:$DISPLAY_1 fluxbox & DISPLAY=:11 rox --pinboard=Default &
[1] 1202
Entering daemon mode; any further errors will be reported to:
  /home/docker/.xpra/76932ed87634-10.log
[1]+  Done                    xpra start :10
[1] 1219
xpra at :10 has exited.
[1]+  Done                    xpra stop :10
[1] 1232
Entering daemon mode; any further errors will be reported to:
  /home/docker/.xpra/76932ed87634-10.log
[1]+  Done                    xpra start :10 --start-child="Xephyr -ac -screen 800x600 -query localhost -host-cursor -reset -terminate :11" --xvfb="Xvfb +extension Composite -screen 0 800x600x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority"
[1] 1250
[2] 1251
-bash: fluxbox: command not found
[1]-  Exit 127                DISPLAY=:$DISPLAY_1 fluxbox
docker@76932ed87634:~$ 
(rox:1251): Gtk-WARNING **: cannot open display: :11

[2]+  Exit 1                  DISPLAY=:11 rox --pinboard=Default
rogaha commented 11 years ago

Sorry. Could you try this again: xpra start :10 & sleep 5; xpra stop :10 & sleep 5; xpra start :10 --start-child="Xephyr -ac -screen 800x600 -query localhost -host-cursor -reset -terminate :11" --xvfb="Xvfb +extension Composite -screen 0 800x600x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority" & sleep 5 ; DISPLAY=:11 fluxbox & DISPLAY=:11 rox --pinboard=Default & There was one missing parameter

Then show me the processes running ps ax | grep xpra

riverhuang1107 commented 11 years ago
docker@76932ed87634:~$ xpra start :10 & sleep 5; xpra stop :10 & sleep 5; xpra start :10 --start-child="Xephyr -ac -screen 800x600 -query localhost -host-cursor -reset -terminate :11" --xvfb="Xvfb +extension Composite -screen 0 800x600x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority" & sleep 5 ; DISPLAY=:11 fluxbox & DISPLAY=:11 rox --pinboard=Default &
[1] 1292
Entering daemon mode; any further errors will be reported to:
  /home/docker/.xpra/76932ed87634-10.log
[1]+  Done                    xpra start :10
[1] 1299
xpra at :10 has exited.
[1]+  Done                    xpra stop :10
[1] 1312
Entering daemon mode; any further errors will be reported to:
  /home/docker/.xpra/76932ed87634-10.log
[1]+  Done                    xpra start :10 --start-child="Xephyr -ac -screen 800x600 -query localhost -host-cursor -reset -terminate :11" --xvfb="Xvfb +extension Composite -screen 0 800x600x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority"
[1] 1330
[2] 1331
docker@76932ed87634:~$ -bash: fluxbox: command not found

(rox:1331): Gtk-WARNING **: cannot open display: :11
rogaha commented 11 years ago

I think you have changed the dockerfile. For some reason fluxbox is not installed.

riverhuang1107 commented 11 years ago

The dockerfile I used was the old version... Now when I run river@ubuntu:~$ ssh docker@192.168.59.101 -p 49153 ./docker-desktop -s 800*600 -d 10, I entered the password, and just wait, no output code.

rogaha commented 11 years ago

Alright. Try with 800x600 instead of 800*600 and let me know how it goes

riverhuang1107 commented 11 years ago

now I reached this:

river@ubuntu:~$ ssh docker@192.168.59.101 -p 49154 ./docker-desktop -s 800x600 -d 10
docker@192.168.59.101's password: 

-----------------------------------------------
Configuring the screen resolution -> 800x600
-----------------------------------------------

-----------------------------------------------
Configuring the session number -> 10 
-----------------------------------------------

Entering daemon mode; any further errors will be reported to:
  /home/docker/.xpra/665a35b5e252-10.log
xpra at :10 has exited.
Entering daemon mode; any further errors will be reported to:
  /home/docker/.xpra/665a35b5e252-10.log

----------------
Session started!
----------------

--------------------------------------------------------------------------------
Please press Control-C if you are running it directly from the ssh command line.
--------------------------------------------------------------------------------
rogaha commented 11 years ago

Awesome! Now you can open the virtual desktop with xpra --ssh="ssh -p 49154" attach ssh:docker@192.168.59.101:10 from your host machine.

riverhuang1107 commented 11 years ago

I ran xpra command in DOS, and the virtual desktop was not be opened yet. v 66pm 2 tvz t9v g7b3lw

rogaha commented 11 years ago

If you are using windows you should type: Xpra_cmd.exe --ssh="ssh -p 49154" attach ssh:docker@192.168.59.101:10

riverhuang1107 commented 11 years ago

I tried Xpra_cmd.exe, the output messages is below:

C:\Program Files\Xpra>Xpra_cmd.exe --ssh="ssh -p 49154" attach ssh:docker@192.16
8.59.101:10
xpra client version 0.10.9
connection failed: Error running ssh program '['ssh', '-p', '49154', '-l', 'dock
er', '-T', '192.168.59.101', '.xpra/run-xpra', '_proxy', ':10']': [Error 2]
rogaha commented 11 years ago

Try this: Xpra_cmd.exe --ssh="plink -p 49154" attach ssh:docker@192.168.59.101:10

riverhuang1107 commented 11 years ago

ok. the output is below:

C:\Program Files\Xpra>Xpra_cmd.exe --ssh="plink -p 49154" attach ssh:docker@192.
168.59.101:10
xpra client version 0.10.9
2013-12-04 14:37:56,994 OpenGL_accelerate module loaded
2013-12-04 14:37:57,319 Using accelerated ArrayDatatype
2013-12-04 14:37:57,946 OpenGL Version: 2.1.0 - Build 8.15.10.2202
2013-12-04 14:37:58,717 GL Extension GL_ARB_shader_objects available
2013-12-04 14:37:58,900 GL Extension GL_ARB_vertex_array_object available
2013-12-04 14:37:58,966 GL Extension GL_ARB_texture_buffer_object unavailable
2013-12-04 14:37:59,062 GL Extension GL_ARB_framebuffer_object unavailable
2013-12-04 14:37:59,130 GL Extension GL_ARB_map_buffer_range unavailable
2013-12-04 14:37:59,256 GL Extension GL_ARB_copy_buffer unavailable
2013-12-04 14:37:59,346 GL Extension GL_ARB_uniform_buffer_object unavailable
2013-12-04 14:37:59,441 GL Extension GL_ARB_draw_elements_base_vertex unavailabl
e
2013-12-04 14:37:59,505 GL Extension GL_ARB_provoking_vertex unavailable
2013-12-04 14:37:59,581 GL Extension GL_ARB_sync unavailable
2013-12-04 14:37:59,635 GL Extension GL_ARB_texture_multisample unavailable
2013-12-04 14:37:59,760 GL Extension GL_ARB_blend_func_extended unavailable
2013-12-04 14:37:59,844 GL Extension GL_ARB_sampler_objects unavailable
2013-12-04 14:38:00,163 GL Extension GL_ARB_timer_query unavailable
2013-12-04 14:38:00,221 GL Extension GL_ARB_vertex_type_2_10_10_10_rev unavailab
le
2013-12-04 14:38:00,384 GL Extension GL_ARB_draw_indirect unavailable
2013-12-04 14:38:00,486 GL Extension GL_ARB_gpu_shader_fp64 unavailable
2013-12-04 14:38:00,549 GL Extension GL_ARB_shader_subroutine unavailable
2013-12-04 14:38:00,592 GL Extension GL_ARB_tessellation_shader unavailable
2013-12-04 14:38:00,746 GL Extension GL_ARB_transform_feedback2 unavailable
2013-12-04 14:38:00,802 GL Extension GL_ARB_transform_feedback3 unavailable
2013-12-04 14:38:00,931 GL Extension GL_ARB_ES2_compatibility unavailable
2013-12-04 14:38:00,970 GL Extension GL_ARB_get_program_binary unavailable
2013-12-04 14:38:01,039 GL Extension GL_ARB_separate_shader_objects unavailable
2013-12-04 14:38:01,157 GL Extension GL_ARB_vertex_attrib_64bit unavailable
2013-12-04 14:38:01,217 GL Extension GL_ARB_viewport_array unavailable
2013-12-04 14:38:01,358 GL Extension GL_ARB_base_instance unavailable
2013-12-04 14:38:01,477 GL Extension GL_ARB_transform_feedback_instanced unavail
able
2013-12-04 14:38:01,644 GL Extension GL_ARB_internalformat_query unavailable
2013-12-04 14:38:01,724 GL Extension GL_ARB_shader_atomic_counters unavailable
2013-12-04 14:38:01,767 GL Extension GL_ARB_shader_image_load_store unavailable
2013-12-04 14:38:01,885 GL Extension GL_ARB_texture_storage unavailable
2013-12-04 14:38:02,157 GL Extension GL_ARB_clear_buffer_object unavailable
2013-12-04 14:38:02,198 GL Extension GL_ARB_compute_shader unavailable
2013-12-04 14:38:02,236 GL Extension GL_ARB_copy_image unavailable
2013-12-04 14:38:02,404 GL Extension GL_KHR_debug unavailable
2013-12-04 14:38:02,533 GL Extension GL_ARB_framebuffer_no_attachments unavailab
le
2013-12-04 14:38:02,594 GL Extension GL_ARB_internalformat_query2 unavailable
2013-12-04 14:38:02,635 GL Extension GL_ARB_invalidate_subdata unavailable
2013-12-04 14:38:02,706 GL Extension GL_ARB_multi_draw_indirect unavailable
2013-12-04 14:38:02,755 GL Extension GL_ARB_program_interface_query unavailable
2013-12-04 14:38:02,858 GL Extension GL_ARB_shader_storage_buffer_object unavail
able
2013-12-04 14:38:02,964 GL Extension GL_ARB_texture_buffer_range unavailable
2013-12-04 14:38:03,043 GL Extension GL_ARB_texture_storage_multisample unavaila
ble
2013-12-04 14:38:03,085 GL Extension GL_ARB_texture_view unavailable
2013-12-04 14:38:03,147 GL Extension GL_ARB_vertex_attrib_binding unavailable
2013-12-04 14:38:03,464 OpenGL support not enabled: some required OpenGL functio
ns are not available: glGenFramebuffers, glBindFramebuffer, glFramebufferTexture
2D
2013-12-04 14:38:04,296 read error for TwoFileConnection(ssh:docker@192.168.59.1
01:10)
Traceback (most recent call last):
  File "xpra\net\protocol.pyc", line 437, in _io_thread_loop
  File "xpra\net\protocol.pyc", line 485, in _read
  File "xpra\net\bytestreams.pyc", line 70, in read
  File "xpra\net\bytestreams.pyc", line 67, in may_abort
  File "xpra\scripts\main.pyc", line 602, in abort_test
IOError: cannot read using ['plink', '-p', '49154', '-l', 'docker', '-T', '192.1
68.59.101', '-ssh', '-agent', '.xpra/run-xpra', '_proxy', ':10']: the SSH proces
s has terminated with exit code=1
2013-12-04 14:38:04,299 connection closed after 0 packets received (0.0 bytes) a
nd 0 packets sent (0.0 bytes)

C:\Program Files\Xpra>
rogaha commented 11 years ago

Alright. I tested here and the problem is that the latest version of the Windows Xpra has some issues and it doesn't work. In order to make it works follow this steps:

1) Run on linux ssh docker@192.168.59.101 -p 49154 ./docker-desktop -s 800x600 -d 10 2) Install this version on windows https://www.xpra.org/dists/windows/Xpra_Setup_0.9.7-r3885.exe 3) Run on windws Xpra_cmd.exe --ssh="plink -P 49154" attach ssh:docker@192.168.59.101:10

It's capital P plink -P

Let me know how it goes!

rogaha commented 11 years ago

I've updated the README file to reflect that version requirement! :)

riverhuang1107 commented 11 years ago

Thank you for your patience. I have got it on windows client!

I tested on the linux client, it still has some problem:

river@ubuntu:~$ xpra --ssh="ssh -p 49154" attach ssh:docker@192.168.59.101:10
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/lib/xpra/xpra/xposix/gui.py:15: GtkWarning: IA__gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed
  _display = gtk.gdk.get_display()
docker@192.168.59.101's password: Traceback (most recent call last):
  File "/usr/bin/xpra", line 7, in <module>
    xpra.scripts.main.main(__file__, sys.argv)
  File "/usr/lib/xpra/xpra/scripts/main.py", line 232, in main
    run_client(parser, options, args, mode)
  File "/usr/lib/xpra/xpra/scripts/main.py", line 367, in run_client
    from xpra.client import XpraClient
  File "/usr/lib/xpra/xpra/client.py", line 25, in <module>
    from xpra.platform.gui import ClientExtras
  File "/usr/lib/xpra/xpra/platform/gui.py", line 16, in <module>
    from xpra.xposix.gui import *
  File "/usr/lib/xpra/xpra/xposix/gui.py", line 16, in <module>
    assert _display, "cannot open the display with GTK, is DISPLAY set?"
AssertionError: cannot open the display with GTK, is DISPLAY set?
river@ubuntu:~$ 
rogaha commented 11 years ago

Awesome!

From linux i would be possible only with you have a real Linux VM with a GUI. I saw that you were trying to do it from a terminal, but it's not possible because you don't have a GUI on Linux to support the virtual desktop.

You can download one Linux Distro, install it with VirtualBox in your Windows and it should work! :)