I'm connecting to target computer through SSH from command line. Target computer is running Gnome. I need to be able to tell the target computer to change its desktop to a fullscreen text console (like when you do ctrl-alt-f2). Running Gnome terminal fullscreen is not an option. Is this possible?
4 Answers
chvt N with N the number of the terminal (2 in your example). On Debian it's in the kbd package, I guess it should be the same on Ubuntu.
-
I don't know why I got downvotes, but I'm happy I asked because you and 200_success gave me a working solution! I'd also upvote but don't have enough reputation for that.user14742– user147422012-10-29 22:59:07 +00:00Commented Oct 29, 2012 at 22:59
You could run: telinit 3 or init 3 as root.
That will kill the graphical multiuser sessions and go into runlevel 3.
You don't mention the specific version of Linux, but for subsequent reboots, you want to default to runlevel 3 (instead of 5) in your /etc/inittab.
-
It seems to be distribution dependent. Neither init 3 nor telinit 3 stop xorg under debian 6 here. wiki.debian.org/RunLevel. Btw :Is there still any reason to use telinit nowadays except very old aix?user21448– user214482012-10-29 17:48:38 +00:00Commented Oct 29, 2012 at 17:48
-
Remote computer is Ubuntu 11.10. telinit 3 or init 3 didn't work. Also there is no inittab, maybe because Ubuntu uses upstart?user14742– user147422012-10-29 17:52:22 +00:00Commented Oct 29, 2012 at 17:52
-
Well, I guess Ubuntu is a valid OS :) Check out: askubuntu.com/questions/115469/…ewwhite– ewwhite2012-10-29 18:46:32 +00:00Commented Oct 29, 2012 at 18:46
You will want to use wmctrl. It's a program which can mess with X windows. More information can be found here. Also: Wikipedia article and man page. This program can be installed on the target machine by running apt-get install wmctrl.
-
wmctrl seems to require correct Display parameter to be set and I don't want to use any X-forwarding. Am I missing something?user14742– user147422012-10-29 17:57:09 +00:00Commented Oct 29, 2012 at 17:57
-
-1: wmctrl doesn't have anything to do with this (he wants to switch to a text console).Renan– Renan2012-10-29 23:42:26 +00:00Commented Oct 29, 2012 at 23:42