6

I have just installed ubuntu 16.04 alongside windows 7, and would like an option in the boot menu for a console only. I found the following entry in /boot/grub/grub.cfg:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-afa3d5b1-2af8-4e3d-b97f-91336a0e70b3' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  afa3d5b1-2af8-4e3d-b97f-91336a0e70b3
    else
      search --no-floppy --fs-uuid --set=root afa3d5b1-2af8-4e3d-b97f-91336a0e70b3
    fi
    linux   /boot/vmlinuz-4.4.0-31-generic root=UUID=afa3d5b1-2af8-4e3d-b97f-91336a0e70b3 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-4.4.0-31-generic
}

I copied this to /etc/grub.d/40_custom and changed the linux line to

    linux   /boot/vmlinuz-4.4.0-31-generic root=UUID=afa3d5b1-2af8-4e3d-b97f-91336a0e70b3 ro text

The resulting boot option has no splash screen and I see a login prompt in tty1 as expected, but then the GUI appears after all (and the end result is the same as the existing boot option). Do I need to modify some other part of the entry?

Note: Following this answer I tried '3' instead of 'text', but the result is the same.

1 Answer 1

3

After more searching and some trial and error, I arrived at the following which has the desired behaviour. In particular I added linux boot parameters text single 3.

menuentry 'Ubuntu console' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-console' {
  recordfail
  gfxmode text
  insmod gzio
  if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
  insmod part_msdos
  insmod ext2
  set root='hd0,msdos5'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  afa3d5b1-2af8-4e3d-b97f-91336a0e70b3
  else
    search --no-floppy --fs-uuid --set=root afa3d5b1-2af8-4e3d-b97f-91336a0e70b3
  fi
  linux /boot/vmlinuz-4.4.0-31-generic root=UUID=afa3d5b1-2af8-4e3d-b97f-91336a0e70b3 ro quiet text single 3
  initrd    /boot/initrd.img-4.4.0-31-generic
}
2
  • This indeed gave me a VT login prompt (while everything else has been failing it seems), but the console wasn't working correctly. Also TERM, LINES and COLS were set correctly, output prints till the bottom of the screen and then continuous to be printed below the screen edit, without scrolling. Even more so, causing a lot of output would eventually scroll, but not line by line - as if the output wasn't a terminal at all and lines were only flushed once the buffer is too full (probably the main problem, also when reaching the bottom of the screen).
    – Carlo Wood
    Commented Mar 18, 2020 at 1:32
  • @CarloWood sorry I'm not knowledgeable enough to help you with that (I didn't have any such issue myself). You might have some luck posting a new question?
    – stewbasic
    Commented Mar 18, 2020 at 3:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .