Skip to content

Run with --net=host break access to vnc #146

@lmontagnon

Description

@lmontagnon

Hi everyone,

I have a new issue which also breaks vnc startup.

For my project, I need to show my network (Ethernet and Wifi e.g. enp2s0 and wlp4s0) inside the container. With another image without vnc it's working when I add this parameter --net=host but with vnc doesn't work and break the startup.

Screenshot inside vnc container without --net=host parameter with ifconfig command (sudo update and sudo apt install net-tools) :
Screenshot from 2024-03-19 09-47-24

How to reproduce

Add --net=host parameter to run a new container :

docker run -p 6080:80 --security-opt seccomp=unconfined --shm-size=512m --net=host tiryoh/ros2-desktop-vnc:humble-amd64

And this appear

WARNING: Published ports are discarded when using host network mode
* enable custom user: ubuntu
  set default password to "ubuntu"
============================================================================================
NOTE: --security-opt seccomp=unconfined flag is required to launch Ubuntu Jammy based image.
See https://github.com/Tiryoh/docker-ros2-desktop-vnc/pull/56
============================================================================================
2024-03-19 13:48:35,463 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2024-03-19 13:48:35,464 INFO Set uid to user 0 succeeded
2024-03-19 13:48:35,471 INFO RPC interface 'supervisor' initialized
2024-03-19 13:48:35,471 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-03-19 13:48:35,471 INFO supervisord started with pid 44
2024-03-19 13:48:36,475 INFO spawned: 'novnc' with pid 45
2024-03-19 13:48:36,479 INFO spawned: 'vnc' with pid 46
2024-03-19 13:48:37,481 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-19 13:48:37,481 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-19 13:48:40,372 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:41,376 INFO spawned: 'novnc' with pid 233
2024-03-19 13:48:41,611 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:42,613 INFO spawned: 'novnc' with pid 462
2024-03-19 13:48:44,029 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-19 13:48:44,029 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:45,033 INFO spawned: 'novnc' with pid 610
2024-03-19 13:48:45,416 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:46,422 INFO spawned: 'novnc' with pid 678
2024-03-19 13:48:46,918 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:48,923 INFO spawned: 'novnc' with pid 696
2024-03-19 13:48:49,223 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:52,229 INFO spawned: 'novnc' with pid 709
2024-03-19 13:48:52,486 INFO exited: novnc (exit status 1; not expected)
2024-03-19 13:48:53,488 INFO gave up: novnc entered FATAL state, too many start retries too quickly

As you can see, a warning appears : WARNING: Published ports are discarded when using host network mode

I found a same Issue here : solarkennedy/ipmi-kvm-docker#10 but the solution with IPv6 doesn't work.
Another solution is to make some change inside vnc_startup.sh VNC_IP=$(ip route get 1 | awk '{print $NF;exit}') ConSol/docker-headless-vnc-container#31

Can you help me ?

Best regards,

lmontagnon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions