Docker Community Forums

Share and learn in the Docker community.

Docker throw oserror:8 when running dbw_mkz_gazebo on vnc server

i wanna run docker gazebo on a server without display terminal.
so I am using x11vnc to transfer the desktop via internet.
gazebo can run normally。
but when running mkz_spawner, an error occur, say "OSERROR :8 ".
and I got some advice online, such as add “bash” when “docker run container”. But doesnot work.

anyone can give me some clue.thanks a lot.

[ERROR] 2020-05-15 06:46:53
[roslaunch.pmon][INFO] 2020-05-15 06:46:52,463: ProcessMonitor.register[gazebo_gui-3]
[roslaunch.pmon][INFO] 2020-05-15 06:46:52,463: ProcessMonitor.register[gazebo_gui-3] complete
[roslaunch][INFO] 2020-05-15 06:46:52,463: … registered process [gazebo_gui-3]
[roslaunch][INFO] 2020-05-15 06:46:52,464: process[gazebo_gui-3]: starting os process
[roslaunch][INFO] 2020-05-15 06:46:52,464: process[gazebo_gui-3]: start w/ args [[u’/opt/ros/kinetic/lib/gazebo_ros/gzclient’, ‘-g’, ‘libdbw_mkz_gazebo_camera.so’, u’__name:=gazebo_gui’, u’__log:=/root/.ros/log/db1e468e-9677-11ea-8ce7-0242c0a80003/gazebo_gui-3.log’]]
[roslaunch][INFO] 2020-05-15 06:46:52,464: process[gazebo_gui-3]: cwd will be [/root/.ros]
[roslaunch][INFO] 2020-05-15 06:46:52,749: process[gazebo_gui-3]: started with pid [1641]
[roslaunch][INFO] 2020-05-15 06:46:52,749: … successfully launched [gazebo_gui-3]
[roslaunch][INFO] 2020-05-15 06:46:52,749: … preparing to launch node of type [dbw_mkz_gazebo/mkz_spawner]
[roslaunch][INFO] 2020-05-15 06:46:52,749: create_node_process: package[dbw_mkz_gazebo] type[mkz_spawner] machine[Machine(name env_loader[None] address[localhost] ssh_port[22] user[None] assignable[True] timeout[10.0])] master_uri[http://localhost:11311]
[roslaunch][INFO] 2020-05-15 06:46:52,750: process[mkz_spawner-4]: env[{‘ROS_DISTRO’: ‘kinetic’, ‘ROSLISP_PACKAGE_DIRECTORIES’: ‘’, ‘LD_LIBRARY_PATH’: ‘/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu’, ‘USER’: ‘root’, ‘HOME’: ‘/root’, ‘PATH’: ‘/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’, ‘ROS_PACKAGE_PATH’: ‘/opt/ros/kinetic/share’, ‘CMAKE_PREFIX_PATH’: ‘/opt/ros/kinetic’, ‘ROS_LOG_FILENAME’: ‘/root/.ros/log/db1e468e-9677-11ea-8ce7-0242c0a80003/roslaunch-9633addf07d9-1589.log’, ‘LANG’: ‘C.UTF-8’, ‘TERM’: ‘xterm’, ‘SHELL’: ‘/bin/bash’, ‘SHLVL’: ‘1’, ‘TERMINATOR_UUID’: ‘urn:uuid:85e27bed-614a-4afc-a7a0-8fbfe2d03166’, ‘SUPERVISOR_ENABLED’: ‘1’, ‘DISPLAY’: ‘:1.0’, ‘WINDOWID’: ‘20971523’, ‘DEBIAN_FRONTEND’: ‘noninteractive’, ‘ROS_MASTER_URI’: ‘http://localhost:11311’, ‘ROS_PYTHON_VERSION’: ‘2’, ‘ROS_VERSION’: ‘1’, ‘PYTHONPATH’: ‘/opt/ros/kinetic/lib/python2.7/dist-packages’, ‘ROS_ROOT’: ‘/opt/ros/kinetic/share/ros’, ‘SUPERVISOR_PROCESS_NAME’: ‘pcmanfm’, ‘TINI_VERSION’: ‘v0.9.0’, ‘SUPERVISOR_SERVER_URL’: ‘unix:///var/run/supervisor.sock’, ‘IBUS_DISABLE_SNOOPER’: ‘1’, ‘PKG_CONFIG_PATH’: ‘/opt/ros/kinetic/lib/pkgconfig:/opt/ros/kinetic/lib/x86_64-linux-gnu/pkgconfig’, ‘LC_ALL’: ‘C.UTF-8’, ‘_’: ‘/opt/ros/kinetic/bin/roslaunch’, ‘HOSTNAME’: ‘9633addf07d9’, ‘PWD’: ‘/root’, ‘ROS_ETC_DIR’: ‘/opt/ros/kinetic/etc/ros’, ‘COLORTERM’: ‘gnome-terminal’, ‘LS_COLORS’: ‘rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:’, ‘SUPERVISOR_GROUP_NAME’: ‘pcmanfm’}]
[roslaunch][INFO] 2020-05-15 06:46:52,753: process[mkz_spawner-4]: args[[u’/opt/ros/kinetic/lib/dbw_mkz_gazebo/mkz_spawner’, u’__name:=mkz_spawner’]]
[roslaunch][INFO] 2020-05-15 06:46:52,753: … created process [mkz_spawner-4]
[roslaunch.pmon][INFO] 2020-05-15 06:46:52,753: ProcessMonitor.register[mkz_spawner-4]
[roslaunch.pmon][INFO] 2020-05-15 06:46:52,753: ProcessMonitor.register[mkz_spawner-4] complete
[roslaunch][INFO] 2020-05-15 06:46:52,753: … registered process [mkz_spawner-4]
[roslaunch][INFO] 2020-05-15 06:46:52,753: process[mkz_spawner-4]: starting os process
[roslaunch][INFO] 2020-05-15 06:46:52,753: process[mkz_spawner-4]: start w/ args [[u’/opt/ros/kinetic/lib/dbw_mkz_gazebo/mkz_spawner’, u’__name:=mkz_spawner’, u’__log:=/root/.ros/log/db1e468e-9677-11ea-8ce7-0242c0a80003/mkz_spawner-4.log’]]
[roslaunch][INFO] 2020-05-15 06:46:52,753: process[mkz_spawner-4]: cwd will be [/root/.ros]
[roslaunch][ERROR] 2020-05-15 06:46:53,077: OSError(8, Exec format error)
[roslaunch][ERROR] 2020-05-15 06:46:53,077: Unable to launch [mkz_spawner-4].
If it is a script, you may be missing a ‘#!’ declaration at the top.
[roslaunch][ERROR] 2020-05-15 06:46:53,078: The traceback for the exception was written to the log file
[roslaunch][ERROR] 2020-05-15 06:46:53,078: Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py”, line 306, in main
p.start()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 279, in start
self.runner.launch()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py”, line 658, in launch
succeeded, failed = self._launch_nodes()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py”, line 367, in _launch_nodes
proc, success = self.launch_node(node)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py”, line 557, in launch_node
success = process.start()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py”, line 309, in start
raise FatalProcessLaunch(“Unable to launch [%s]. \nIf it is a script, you may be missing a ‘#!’ declaration at the top.”%self.name)
FatalProcessLaunch: Unable to launch [mkz_spawner-4].
If it is a script, you may be missing a ‘#!’ declaration at the top.

[roslaunch.pmon][INFO] 2020-05-15 06:46:53,078: ProcessMonitor.shutdown <ProcessMonitor(ProcessMonitor-1, started daemon 140112910800640)>
[roslaunch.pmon][INFO] 2020-05-15 06:46:53,167: ProcessMonitor._post_run <ProcessMonitor(ProcessMonitor-1, started daemon 140112910800640)>
[roslaunch.pmon][INFO] 2020-05-15 06:46:53,167: ProcessMonitor._post_run <ProcessMonitor(ProcessMonitor-1, started daemon 140112910800640)>: remaining procs are [<roslaunch.nodeprocess.LocalProcess object at 0x7f6e94678710>, <roslaunch.nodeprocess.LocalProcess object at 0x7f6e946f33d0>, <roslaunch.nodeprocess.LocalProcess object at 0x7f6e95adc090>, <roslaunch.nodeprocess.LocalProcess object at 0x7f6e94756f50>, <roslaunch.nodeprocess.LocalProcess object at 0x7f6e946788d0>]
[roslaunch.pmon][INFO] 2020-05-15 06:46:53,167: ProcessMonitor exit: killing mkz_spawner-4
[roslaunch][INFO] 2020-05-15 06:46:53,168: [mkz_spawner-4] killing on exit
[roslaunch.pmon][INFO] 2020-05-15 06:46:53,168: ProcessMonitor exit: killing gazebo_gui-3
[roslaunch.pmon][INFO] 2020-05-15 06:46:53,168: ProcessMonitor exit: killing gazebo-2
[roslaunch][INFO] 2020-05-15 06:46:53,169: [gazebo_gui-3] killing on exit
[roslaunch][INFO] 2020-05-15 06:46:53,169: [gazebo-2] killing on exit
[roslaunch][INFO] 2020-05-15 06:46:53,169: process[gazebo_gui-3]: killing os process with pid[1641] pgid[1641]
[roslaunch][INFO] 2020-05-15 06:46:53,170: process[gazebo-2]: killing os process with pid[1624] pgid[1624]
[roslaunch][INFO] 2020-05-15 06:46:53,170: [gazebo_gui-3] sending SIGINT to pgid [1641]
[roslaunch][INFO] 2020-05-15 06:46:53,171: [gazebo-2] sending SIGINT to pgid [1624]
[roslaunch][INFO] 2020-05-15 06:46:53,171: [gazebo_gui-3] sent SIGINT to pgid [1641]
[roslaunch][INFO] 2020-05-15 06:46:53,172: [gazebo-2] sent SIGINT to pgid [1624]
[roslaunch][INFO] 2020-05-15 06:46:53,673: process[gazebo-2]: SIGINT killed with return value -2
[roslaunch][ERROR] 2020-05-15 06:47:08,197: [gazebo_gui-3] escalating to SIGTERM
[roslaunch][INFO] 2020-05-15 06:47:08,197: [gazebo_gui-3] sent SIGTERM to pgid [1641]
[roslaunch][INFO] 2020-05-15 06:47:08,398: process[gazebo_gui-3]: SIGTERM killed with return value -15
[roslaunch.pmon][INFO] 2020-05-15 06:47:08,398: ProcessMonitor exit: killing rosout-1
[roslaunch][INFO] 2020-05-15 06:47:08,398: [rosout-1] killing on exit
[roslaunch][INFO] 2020-05-15 06:47:08,398: process[rosout-1]: killing os process with pid[1612] pgid[1612]
[roslaunch][INFO] 2020-05-15 06:47:08,399: [rosout-1] sending SIGINT to pgid [1612]
[roslaunch][INFO] 2020-05-15 06:47:08,399: [rosout-1] sent SIGINT to pgid [1612]
[roslaunch][INFO] 2020-05-15 06:47:08,599: process[rosout-1]: SIGINT killed with return value 0
[roslaunch.pmon][INFO] 2020-05-15 06:47:08,599: ProcessMonitor exit: killing master
[roslaunch][INFO] 2020-05-15 06:47:08,599: [master] killing on exit
[roslaunch][INFO] 2020-05-15 06:47:08,599: process[master]: killing os process with pid[1599] pgid[1599]
[roslaunch][INFO] 2020-05-15 06:47:08,600: [master] sending SIGINT to pgid [1599]
[roslaunch][INFO] 2020-05-15 06:47:08,600: [master] sent SIGINT to pgid [1599]
[roslaunch][INFO] 2020-05-15 06:47:08,800: process[master]: SIGINT killed with return value 0
[roslaunch.pmon][INFO] 2020-05-15 06:47:08,800: ProcessMonitor exit: cleaning up data structures and signals
[roslaunch.pmon][INFO] 2020-05-15 06:47:08,800: ProcessMonitor exit: pmon has shutdown
[rospy.core][INFO] 2020-05-15 06:47:08,826: signal_shutdown [atexit]

Running a GUI application inside a Docker container requires to expose the X11 socket to the container (with docker run -v /tmp/.X11-unix:/tmp/.X11-unix for instance).

One might also use a VNC client (eg. remmina) from the host and connect to the VNC port (here 41000).