I am dual booting Windows 10 and Ubuntu 18.04. How to tell grub not to show the boot menu and boot directly to Windows 10 by default? What should I do if I want to boot to Ubuntu 18.04 instead of the default Windows 10?

up vote 2 down vote accepted

The file /etc/default/grub contains a line:

GRUB_TIMEOUT=10 

edit the file and make the 10 a 0 to hide the grub menu. You may force the grub menu by holding down a key, shift or tab.

Making Windows the default may be done by renaming the file
/etc/grub.d/30_os-prober to /etc/grub.d/06_os-prober, so it gets run before the 10_linux file.

sudo mv /etc/grub.d/30_os-prober /etc/grub.d/06_os-prober
  • I got a doubt if i make sudo mv /etc/grub.d/30_os-prober /etc/grub.d/06_os-prober I Can never enter Ubuntu 18.04. is that rite? – PRATAP Jun 6 at 5:08
  • This may not work for multi-boot environments, os-prober will reset GRUB_TIMEOUT to 10 if more than one OS is found. See askubuntu.com/questions/117525/… . The default OS could be set with GRUB_DEFAULT instead of renaming files in /etc/grub.d although that is possible. – mook765 Jun 6 at 5:27
  • @mook765 Hi, that means once i set GRUB_DEFAULT to Windows10 and GRUB_TIMEOUT=0 grub will not be shown and it will boot to Windows10 and if at any day i want Ubuntu menas i can hold down the Shift or TAB as soon as switch on the System. is that rite? – PRATAP Jun 6 at 8:44
  • @PRATAB I don't think it will work, see the link I provided. There are a few lines in /etc/grub.d/30_os-prober which will reset the timeout to 10 seconds if more than one OS is found. – mook765 Jun 6 at 10:04

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.