Sarndbox Docker

Home Forums AR Sandbox Forum Sarndbox Docker

Tagged: 

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #2422
    marcocspc
    Participant

    Hey guys! I’ve “ported” sarndbox to docker. We needed to run the project in a science fair at our school, so they charged me of installing this in a Linux desktop.

    While trying to install I saw that the latest release (2.8, I believe) only compiled under Ubuntu 18.04, so I decided to try docker.

    I got it work after a few trials, using a nvidia GPU on an Ubuntu 22.04 host. I think there is still a lot to improve in the “how-to” and testing. But I think this is a start to keep the project supported under newer versions of Linux Distributions.

    Also, the container still needs privileged access on the host to work, but I believe in the next iterations I’ll be able to circumvent this.

    Here goes the link to the project:
    https://github.com/marcocspc/sarndbox-docker

    #2431
    Sean Robinson
    Participant

    Thank you for posting about your project. I don’t have much experience with Docker and none with desktop applications in Docker.

    Could you give a non-technical explanation of sarndbox-docker?

    My own confusion can be seen in two areas:

    Is this for building a package? Or will the container run the sandbox software, too?

    If I run an Ubuntu 18.04 container, do I need to update and manager software for two systems? One in the container and one on the host?

    #2435
    marcocspc
    Participant

    Hi! Yes, of course I can explain!

    “Could you give a non-technical explanation of sarndbox-docker?”
    Well, sarndbox-docker is a containerized ubuntu running sarndbox. You can imagine it like a Virtual Machine running Ubuntu 18.04 with only Sarndbox installed on it.

    “Is this for building a package? Or will the container run the sandbox software, too?”
    Well, it can be used to build sarndbox, but the way it is written now, sarndbox is built alongside container image creation (a container image is like a saved virtual machine, once it “reboots”, it returns to that saved initial state). Currently, the container is made to run sarndbox and its calibration tools.

    “If I run an Ubuntu 18.04 container, do I need to update and manager software for two systems? One in the container and one on the host?”
    No! And that’s the funny part. Once you build that “image” that I mentioned before, the software keeps working with your host. You can update it, install or remove software, leave it any way you like, as long as docker is installed, sarndbox-docker should keep working normally. You could even export that image and transfer it to another host, this new host could be a newer Ubutu, older Ubuntu, Fedora, Alpine, etc (you name it), you just need docker and docker-compose installed. Of course there are some caveats (like always depending on Nvidia hardware to see water flow simulations), but that should be on sarndbox’s side. I mean “should” because I have not tested sarndbox-docker in all different situations yet, only on my host.

    #2438
    hulaboop
    Participant

    Hi there

    I’m trying to install this docker container, but when I try ‘$ make’, I get the error ‘install: cannot remove ‘/etc/udev/rules.d/69-Kinect.rules’: Permission denied’, despite having done the permissions command.

    Do you have any ideas where to go from here?

    Thanks!

    #2440
    Sean Robinson
    Participant

    It looks like the simpler fix (if you’ve “done the permissions changes”) is to use ‘$ make build’ rather than ‘$ make’.

    #2443
    marcocspc
    Participant

    Hey! I see what happened there, indeed just “make” was needing sudo access. I’ve removed “installudevrules” from the “all” target. Now you can type “make” without sudo and it should build the image without this error.

    But make sure that you already done “sudo make installudevrules” before “make”.

    #2449
    hulaboop
    Participant

    Hi there! Thanks for getting back to me. I’ve managed now to install and make the container, but now when I try to go back to the main instructions and run ‘docker-compose run sarndbox /usr/local/bin/KinectUtil getCalib 0‘, I’m getting the below error:

    Creating sarndbox-docker_sarndbox_run ... done
    Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/alan/sarndbox-docker/SARndbox-2.8/BoxLayout.txt" to rootfs at "/data/src/SARndbox-2.8/etc/SARndbox-2.8/BoxLayout.txt": mount /home/alan/sarndbox-docker/SARndbox-2.8/BoxLayout.txt:/data/src/SARndbox-2.8/etc/SARndbox-2.8/BoxLayout.txt (via /proc/self/fd/7), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
    ERROR: 1

    I must be missing something obvious here, any ideas?

    Thanks for the help!

    #2452
    Sean Robinson
    Participant

    I think the problem here is that Docker is trying to include BoxLayout.txt in the container, but BoxLayout.txt has not been created, yet. You’re on “Software Installation” Step 6 and BoxLayout.txt is not created until Step 8.

    A possible way to get past this is to run touch /home/alan/sarndbox-docker/SARndbox-2.8/BoxLayout.txt to create an empty BoxLayout.txt. I suspect (not tested) this will let you do Step 6.

    #2453
    marcocspc
    Participant

    Hey Sean Robinson thanks for the help.

    Yes, your solution should work. So I’ve created the SARndbox-2.8/ folder and added both empty BoxLayout.txt and ProjectorMatrix.dat to avoid this kind of error.

    Thanks for testing hulaboop! Do a git pull on your repo to download the files and try again, please.

    #2454
    hulaboop
    Participant

    Thanks Sean and Marco, I appreciate the help!

    This has allowed me to get past that last error, now I’m onto step 6a and getting the below, I also get the same when I skip 6a and try 7. The command doesn’t seem to complete, it just hangs after the last line.

    Creating sarndbox-docker_sarndbox-nvidia_run ... done
    RawKinectViewer: Connected to 3D camera with serial number AxxxxxxxxxxxxxxA
    Vrui: Caught X11 protocol error BadValue (integer parameter out of range for operation), seq# 49, request 152.3
    Vrui: Caught exception GLContext::initialize: Unable to create OpenGL context on display unix:0 while initializing rendering window 0
    Vrui: Caught exception Vrui::startDisplay: Could not create all rendering windows while initializing rendering windows

    Do let me know if this is no longer a docker error and I’ll make a new post!

    #2455
    Sean Robinson
    Participant

    @hulaboop It looks like the Docker container does not have permission to show application windows on your screen. Have you given “docker permissions in your X server” with xhost +local:docker?

    You’ll need to run the xhost command every time you restart the host. I recommend adding it to your login scripts or to scripts you use to start the sandbox apps.


    @marcocspc

    You’re welcome. sarndbox-docker is an interesting idea and I’d like to see how much it can help bridge the increasing gap between AR Sandbox’s expected environment and current distributions.

    Do you think it makes sense to add a launch script? Maybe a sarndbox-run BASH script that automates running the various Vrui, etc. commands in the container.

    #2456
    marcocspc
    Participant

    Ok! That’s an issue with the application trying to communicate with your X server. Does docker have permission to access your x server?

    Try:
    xhost +local:docker

    #2477
    hulaboop
    Participant

    Hi guys!

    I’ve tried using the xhost command in every way I can think of, but I still get the same error. Could this be an issue with my ubuntu setup?

    Thanks!

    #2479
    Sean Robinson
    Participant

    @marcocspc Does the host (Ubuntu 22.04) need to use Xorg for sarndbox-docker to work? The default display server looks to be Wayland.

    #2480
    hulaboop
    Participant

    From a quick google, it looks as though I might be able to disable Wayland, which should make this work? I’ll have a go later and see what happens.

    Thanks for all the help with this, I’ve never used Linux before so this has all been a huge learning curve for me!

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.