Coder Social home page Coder Social logo

Comments (3)

XO30 avatar XO30 commented on August 25, 2024 3

Hi @alex77272,

It sounds like a frustrating issue, and I'm sorry to hear it's not working out. The good news is that the container can indeed operate in network_mode=host, but it requires a couple of minor adjustments to avoid port conflicts with the host system. These adjustments can be achieved by modifying the entrypoint.sh script. Below, I've outlined the necessary changes:
Original Code Block Adjustment:

From:

if [ $(uname -m) = "aarch64" ]; then
    LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver :1 -fg -geometry 1920x1080 -depth 24
else
    vncserver :1 -fg -geometry 1920x1080 -depth 24
fi

To:

if [ $(uname -m) = "aarch64" ]; then
    LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver :5 -geometry 1920x1080 -depth 24
else
    vncserver :5 -geometry 1920x1080 -depth 24
fi

This change switches the virtual display from 1 to 5. As a result, the VNC server will now operate on port 5905 instead of port 5901, helping to prevent conflicts with existing VNC servers.
Additional Code Modification:

From:

command=gosu '$USER' bash -c "websockify --web=/usr/lib/novnc 80 localhost:5901"

To:

command=gosu '$USER' bash -c "websockify --web=/usr/lib/novnc 6080 localhost:5905"

This ensures that the noVNC web UI is directly accessible on port 6080 and that noVNC looks for the VNC server on the newly defined port 5905.

With these changes, everything should work as intended. You can now access via http://localhost:6080/

Best regards,

Stefan

from docker-ros2-desktop-vnc.

alex77272 avatar alex77272 commented on August 25, 2024 1

Wow, your help was incredibly valuable. Thank you for solving the Git issue. I've been struggling with it for hours and your guidance has made all the difference. I wish you all the best and once again, thank you so much.

Alex

from docker-ros2-desktop-vnc.

Tiryoh avatar Tiryoh commented on August 25, 2024 1

@XO30 Thanks for your support!

from docker-ros2-desktop-vnc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.