Xfce4 Desktop app using container_vnc

Hi all, I’m using OOD 3.0.1 and I’m currently trying to use the vnc_container in the tutorial (Batch Connect VNC Container Options — Open OnDemand 3.1.0 documentation) to have a Desktop app. I took the .def file to build and all the commands seem to exist inside the container. The image also has all xfce binaries, but when I put xfce4-session in the script.sh.erb file this is run outside of the container and therefore it doesn’t find it. How can I make sure that I run the commands inside the container? I couldn’t find any options…

Thank you so much,
Bernardo

My submit.yml.erb is

---
batch_connect:
    template: "vnc_container"
    websockify_cmd: "/usr/bin/websockify"
    container_path: "/share/apps-x86/containers/singularity/rockylinux_8.sif"
    container_command: "singularity"
    container_module: ""
    container_bindpath: ""

The output file reads:

Loading ...
 Starting instance...
 INFO:    Instance stats will not be available - requires cgroups v2 with systemd as manager.
 INFO:    Converting SIF file to temporary sandbox...
 INFO:    instance started successfully
 Setting VNC password...
 Starting VNC server...
 59548
 
 Desktop 'TurboVNC: cnx035:1 (malaca)' started on display cnx035:1
 
 Log file is vnc.log
 Successfully started VNC server on cnx035:5901...
 Script starting...
 Before starting up
 Starting websocket server...
 /usr/lib/python3.6/site-packages/websockify/websocket.py:31: UserWarning: no 'numpy' module, HyBi protocol will be slower
   warnings.warn("no 'numpy' module, HyBi protocol will be slower")
 WebSocket server settings:
   - Listen on :53570
   - No SSL/TLS support (no cert file)
   - Backgrounding (daemon)
 Scanning VNC log file for user authentications...
 Generating connection YAML file...
 Cleaning up...
 Killing Xvnc process ID 54
 /var/spool/slurm/d/job06085/slurm_script: line 25: vncserver: command not found
 INFO:    Stopping bd8b3cb3-e1db-4917-8b8d-910b48ec35fc instance of /tmp/rootfs-254472145/root (PID=59392)
 ~      

I was able to solve this.
The system runs the container just to run vnc and you can’t easily make it also run xfce. So to open xfce/gnome/etc. you need to add a line in your script.sh.erb:

singularity exec /path/to/image/rockylinux_8.sif /path/to/script/xfce.sh

xfce.sh is the script file you get from the original app inside “templates”.
Essentially you run two parallel singularity containers, each with its own app.

1 Like