Replies: 4 comments 3 replies
-
|
Is there any way to have a temporary timeout without configuring the grub cfg file? By default users will never see the console so the timeout should be 0 as default, allowing the user to set a different timeout there via specific cli argument feels not useful to me? The only way to get to the boot console is with IMO I am not a huge fan of a specific option to set something most users will not even need to care about. If you plan is to ssh in and edit the file than this feels not super useful compared to just documenting this what a user has to do manually. For a) effective immediately would also not be true is it? If you want to change the file you would still need to first boot once, no? |
Beta Was this translation helpful? Give feedback.
-
|
I think the best approach is to set Another idea is to use a non-zero timeout only on the first boot. Or we could set the timeout to 0 by default and document how to change it when needed. In my experience, I have only touched GRUB configuration once or twice, when setting up dual boot between Linux and Windows. |
Beta Was this translation helpful? Give feedback.
-
|
@inknos thanks for putting this together. I agree with the sediment here (or at least what i think it is). In an ideal scenario, you could make the change to remove the timeout in our images. And when --log-level=debug is used, we somehow set the grub timeout before the machine is booted (as @Honny1 said). Given the nature of this sort of being a black box, if for any reason it cannot boot, we need to see why in its current condition. So right now, if we cannot figure out how to change the grub timeout temporarily while the machine is off, i personally would not be in favor of changing the timeout defaults bc it makes supporting this thing impossible? Is this kind of what others are thinking ? |
Beta Was this translation helpful? Give feedback.
-
|
I put together a POC with Claude, just to see if it would work, and it works. It's another idea of how to use debug to set the timeout at boot. In short, it mounts the qcow2 (or raw) volume, patches it with a file called On the next boot, if the marker is found, the same operation of mounting + patching is done. Skipped otherwise for normal boots, which can have boot set to 0 in machine-os. It's really badly implemented/tested, but hey, it gives us a direction if you like it |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
As mentioned in our Office Hours yesterday I am currently investigating ways to cut the startup time for
podman machine. One of the corners to cut is the 1 second GRUB timeout that could be set to 0 seconds. This is done by patching either of the files/boot/grub2/grub.cfgor/boot/grub2/grubenvinc/podman-machine-os.Doing that will prevent debugging at boot time by adding kernel parameters from GRUB, so now the question becomes: "how to set a custom timeout to GRUB?"
I would like to propose three solutions for modifying the startup behavior of
podman machine.Prerequisite:
Assume the boot timeout is set to 0 having a patched FCOS image within the podman-machine-os repository.
Problem:
Provide an option to change the timeout for debugging purposes.
Analysis:
The GRUB timeout is defined in
/boot/grub2/grub.cfgor/boot/grub2/grubenv. To boot with a different timeout the files need to have an option that needs to be set BEFORE the boot. As far as I know this can be done in two ways:podman machine init(for the current boot)Considering that:
machine initis an injection process that will force to reinitialize the machineI propose some solutions, with pros and cons:
Solution A:
Add a new flag to the initialization command: podman machine init --grub-timeout=N
Pros:
Cons:
Solution B:
Change the behavior of
podman machine start --loglevel=debugto automatically set the timeout. This would be handled via an SSH command. However, since this change persists, a reset mechanism is required.Pros:
Cons:
--loglevelflag should not modify persistent system settings like timeout. If the change is not ephemeral, it may lead to unexpected behavior for the user.Solution C:
Introduce a dedicated configuration command: podman machine set --grub-timeout=N. This setting would be applied via SSH.
Pros:
Cons:
I'll post here two questions and observations that came from an internal discussion prior to this.
Q1:
The timeout is 1 second, currently, and that's the one set by FCOS afaik. we don't override it and fyi, if we do we have to do it from podman-machine-os, not podman
Q2:
Beta Was this translation helpful? Give feedback.
All reactions