Using systemctl in toolbox - Fedora Discussion
Using systemctl in toolbox
Ask Fedora
kccallis
(KC Callis)
January 22, 2021, 2:46pm
I created a toolbox for my neomutt/mstmpd etc for mail reading. Normally, if this was a regular desktop (or server) setup, I would have a systemd timer so that my mail would be synced with my mail server. Under toolbox, I am not able to enable and start my mbsync.timer.
I have tried to do the following:
kcc@toolbox:
sudo systemctl daemon-reload
System has not been booted with systemd as init system (PID 1). Can’t operate.
Failed to connect to bus: Host is down
and the same is true with trying to do a timer:
kcc@toolbox:
sudo systemctl --user enable mbsync.timer
Failed to enable unit, unit mbsync.timer does not exist.
So that would mean that systemctl doesn’t even see my ~/.config/systemctl/user directory.
So is there any way to make my timers work within the toolbox?
1 Like
jmou
(Joe Mou)
January 22, 2021, 11:02pm
Hey KC, I have not set up a systemd timer for my toolbox, but I had some ideas.
The directory for user units should be ~/.config/systemd/user (not systemctl).
But even with the correct directory, systemd doesn’t run inside of toolbox [1]. I’ve run into not having systemd a few times but there’s usually a workaround. Have you considered using your host systemd to run the daemon inside your container? Might be as easy as adding “toolbox run” to the beginning of your ExecStart.
[1]
Why don't toolbox containers include sytemd?
kccallis
(KC Callis)
January 23, 2021, 2:00am
You are correct, that was a typo on my part earlier. I am not that savvy in container usability. Things like my e-mail client or other services were a part of my native OS and containers (lxc, docker, etc.) was something that was lightweight and more or less temporary. Now I am dealing with a more or less lightweight OS that is streamlined and everything else is containerized. Interesting concept!
So could you elaborate on how to use ExecStart to start my tooxbox? For instance, when I log in to my machine, the first thing that I do is spin up my “Mutt” toolbox. Once I enter the mutt toolbox, I fire up tmux and start my mutt client and a couple of ssh sessions. I need the mbsync.timer to sync up my email within the mutt toolbox, so how do I get that working?
jmou
(Joe Mou)
January 24, 2021, 12:04am
I found a user service unit (that I’m not using, so YMMV). For example, ~/.config/systemd/user/rslsync.service:
[Unit]
Description=Resilio Sync

[Service]
Type=simple
ExecStart=rslsync --nodaemon

[Install]
WantedBy=default.target
My suggestion was to change the ExecStart line to:
ExecStart=toolbox run rslsync --nodaemon
I haven’t tried this, so I’m not sure it works!
The idea is that systemd is normally running on your host. And toolbox uses the same container by default (should be fedora-toolbox-33). So you should be able to use the host systemd to run mbsync inside of the toolbox container.
Hope that helps! I’d encourage you to also play around with toolbox and podman to figure them out. I think it really helps when it comes to customizing things like this.
1 Like
kccallis
(KC Callis)
January 24, 2021, 1:38am
This is somewhat confusing… In your example above, it would seem that you creates a service and a possibly a time, and then in the ExecStart you execute the rslsync.
In my case I have a toolbox called mutt, which I have mbsync installed. Are you saying that I need to install mbsync as the OS layer along with msmtsp, enable the timer and then open the toolbox mutt?
jmou
(Joe Mou)
January 24, 2021, 7:25am
toolbox run
will run the command inside of the toolbox container, not on the host. So it should be sufficient to install mbsync inside the container without layering it with rpm-ostree. I think this is confusing because the idea is to use systemd on the
host
to run mbsync inside the
toolbox
. I think you are assuming that everything needs to run on the host, or everything needs to run inside the toolbox, which is not what I’m suggesting.
I’ll also mention again that this is totally untested, I’m just trying to give some ideas that may point you in a helpful direction. I hope it is useful but I have no guarantees!
1 Like
kccallis
(KC Callis)
January 24, 2021, 7:33pm
I made the changes that you suggested, but still no go. This is almost a deal breaker for me, since I am used to be having my email waiting for as opposed to manually have to sync up the mail. As a fall back I would just use cron and call it a day, but cronie is run as a systemd service, which does really help me.
jakfrost
(Stephen Douglas Snow)
January 24, 2021, 8:48pm
Perhaps this post by Dan Walsh would be of help to you.
. Hope this helps, good luck
Also this at the official Podman doc site
1 Like
aldermalhir
(Aldermalhir)
January 28, 2021, 9:53am
I think a more containerized way of handling mutt/msmtpd is to create a
container
containing mutt and msmtpd that you run from your host terminal. I.e. don’t use toolbox for this.
You then have a separate container running mbsync. The only communication needed between mbsync and mutt is your mailbox, which will be shared via a mounted volume.
These containers are run using podman, and you use the host systemctl to set up a timer which triggers the mbsync container.
1 Like
jakfrost
(Stephen Douglas Snow)
January 28, 2021, 11:57am
10
I was actually thinking along those lines using the fedora minimal container image. I figured you could run them from the same pod to share resources. Currently my mutt container is partially working for me.
dngray
(Daniel Gray)
January 21, 2022, 4:44am
11
(post deleted by author)
dngray
(Daniel Gray)
January 21, 2022, 4:54am
12
I’m attempting to do the same thing (with the same usecase). Just wondering if any of you ended up coming up with a workable solution, and if you have, could you share the link to your Containerfile.
jakfrost
(Stephen Douglas Snow)
January 21, 2022, 12:20pm
13
Hello
@dngray
I have not gotten further with mutt in a container, but I am distracted at the moment with other pressing tasks. I will make a new topic I think about doing that specifically if and when I get around to making it work.
opasec
(Immutable)
April 13, 2026, 2:33pm
14
Any updates on this?
I would like to run docker in a toolbox container
siosm
(Timothée Ravier)
April 23, 2026, 8:13pm
15
You can not run Docker in a toolbox container. Install Docker on the host.
1 Like
Related topics
Topic
Replies
Views
Activity
Why don't toolbox containers include sytemd?
Project Discussion
silverblue-team
19
4555
September 24, 2020
Rsync inside toolbox/distrobox
Ask Fedora
silverblue
411
November 14, 2023
Run a toolbox app at startup?
Ask Fedora
f39
silverblue
15
3623
December 8, 2025
I need an alternative to systemctl to start a service inside a toolbox container
Ask Fedora
silverblue
7832
July 8, 2019
Launch a toolbox with systemd
Ask Fedora
silverblue
1473
February 26, 2025