Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start toolbox at boot to prevent delay when executing command #1559

Closed
thepragmaticmero opened this issue Oct 1, 2024 · 4 comments
Closed
Labels
1. Feature request A request for a new feature

Comments

@thepragmaticmero
Copy link

thepragmaticmero commented Oct 1, 2024

Is your feature request related to a problem? Please describe.
Every time I reboot my computer, and execute a toolbox enter command. There's an annoying delay I have to sit through before entering my container. My objective is to remove that delay by keeping the container started at boot or instantly after boot using a systemd service (lazy loading prefferably, what I mean by this is not making the boot process to my Desktop Environment longer). I wanted to keep it straight forward using a podman generate systemd command. But the cli advised me that the command was deprecated, podman advised that I use podman Quadlets. But then I discovered that a toolbox command is a little bit more complex than average podman run command. I needed to use a LLM (Claude.ai) to get the complete command just to try and run a podman equivalent command to toolbox. It's a little too much to ask for a user I think.

Podman run equivalent command to toolbox (misinformation sorry)

podman run \
  --name fedora-toolbox-41 \
  --hostname toolbox \
  --privileged \
  --security-opt label=disable \
  --user 1000:1000 \
  -e SHELL=/bin/bash \
  -e HOME=/var/home/user \
  -v /var/home/senati:/var/home/user:rslave \
  -v /home/senati:/home/user:rslave \
  -v /media:/media:rslave \
  -v /mnt:/mnt:rslave \
  -v /run/media:/run/media:rslave \
  -v /etc/hosts:/etc/hosts:ro \
  -v /etc/resolv.conf:/etc/resolv.conf:ro \
  -v /tmp:/tmp:rslave \
  --pid=host \
  --ipc=host \
  --network=host \
  localhost/fedora-toolbox:41 \
  /bin/bash

Describe the solution you'd like
toolbox quadlet fedora-toolbox-41 or toolbox at-boot fedora-toolbox-41
Just for simplicity's sake.

Describe alternatives you've considered
I've tried the deprecated podman generate command and trying to use cockpit-podman, the later doesn't have a "start at boot" option.

@thepragmaticmero thepragmaticmero added the 1. Feature request A request for a new feature label Oct 1, 2024
@debarshiray
Copy link
Member

Toolbx 0.0.99.6 has optimized the the toolbox enter and run commands due to this issue. Does that make it fast enough for you?

The toolbox enter and run commands don't use podman run directly. They use podman start and podman exec separately. The podman start part is just that - look for podman.Start in the code. It's the podman exec invocation that has all the funky options.

I suspect that it's the podman start that is slow when you are using a container for the first time, because the container's entry point does varies things to configure the container appropriately.

@thepragmaticmero
Copy link
Author

thepragmaticmero commented Oct 10, 2024

The toolbox enter and run commands don't use podman run directly.

Sorry for spreading misinformation Q-Q.

I suspect that it's the podman start that is slow when you are using a container for the first time

Exactly! Well, at least the wait was a little too long for my liking on Fedora Silverblue 40. On Fedora Silverblue 41 (toolbox --version -> 0.0.99.6, now it's acceptably quick. By the time I finish typing after running toolbox enter , the container has already loaded, which is nice and neat. At least on my beefy computer (5800x + NVMe SSD), it's no problem. Thanks for the fix.

@debarshiray
Copy link
Member

Duplicate of #1070

@debarshiray debarshiray marked this as a duplicate of #1070 Oct 17, 2024
@debarshiray
Copy link
Member

I suspect that it's the podman start that is slow when you are using a container for the first time

Exactly! Well, at least the wait was a little too long for my liking on Fedora Silverblue 40. On Fedora Silverblue 41 (toolbox --version -> 0.0.99.6, now it's acceptably quick. By the time I finish typing after running toolbox enter , the container has already loaded, which is nice and neat. At least on my beefy computer (5800x + NVMe SSD), it's no problem. Thanks for the fix.

I am glad to hear that. Thanks for the confirmation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Feature request A request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants