Today I’m posting a little tidbit that, while extremely basic, I haven’t seen posted anywhere. I’ve seen plenty of forum posts by PPC linux users on mac laptops needing help and being told to open a virtual terminal with the standard ctrl-alt-F1 (~F6) combination. This doesn’t work, and I’ve never seen that point brought up.
Long story short for those who know what I’m talking about here:
You need to press the fn key at the bottom left of the keyboard in addition to the ctrl, alt, and function key. For example, for F1 (to open TTY1), you press:
ctrl-alt-fn-F1
Whereas the standard method of opening a virtual terminal on Linux is to press the control, alt keys and a function key (any one of F1 through F6 on most boxes), this won’t be recognized on a Mac laptop because the function keys on these machines have other jobs which take priority over their function key roles, such as changing volume, turning on and off “num lock” (turns part of the keyboard into a numeric keypad), etc. These keys only behave as function keys when the “fn” key down at the bottom left of the keyboard is also pressed at the same time. Therefore, for mac laptops, the correct key combination is, let’s say in the case of the F1 key, not ctrl-alt-F1 but ctrl-alt-fn-F1.
Opening a virtual terminal means switching from your standard desktop (such as Gnome or KDE or whatever window manager you use on top of X11) to a full screen terminal that will show you a login prompt and let you log into another session on your machine for whatever reason. While this is something most typical PC users (non techies, for instance) rarely need to do, it is an essential feature on Linux when you run into trouble.
For instance, if your desktop freezes on you on a Linux box, chances are that it is X11 freezing and not your whole computer. In other words, a situation where even though your mouse and keyboard are unresponsive and the screen is frozen, non GUI stuff is still running in the background as if nothing were wrong. Most people, when presented with this situation, will force shutdown their computer which can possibly damage data on your hard drive. In such a situation it is far better to ask your computer to shut itself down so that no damage is incurred. Alternately, you could ask X11 to restart. Either way, you may loose changes on any files you were working on, but you won’t damage anything.
How can you do that when your keyboard and mouse won’t respond? That’s where the virtual terminal comes in. While the keyboard and mouse may *seem* not to be responding, it may only be the X11 server that isn’t reacting. Trying to open a virtual terminal will let you know whether this is the case or not. Simply use the above key combination (ctrl-alt-F1 through F6 for normal PCs, ctrl-alt-fn-F1 though F6 for a Mac laptop), and if your screen changes to a terminal screen, i.e. black with some white text up top, then you are good to go. Type in your username and password to log in to the terminal, and use your command line magic to fix whatever is wrong. On Ubuntu, if you just wanted to reboot, it would be:
sudo reboot
You still loose changes to open files, but at least you don’t damage anything. By the way, if you ever encounter a freeze in this way, it would be a good idea to use the lspci command to find out your video hardware and make sure you are using the correct driver for X11. Sometimes using a more stable or generic driver will save you from encountering any more freezes.
Personally, I spend time trying to tweak xorg.conf to get the full performance out of the ATI graphics cards on the old donated PPC laptops which means plenty of failed boots and freezes, so the virtual terminal is something I use regularly.







