75

After booting to the GUI in 12.04, I attempt to move to the virtual terminal (or shell, or tty) via Ctrl-Alt-F1 (F1 through F6), and the screen remains blank. I have tried all 6 tty instances and the results are the same. Ctrl-alt-F7 brings me back to the GUI without a problem. Any thoughts?

muru
  • 197,895
  • 55
  • 485
  • 740
SeanO
  • 931

6 Answers6

65

This is usually caused because the graphical text-mode resolution set at boot up is not compatible with your video card. The solution is to switch to true text-mode by configuring Grub appropriately:

  1. Open the terminal with Ctrl+Alt+T
  2. Paste the below, and enter your password when asked:

    sudo sed -i -e 's/#GRUB_TERMINAL/GRUB_TERMINAL/g' /etc/default/grub
    
  3. Then type sudo update-grub

  4. Reboot and the virtual terminals should now work.
ish
  • 139,926
  • That did it, thanks! It made the text a bit bigger than I would like once it reset to default. I opened the /boot/grub/grub.cfg file to edit the text size and the first line states "do not edit". Suppose that's a question for another day though. Thanks for the help – SeanO Jul 12 '12 at 16:37
  • Also works for me in 14.04.... great tip. – belacqua Apr 25 '14 at 16:18
  • Indeed, have some karma. – Noki Jul 04 '14 at 14:16
  • 1
    Unfortunately, this didn't help with my graphic-driver issues (I need the X server down to install proper drivers, but the lack of drivers prevents me from getting a working command-line with ctrl-alt-F1). – Jonathan Y. Feb 01 '15 at 20:34
  • This thing left my grub to black & white. – knh190 Apr 16 '15 at 14:24
  • 8
    CAREFUL, this thing has completely messed up my grub, I don't see a boot menu anymore. (Ubuntu 15.04) – Arty Oct 25 '15 at 03:21
  • @izx so this command opens /etc/default/grub and changes the line #GRUB_TERMINAL to #GRUB_TERMINAL/g right? I'm asking this just to know how to undo if anything goes wrong – 842Mono Jan 05 '16 at 23:23
  • 1
    @MinaMichael No. It changes #GRUB_TERMINAL to GRUB_TERMINAL. The slash ends the regular expression, and the g is the global-modifier that sais: replace ALL matches. – Philipp Zedler Jan 12 '16 at 11:23
  • 1
    Doesn't work on 14.0.4 for me – Zach Rattner May 17 '16 at 01:57
  • 1
    +1. This also solves a somewhat different problem: After the 16.04 upgrade I was actually able to see the virtual terminals hostname login: prompts but there was no input (keyboard echo) in them so I couldn't login. Uncommenting the GRUB_TERMINAL=console line followed by sudo update-grub solved this. – arielf May 29 '16 at 20:35
  • Did not work for me in 14.014, and now when I reboot, I get 'error: no video mode activated.' Can someone please tell me how to undo whatever I just did? – neuronet Jun 01 '16 at 21:24
  • @neuronet, Mount the drive on another machine, chroot to the rootfs, and regenerate/update your grub config. – sherrellbc Dec 20 '16 at 18:40
  • 1
    Hey @izx, I followed your steps. But the problem hasn't been solved yet. I got a black and white grub. But the terminals are black. actually, whenever the swap fills up, be it even a byte. My terminals go black. I am able to type on them. I just did chvt 2 and logged in to that blcak terminal and executed sudo reboot and it worked. The problem is with the display only. My problem http://askubuntu.com/questions/876982/virtual-consoles-tty1-tty6-not-working-on-ubuntu-16-04 – thewebjackal Jan 28 '17 at 17:04
  • 3
    Grub file states # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console Why would disabling graphical terminal fix this issue? For Ubuntu 16.04 – Sun Bear Mar 10 '17 at 17:56
  • This worked for me (kubuntu 16.04), but @MinaMichael s answer of setting GRUB_GFXMODE=auto worked better because it didn't change my grub menus. – Joe Jun 19 '18 at 23:08
15

What fixed this for me was adding nomodeset to the GRUB_CMDLINE_LINUX_DEFAULT line in the /etc/default/grub file. Here's how:

  1. Type in terminal: gksu gedit /etc/default/grub

  2. Search for this line: GRUB_CMDLINE_LINUX_DEFAULT

    So for example if you have:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1"
    

    change it to:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1 nomodeset"
    
  3. After you finish, update grub (sudo update-grub) and reboot (sudo reboot) for the changes to take effect.

Optional: You could add nomodeset vga=xxx (not just nomodeset), the xxx is a VESA screen code that best matches your screen resolution. Take a look at this.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
842Mono
  • 9,790
  • 28
  • 90
  • 153
7

This is for newer version of Ubuntu:

  1. Edit the GRUB configuration file:

    sudo nano /etc/default/grub
    
  2. Locate the line

    #GRUB_GFXMODE=640x480
    

    change it to

    GRUB_GFXMODE=auto
    

    and save the file.

  3. Then update grub

    sudo update-grub
    
wjandrea
  • 14,236
  • 4
  • 48
  • 98
Michael
  • 81
  • On Ubuntu 14.04.5 I installed a program that caused a 4.x kernel to be installed. Previously I had a 3.x kernel. This answer is what fixed this issue of blank ttys for me on an Asus Zenbook UX303LN. – frederickjh Apr 17 '18 at 12:30
1

Please take a look at my question at https://answers.launchpad.net/ubuntu/+question/643882, with regards to virtual terminal not functioning on Ubuntu 16.04 on Lenovo Thinkpad T400.

The solution i presented is geared towards user with Hybrid Graphics Card, in particular, AMD/ATI graphics card and Intel integrated graphics card. For me, disabling the intel graphics card and enabling the opensource ATI/AMD radeon module helps in my case.

If you are using a old Radeon graphics card like mine (Radeon HD 3450/3470), now you can switch between virtual terminal and graphical desktop with ease to troubleshoot potential issues.

If adding blacklist intel_graphics_card in /etc/modprobe.d/blacklist.conf and running

sudo depmod -a 

still doesn't work due to linux kernel or other dependencies, you are advised to add modprobe.blacklist=<module_name> to /etc/default/grub like the following example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash crashkernel=384M-:128M radeon.dpm=1  modprobe.blacklist=i915"
Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
0

Here is what worked for me on Ubuntu 18.04 with 2560x1440 screen:

  • open grub configuration file in editor: sudo gedit /etc/default/grub

  • uncomment GFXMODE and set your exact resolution -> change#GRUB_GFXMODE toGRUB_GFXMODE=2560x1440

  • add line GRUB_GFXPAYLOAD_LINUX=keep

  • Add remove splash and add nosplash noplymouth nomodeset to your GRUB_CMDLINE_LINUX_DEFAULT. After cahnges mine looks like GRUB_CMDLINE_LINUX_DEFAULT="quiet nosplash noplymouth intel_idle.max_cstate=1 nomodeset"

  • save the file

  • update grub sudo update-grub

  • reboot

  • use Ctlr+Alt+F2 to switch immediately after boot

0

You need to shut down the graphics driver after you Ctrl+Alt+F1 before you try to install the Nvidia driver

As in sudo /etc/init.d/lightdm stop

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
  • 3
    "before you try to install the Nvidia driver" - I'm not sure what you mean by that. The question doesn't mention anything about Nvidia drivers. – wjandrea Oct 02 '17 at 18:20