# OOD Template: vnc\_container won't run properly; “failed to connect to dbus”

**URL:** <https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643>\
**Category:** Get Help\
**Tags:** question\
**Created:** [November 19, 2025, 8:17pm UTC](https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643 "2025-11-19T20:17:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jschilen](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jschilen/32/2840_2.png) [@jschilen](https://discourse.openondemand.org/u/jschilen)\
**Post date:** [November 19, 2025, 8:17pm UTC](https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643/1 "2025-11-19T20:17:39Z")

</div>

Hello, we have an app defined to use template: vnc\_container. We have found that it won’t launch unless we login to the node first as the user and restart the user dbus service

When it fails, in the output.log it shows:

> Starting instance…
> 
> WARNING: group: unknown groupid XXX
> 
> INFO: Terminating squashfuse after timeout
> 
> INFO: Timeouts can be caused by a running background process
> 
> ERROR: container cleanup failed: no instance found with name XXXXXXXXXX
> 
> FATAL: container creation failed: while applying cgroups config: while creating cgroup manager: failed to connect to dbus (hint: for rootless containers, maybe you need to install dbus-user-session package, see [runc/docs/cgroup-v2.md at main · opencontainers/runc · GitHub](https://github.com/opencontainers/runc/blob/master/docs/cgroup-v2.md) ): could not execute `busctl --user --no-pager status` (output: “Failed to connect to bus: No such file or directory\n”): exit status 1
> 
> FATAL: while executing starter: failed to start instance: while running /usr/local/libexec/apptainer/bin/starter: exit status 255

If we ssh into the node as the user and run

systemctl --user restart dbus.service

Then launch the app, it will work normally. We can see that the user dbus.service is running before restarting it.

We tried adding:  
before\_script: |

```
systemctl --user start dbus.service

```

but the template fails to launch the vnc apptainer image before it runs the before script.

We also tried installing the ubuntu-desktop group and setting graphical target as default, but that didn’t help either.

Does anyone have any other suggestions?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [November 19, 2025, 8:29pm UTC](https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643/2 "2025-11-19T20:29:57Z")

</div>

Hi and welcome!

Not sure what could cause this. Can I see the mounts you’re using? I’ve found that `/var` pretty much always needs to mount, but have never seen this error.

---

<div class="post-metadata">

**Author:** ![jschilen](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jschilen/32/2840_2.png) [@jschilen](https://discourse.openondemand.org/u/jschilen)\
**Post date:** [November 19, 2025, 10:15pm UTC](https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643/3 "2025-11-19T22:15:40Z")

</div>

Hello,

In our submit.yml.erb we have

container\_path: “\<%= (cpath == ‘ **custom** ’) ? container\_image\_custom : cpath %\>”  
container\_bindpath: “/var,/usr”  
container\_module: “apptainer”  
container\_command: “apptainer”  
container\_start\_args:   
websockify\_cmd: “/usr/local/bin/websockify”  
before\_script: |  
systemctl --user start dbus.service

---

<div class="post-metadata">

**Author:** ![jschilen](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jschilen/32/2840_2.png) [@jschilen](https://discourse.openondemand.org/u/jschilen)\
**Post date:** [December 8, 2025, 6:57pm UTC](https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643/4 "2025-12-08T18:57:53Z")

</div>

We solved our problem. We figured out that it was failing in the template before it even got to our app.

It was failing here starting the ondemand container for handling vnc (the before\_script actually runs after this)  
ondemand/4.0.8-1/gems/ood\_core-0.29.0/lib/ood\_core/batch\_connect/templates/vnc\_container.rb  
echo “Starting instance…”  
#{container\_command} instance start #{container\_start\_args} #{container\_path} #{@instance\_name}

if the user was not ssh’d in to the server because there was no /run/user/ directory/session. Why we were running into this and it seems no one else is we’re not sure. We realized that in order to fix it, we would need to establish a session for the user on the node before the job runs and would have to do it in the scheduler because it’s what is running the job and it is not done via ssh.

To fix it we created a prolog script for slurm and told it to run loginctl enable-linger for the user. We also created an epilog script to disable the linger after the job finishes.

slurm.conf  
Prolog=/sharedfilesystemapth/prolog-script/prolog.sh  
Epilog=/sharedfilesystemapth/prolog-script/epilog.sh

prolog.sh  
#!/bin/bash  
loginctl enable-linger $SLURM\_JOB\_USER  
systemctl --user -M $SLURM\_JOB\_USER@.host start dbus.service

epilog.sh  
#!/bin/bash  
loginctl disable-linger $SLURM\_JOB\_USER

Then we also added /run to the container\_bindpath so that this /run/user/ session directory would be available to the container image that we would be starting in our job separate from the one that runs above.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [June 6, 2026, 6:58pm UTC](https://discourse.openondemand.org/t/ood-template-vnc-container-wont-run-properly-failed-to-connect-to-dbus/4643/5 "2026-06-06T18:58:49Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
