1

|

My PC wont boot every second time I try to boot ubuntu. But I seem to have found a fix, which is editing setparams by pressing 'e' in grub.

I edit the

"gfxmode #linux_gfx_mode" 

to

"gfxmode nomodeset"

and can then boot ubuntu as normal. So I wanted to make this change permanent. I tried changing grub command in the /etc/default/grub with

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"

This is added to the linux boot command in setparams in the grub, but makes my computer hang up instead and does not change the line with

"gfxmode #linux_gfx_mode"

How do I make change the gfxmode permanent so my computer can boot properly every time?

4 Answers4

2

It seems that /boot/grub/grub.cfg is generated from files in /etc/grub.d

I managed to make the change permanent by replacing in this file /etc/grub.d/10_linux the line:

echo "  gfxmode \$linux_gfx_mode" | sed "s/^/$submenu_indentation/"

with this:

echo "  gfxmode nomodeset" | sed "s/^/$submenu_indentation/"

Afterwards I ran:

sudo update-grub

to generate the new grub.cfg

galoget
  • 3,023
1

If I understood the question, you have to modify the file /etc/default/grub (do it as root) and then give the command:

sudo update-grub

This command makes the change effective

PaoloC
  • 11
0

After reading the script in /etc/grub.d/10_linux, I have found a better answer than the currently accepted one. Simply add this line to your /etc/default/grub file, and then run sudo update-grub:

GRUB_GFXPAYLOAD_LINUX="nomodeset"

This variable is what ultimately controls the code path mentioned in the other answer, and appears to be the correct way to modify this setting. Additionally, you may want to change

GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"

to this instead

GRUB_CMDLINE_LINUX_DEFAULT="nosplash nomodeset"
BLuFeNiX
  • 101
0

I have edited /boot/grub/grub.cfg and modified "gfxmode #linux_gfx_mode" to "gfxmode nomodeset" in the bootparameters for ubuntu. I know this may not be the correct way to do it, but it seems to be the only way. I will have to do this every time I update grub.

Is there another way to make it permanent, please leave a better suggestion.