# Mate Desktop in an Apptainer container?

**URL:** <https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608>\
**Category:** Get Help\
**Tags:** question\
**Created:** [April 10, 2023, 3:22am UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608 "2023-04-10T03:22:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![luvres](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/luvres/32/1211_2.png) [@luvres](https://discourse.openondemand.org/u/luvres)\
**Post date:** [April 10, 2023, 3:22am UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608/1 "2023-04-10T03:22:02Z")

</div>

I’ve been following this thread: [Mate Desktop in a Singularity container?](https://discourse.openondemand.org/t/mate-desktop-in-a-singularity-container/696)

In my quest to build my desktop inside an apptainer container and it’s been a challenge.

I use OOD 2.0.31 and Apptainer 1.1.7.

From the original bc\_desktop, I changed the `form.yml.erb`

```auto
---
cluster: "hpcc"

attributes:
  desktop: "mate"
  bc_vnc_idle: 0
  bc_vnc_resolution:
    required: true
  node_type: null
  bc_num_hours:
    widget: "number_field"
    label: "Number of hours"
    value: 1
    min: 1
    max: 8
    step: 1
    help: |
      - Choose the amount of time up to a maximum of 8 hours

form:
  - bc_vnc_idle
  - desktop
  - bc_num_hours
  - node_type
  - bc_vnc_resolution

```

and `submit.yml.erb` files

```auto
<%
  # your image location will differ
  image="/opt/img-apps/mate.sif"
%>
---
script:
  queue_name: "apps"
  native:
    - "--job-name=desktop"
    - "--mem=2G"
# template: "vnc"

batch_connect:
  template: "vnc"
  websockify_cmd: '/usr/bin/websockify'
  header: |
    #!/bin/bash
    . ~/.bashrc
  script_wrapper: |
    cat << "CTRSCRIPT" > container.sh
    export PATH="$PATH:/opt/TurboVNC/bin"
    %s
    CTRSCRIPT

    export APPTAINER_BIND="$HOME,/run,/var,/tmp"
    
    # your bindpath will differ
    apptainer exec <%= image %> /bin/bash container.sh

```

The container build `mate.def` manifest

```auto
Bootstrap: docker

From: centos:7.9.2009

%post   
  yum install -y epel-release
  yum groupinstall -y 'MATE Desktop'
  yum install -y python3-pip
  pip3 install ts
  yum install -y https://yum.osc.edu/ondemand/1.6/compute/el7Server/x86_64/python-websockify-0.8.0-1.el7.noarch.rpm
  yum install -y https://yum.osc.edu/ondemand/latest/compute/el7Server/x86_64/turbovnc-2.2.5-1.el7.x86_64.rpm
  yum remove -y tigervnc-server python3-pip mate-power-manager
  yum clean all
  rm -rf /var/cache/yum/*

```

Everything looks fine and I get a desktop instance, but something is missing:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/7/7863512a91c8fb4593c54a98cf7b6a6b74bbb595.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/e/edec781e4ddad3683eb1843a22bf4e518e96ee97.png)

After a few seconds…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/b5cb1de1f01f2c8d5b2d1a20e317fbfce8617e44.png)

My `output.log` has a few things:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/8/870791f43185c84638a41844aefa0e021b1d7653.png)

It seems to me that the most critical error is:

`error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files`

Any ideas that might help me please?

---

<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:** [April 10, 2023, 1:59pm UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608/2 "2023-04-10T13:59:22Z")

</div>

Off the top, I’d suggest adding `/run` into the container. Maybe `/var` as well.

Seems like you can’t communicate with dbus correctly and I know those are important directories.

A google search of the error seems to indicate there’s a library issue. You’re using centos 7.9 container, what’s the host OS? Maybe there’s some mismatch or some missing package. That file seems to come from `dconf` itself so I wonder if it was missed somehow?

---

<div class="post-metadata">

**Author:** ![luvres](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/luvres/32/1211_2.png) [@luvres](https://discourse.openondemand.org/u/luvres)\
**Post date:** [April 10, 2023, 2:24pm UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608/3 "2023-04-10T14:24:43Z")

</div>

I’m mounting `/run` and `/var` with `export APPTAINER_BIND="$HOME,/run,/var,/tmp"` in my `submit.yml.erb`

My host operating system is Rocky Linux 8.7

I have only replicated the examples that I have only found with centos 7 with the difference of some updates:

- centos:7.9
- python3-pip (python2-pip doesn’t work)
- turbovnc-2.2.5

---

<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:** [April 10, 2023, 3:17pm UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608/4 "2023-04-10T15:17:45Z")

</div>

If you run 8 on the host, I’d suggest trying the same OS in the container and see how that fares.

---

<div class="post-metadata">

**Author:** ![luvres](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/luvres/32/1211_2.png) [@luvres](https://discourse.openondemand.org/u/luvres)\
**Post date:** [April 10, 2023, 5:58pm UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608/5 "2023-04-10T17:58:53Z")

</div>

You are absolutely right! I created the container compatible with my host OS and it worked. In my case, Rocky Linus installed Xfce, because it is easily available in the `dnf group list`. Now it’s time to work on the settings to adjust the desktop and its applications.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/0/064f31d2edd18d5eb0d7a8dafc38162b8c04be09.png)

For management, follow the file for building the container `xfce.def`:

```auto
Bootstrap: docker
From: rockylinux:8.7

%post   
  dnf install -y epel-release
  dnf groupinstall -y 'Xfce'
  pip3 install ts
  dnf install -y https://yum.osc.edu/ondemand/3.0/compute/el8Server/x86_64/python3-websockify-0.10.0-1.el8.noarch.rpm
  dnf install -y https://yum.osc.edu/ondemand/3.0/compute/el8Server/x86_64/turbovnc-2.2.5-1.el8.x86_64.rpm
  dnf clean all

```

---

<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:** [October 7, 2023, 5:59pm UTC](https://discourse.openondemand.org/t/mate-desktop-in-an-apptainer-container/2608/6 "2023-10-07T17:59:13Z")

</div>

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