0

I'd like to be able to boot into Windows from Ubuntu and into Ubuntu from Windows with grub.

Can I edit my /boot/grub/grub.cfg where there's the following:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="3"

and only change from time to time the set default = "x" where x is the operating system on the grub list I want to boot on?

Is this going to work?

Marco A.
  • 145
  • 1
  • 1
  • 5
  • @DavidKernin Are you saying you want Windows and Ubuntu to automatically edit that file, or otherwise change GRUB's configuration, so that every time you reboot from Windows it boots into Ubuntu without letting your choose, and so that every time you reboot from Ubuntu it boots into Windows without letting you choose? If that's what you want, I recommend editing your question to make that clearer. (Then you can flag this comment as obsolete.) Otherwise, please edit your question (and also possibly reply to this comment) to explain how this is not what you want. – Eliah Kagan Sep 05 '13 at 19:31
  • 1
    Err... I see a big warning at the start of that script saying "DO NOT EDIT THIS FILE", why you want to edit it? – Braiam Sep 06 '13 at 00:07
  • @Braiam If this is about what I kinda sorta suspect it might be about, then editing the file correctly should be okay because update-grub doesn't get run in between shutdown of one OS and startup of the subsequently booted OS. That is not to say editing that file is necessarily the best way to achieve that, though. (Or even that that's what this question is necessarily asking for...) – Eliah Kagan Sep 06 '13 at 03:11

0 Answers0