In the following tutorial or trick, I'm going to teach you to be Windows the default system in Linux Grub, so that when the predefined time elapses, it is the Microsoft operating system, the one that boots by default.
To achieve this, we will have to modify the startup launcher or also known as Linux Grub, We will achieve this using the command line or terminal de Linux.
I have decided to create this single practical tutorial, since I have come across many users who do not know how enable this option, and that they prefer that when starting Linux Grub, it is Windows the one that starts after the countdown.
Personally, I prefer that if I do not touch anything at the start of our system, it is the option of Linux the one that prevails over that of Windows, but since there is nothing written about tastes and each one has their preferences, let's go to the mess with the method to follow to modify the preferences at startup. Linux Grub.
Switching to Windows as the default in Linux Grub
To achieve this, first, we will open a terminal window and we will type the following command line:
- sudo nano /boot/grub/grub.cfg
The terminal will show us the following:
Where we will have to modify only the line set default = »0 ″, in which we will change the 0 by 4, which is the number that corresponds to the windows partition that is installed next to your system Linux.
To change it, we will move with the cursors of the arrows and we will place ourselves above the quotation marks that are to the right of the number zero, we will give the Backspace or back and the zero will be erased and in its place we will place the 4.
After this, we will save with CTRL + O and then we'll go out with CTRL + X.
We will not have to modify anything elseSimply with this we will have enabled the option to start with Windows by default from Linux Grub. If we make a mistake, and we change something else, we can leave without saving the changes by combining CTRL + DELETE and then N.
More information - How to recover Linux grub in Ubuntu 12.04
8 comments, leave yours
I just installed Fuduntu 2012.4 and doing this in the terminal:
sudo nano /boot/grub/grub.cfg
I only get a black screen and nothing of what the example shows, I already knew that and I had done it for LinuxMint, Kubuntu and Zorin and it changed without problem, but in Fuduntu there is no line to edit in the terminal.
I would appreciate in passing if you could place some of the most used commands and their equivalents in Kubuntu (apt-get or muon) - OpenSuse (zypper or yast), etc ...
I really liked Fuduntu 2012.04 for my netbook and it is what I was looking for, that it was simple, fast, with a good customizable graphic environment, and with the necessary software for this type of machine, especially because of the small screen.
Thanks again for all your collaboration, always very grateful.
It works, but if you perform update tasks and they affect the Ubuntu Core you have to repeat the task. Is there any way for this mod to stay like this?
If Javivi, you can create a script that for example runs every update is made, and creates the custom configuration file.
See you and I'll explain how I do
Thanks a lot! Hope it works in elementary.
regards
It didn't work for me on Kali Linux
It does not work for me in PrimeOS …… 🙁 below I leave my android.cfg
# $ 1 Title
# $ 2… Kernel cmdline
function add_entry {
menuentry "PrimeOS $ 1" "$ @" –class android-x86 {
shift 2
set root = $ android
linux $ kdir / kernel root = / dev / ram0 androidboot.selinux = permissive buildvariant = userdebug $ src $ @
initrd $ kdir / initrd.img
}
}
# $ 1 EFI to chainload
# $ 2 OS name
# $ 3 Class
function add_os_if_exists {
# Is there a better way to find ESP?
for d in hd0, gpt1 hd0, gpt2 hd1, gpt1 hd1, gpt2 hd0, msdos1 hd0, msdos2 hd1, msdos1 hd1, msdos2; do
if ["($ d) $ 1"! = "$ cmdpath / $ bootefi" -a -e ($ d) $ 1]; then
menuentry «$ 2 at $ d ->» «$ d» «$ 1» –class «$ 3» {
set root = $ 2
chainloader ($ root) $ 3
}
break
fi
done
}
if [-s $ prefix / grubenv]; then
load_env
fi
if ["$ grub_cpu" = "i386"]; then
set bootefi = bootia32.efi
set grub = grubia32
else
set bootefi = BOOTx64.EFI
set grub = grubx64
fi
if [-z "$ src" -a -n "$ isofile"]; then
set src = iso-scan / filename = $ isofile
fi
search –no-floppy –set android -f $ kdir / kernel
export android bootfi grub kdir live src
# Create main menu
add_entry "$ live" quiet
# Add other OSes boot loaders if exist
add_os_if_exists /EFI/fedora/$ánticogrub-lex.europa.eu.efi Fedora fedora
add_os_if_exists /EFI/centos/$ánticogrub-lex.europa.eu.efi CentOS centos
add_os_if_exists /EFI/ubuntu/$ánticogrub-lex.europa.eu.efi Ubuntu ubuntu
add_os_if_exists /EFI/debian/${grub-lex.europa.eu.efi Debian debian
add_os_if_exists /EFI/linuxmint/${grub-lex.europa.eu.efi "Linux Mint" linuxmint
add_os_if_exists /EFI/Microsoft/Boot/bootmgfw.efi Windows windows
if [-s ($ android) $ kdir / install.img]; then
add_entry «Installation» INSTALL = 1
fi
submenu «Advanced options ->» {
add_entry "$ debug_mode - DEBUG Mode" DEBUG = 2
add_entry "$ live - No Setup Wizard" quiet SETUPWIZARD = 0
add_entry "$ live - No Hardware Acceleration" quiet nomodeset HWACCEL = 0
if [-s ($ android) $ kdir / install.img]; then
add_entry "Auto Install to specified harddisk" AUTO_INSTALL = 0
add_entry "Auto Update" AUTO_INSTALL = update
fi
add_os_if_exists / EFI / BOOT / $ bootefi "UEFI OS"
add_os_if_exists /EFI/BOOT/fallback.efi "UEFI Fallback"
if ["$ grub_cpu"! = "i386"]; then
add_os_if_exists /EFI/BOOT/fallback_x64.efi "UEFI Fallback"
menuentry «Reboot» {reboot}
menuentry «Poweroff» {halt}
menuentry "UEFI BIOS Setup" {fwsetup}
fi
}
for d in $ config_directory $ cmdpath $ prefix; do
if [-f $ d / custom.cfg]; then
source $ d / custom.cfg
fi
done
Although the sequence of orders that it has is long in the version that I have, I found it and it was not difficult to locate it since it was the only one that I saw among all the orders that the grub had. Thank you, this tutorial helped me
THX