GRUB Entry for Console Only – How to Configure

grub2ubuntu 16.04

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.

Best Answer

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
}