- How do I set the grub timeout and the grub default boot entry?
- 10 Answers 10
- How to pause Linux boot screen?
- Pause unpause Linux boot screen
- Laptops
- Desktops with full Keyboard
- More alternatives
- How do I make systemd service pause the booting when waiting for user input? [closed]
- 1 Answer 1
- How can I delay a specific program on startup?
- 6 Answers 6
How do I set the grub timeout and the grub default boot entry?
In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I’m dual-booting Windows (7/8) and Ubuntu (12.04 or above)?
Can you give more information. What do you mean with «grub time» and what is your default os. In your grub menu what are the different lines?
grub time means the countdown time when i have to select the os at the BIOS starting screen. I’m sorry but I don’t know exactly what that os selection menu is called so I posted it as grub time.
10 Answers 10
- Press Alt + F2 , type gksudo gedit /etc/default/grub press Enter and enter your password.
- You will see the following contents:
GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX=""
Thanks, @Raja, but grub/grub2 was the main difference. If you had the correct grub2, I would have happily edited your answer instead of making another one 🙂
thank you your answer worked but can u please explain me the second and third point(the hidden timeout and grub hidden lines) what are they meant for.
Please don’t recommend anyone change the default grub option by setting an arbitrary index. That’s terribly unintuitive and likely to result in disaster. The user may enter the wrong one, or it may change during an upgrade, resulting in unexpected behaviour.
If you read the file that you are editing in the example above (/etc/default/grub), you will notice that the very first couple lines instruct you to run update-grub after making changes in order to update the actual file that grub reads to «get its instructions» (/boot/grub/grub.cfg). Note that you must actually run it with the sudo command first as you need root privileges to actually run the command (which is why the poster above said to type sudo update-grub ). This will cause the changes you made to be written to /boot/grub/grub.cfg. The very next couple lines tell you that you can read the full documentation of options in that file (again, /etc/default/grub) by typing info -f grub -n ‘Simple configuration’ .
That said, set GRUB_TIMEOUT to -1 if you want to set the «grub time» to be indefinite. In other words, it will never automatically boot. You will have to make a selection.
Finally, to answer your question, here are the descriptions of those «grub hidden lines» straight from the above-referenced documentation:
GRUB_HIDDEN_TIMEOUT Wait this many seconds for a key to be pressed before displaying the menu. If no key is pressed during that time, boot immediately. Unset by default. GRUB_HIDDEN_TIMEOUT_QUIET In conjunction with `GRUB_HIDDEN_TIMEOUT', set this to `true' to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. Unset by default.
How to pause Linux boot screen?
How many time you wanted to pause unpause Linux boot screen to check out some errors? This screen goes away too fast and you’re then prompted with Login screen. Once logged in, you’re too busy doing something else that you completely forgot that error that glided through boot screen too fast.
A very common problem is when you upgrade Linux Kernel to a new one sometimes your boot screen will show that old gem of a problem “Kernel panic – not syncing: Attempting to kill init !” But the most annoying problem with it is that all the boot messages scroll off the top of the screen before you can read them and it’s no use saying look at dmesg or /var/log/messages or /var/log/dmesg because the root file system isn’t there yet (Filesystem loads after a success boot).
This is a quick and easy solution to pause boot screen so that you can read it without crunching though logs later on.
Pause unpause Linux boot screen
Laptops
Following is what works best in Laptop:
Ctrl+S to Stop Ctrl+Q to Resume
Desktops with full Keyboard
If you have a full fledged keyboard, try
Scroll Lock and Scroll Unlock buttons.
More alternatives
Other suggested solutions are
Pause/Break button combination
(p.s. never worked for me, you some people reckons it worked for them.
Once you’re logged in,open a terminal window and type in
and you see something like this:
[ 12.814960] RPC: Registered udp transport module. [ 12.814962] RPC: Registered tcp transport module. [ 12.814964] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 12.856736] FS-Cache: Loaded [ 12.868714] Key type dns_resolver registered [ 12.912022] FS-Cache: Netfs 'nfs' registered for caching [ 12.952379] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Now you can just use SPACE BAR to scroll through the logs to find what you’re after. Quite ugly, eh!
GUI alternate is to use System Log Viewer and look for dmesg/message logs by date/time. System Log Viewer is built into pretty much any modern Desktop Environments (i.e. Gnome, KDE, MATE. XFCE, LXDE etc.).
Mine gives some errors like below:
15/10/13 10:23:43 PM testing kernel [ 0.294180] ACPI Error: Invalid/unsupported resource descriptor: Type 0x00 (20120913/utresrc-650) 15/10/13 10:23:43 PM testing kernel [ 7.124168] ACPI Error: Needed [Buffer/String/Package], found [Integer] ffff880235edb300 (20120913/exresop-590) 15/10/13 10:23:43 PM testing kernel [ 7.124194] ACPI Error: Method parse/execution failed [\_SB_.PCI0.GFX0._DSM] (Node ffff8802370a2790), AE_AML_OPERAND_TYPE (20120913/psparse-536) 15/10/13 10:23:43 PM testing kernel [ 10.390634] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro 15/10/13 10:23:49 PM testing NetworkManager[2970] bluez error getting default adapter: The name org.bluez was not provided by any .service files 15/10/13 10:25:19 PM testing NetworkManager[4730] bluez error getting default adapter: The name org.bluez was not provided by any .service files
I think I’ll just ignore those errors for now!
Hope that helps. Please share & RT.
How do I make systemd service pause the booting when waiting for user input? [closed]
A use case is loading the GUI only after service script stops running. I need to optionally mount sshfs (also multiple user and host name options) as /home before the GUI loads and «freezes» /home as local partition (default).
What are you trying to achieve? I have never heard of a use case for pausing boot to wait for user input.
I’m afraid that doesn’t clarify it. If the service needs some input, why wouldn’t that either be statically in a file or requested as soon as the user interacts with the service?
I think practical, non technical-worded questions can be helpful to many visitors. While I understand why some may find them misleading and prefer to downvote them, we can give each other a better chance to learn by offering clarifying answers (see my answer below as an example). Such question-answer pairs can still be very informative. Many people may face the same practical challenge.
1 Answer 1
«Pausing the booting» does not exactly apply with systemd; systemd runs multiple services in parallel.
However, by adding «dependencies» to services, you can essentially specify at which point the «booting should pause» and wait for your service.
For the use case above, add to /etc/systemd/system/ :
[Unit] Description=commands to run before GUI loads Before=display-manager.service
This will force display-manager.service to wait for . In my case, involves user input (for those readers that didn’t get the connection), effectively «pausing the booting».
There’s also a comment below for other commenters that expressed skepticism:
There is a use-case for this kind of thing — unlocking encrypted partitions. Because of bugs in systemd (bugs.freedesktop.org/show_bug.cgi?id=88483) it’s not possible to unlock an encrypted multi-device Btrfs array during boot using the out-of-box systemd mechanism. You need to create your own systemd service file and this answer had the missing bit I needed in my service file after hours of trying. Thanks argle.
How can I delay a specific program on startup?
How to delay a program such as cairo-dock (No openGL) or Firefox? Sometimes programs crash when started with other startup apps. I want programs to start 10 seconds late to avoid a crash.
6 Answers 6
Delaying autostart with inbuilt delay option
Note: Only works with desktop sessions that recognize the X-GNOME-Autostart-Delay parameter (e.g. Unity, Unity2D, GNOME). This will not work for LXDE, XFCE, KDE, etc.
With this solution there’s no need for a script or sleep. Head to your autostart folder:
Find the .desktop file that corresponds with your application and open it in a text editor, e.g. gedit :
gedit ~/.config/autostart/application.desktop
Append the following line to the file:
where foo is the time in seconds you want to delay the application launch by, e.g.:
Save the file, relog and you should see the effects.
Is there a website or man page to find documentation for GNOME parameters? I searched in gnome-session man page but could not find them.
You could try to change the command to this:
Some people say it works, some say it doesn’t, if this is your case, and it does not work, you can try with:
xterm -e 'sleep 10 && firefox'
I had to use this to get it to work for skype: sh -c «sleep 10 && skype &» in Ubuntu 12.04
Make a startup command using https://askubuntu.com/a/48327/139749 . Then you can add delay by opening ~/.config/autostart and edit related file. You should add the following commands:
X-GNOME-Autostart-enabled=true X-GNOME-Autostart-Delay=10
Solution by @Noraj works well for Ubuntu 18.04. Adding a couple of practical examples for Google Drive sync via Insync, and Synology cloud-drive. I don’t want them to delay the startup.
[Desktop Entry] Version=1.0 Type=Application Name=Insync GenericName=Insync Comment=Launch Insync Icon=insync Categories=Network; Exec=insync start TryExec=insync Terminal=false X-GNOME-Autostart-Delay=60
[Desktop Entry] Name=Synology Drive Client Comment=Synology Drive Client Exec=synology-drive autostart Icon=/opt/Synology/SynologyDrive/images/ico_72_cloud_station.png Terminal=false Type=Application Categories=Network;FileTransfer; X-GNOME-Autostart-Delay=75
Both files locate at $HOME/.config/autostart if you installed the applications and chose to make them start at login.