# How to switch to command line from GUI



## freeink (Nov 17, 2019)

How can I switch from XFCE desktop environment to pure _text terminal like in Linux do, using command  "init 5"  and "init 3"?_


----------



## unitrunker (Nov 17, 2019)

How did you get an X windows desktop environment? FreeBSD does not provide this in the base install. You start from a shell prompt and then install packages to get a GUI.

Try this:
control + alt + F2 to get a virtual terminal.
control + alt + F9 to go back to X.

This works for me on jwm.


----------



## scottro (Nov 17, 2019)

I am guessing you use some sort of display manager to boot up. (I don't use XFCE, maybe the package itself supplies that.)  Generally though, if you don't use a display manager, you will boot up in text mode and start your desktop or window manager with startx or perhaps xinit.  unitrunker's suggestions should work if you're booting up into X.  If you turn off the display manager (sorry, don't know how to do that) you will boot into text mode.

As for Linux, most systems no longer use init 3 and init 5. With systemd you have to do something like set target multiuser or similar (I forget the exact syntax and am too lazy to look it up.)  I imagine non systemd systems still use init 3 and 5 but I haven't used a display manager in so many years I've forgotten the syntax on systemd and non-systemd systems.


----------



## freeink (Nov 18, 2019)

Thanks,Later I also found out that newbie question already included in FAQ documentation.









						Frequently Asked Questions for FreeBSD 11.X, 12.X, and 13.X
					

Frequently Asked Questions, and answers, covering all aspects of FreeBSD




					www.freebsd.org


----------



## teo (Nov 18, 2019)

unitrunker said:


> How did you get an X windows desktop environment? FreeBSD does not provide this in the base install. You start from a shell prompt and then install packages to get a GUI.
> 
> Try this:
> control + alt + F2 to get a virtual terminal.
> ...


Do you use the jwm window manager? I wanted to use it but the configuration of jwm is very difficult.


----------



## Deleted member 9563 (Nov 18, 2019)

unitrunker gave the right answer. However, if you don't need a "pure" terminal then it's convenient to set a shortcut for a virtual terminal such as Qterminal. For me it's a quick `Ctrl-t` to the command line.

Don't forget the convenience of drop-down terminals. I use Guake Terminal for that. What's convenient for me is it pops right up with the last screen I was on. (single key toggle, on off) That makes it a nice quick reference window for wherever I am.


----------



## unitrunker (Nov 19, 2019)

teo said:


> Do you use the *jwm* window manager? I wanted to use it but the configuration of * jwm* is very difficult.


I do. Relevant line in my '~/.xinitrc' file.

```
exec /usr/local/bin/jwm
```
'~/.jwmrc' is the XML config file with all my menus. One of the default menu choices opens this file in an editor so you can customize your menus.


----------



## SirDice (Nov 19, 2019)

freeink said:


> using command "init 5" and "init 3"?


Runlevels are a typical System V Unix construct, BSD doesn't have or use them. That said, there is some form of runlevel on BSD but there's only 0, 1 and 6. 0 is _halt_, 1 is single user mode and 6 is reboot. See init(8). Older Linux' used runlevel 3 for 'normal' multi-user operation and 4 (or higher) for a graphical environment (Xorg for example). I do believe modern Linux' stopped using it. 






						Runlevel - Wikipedia
					






					en.wikipedia.org


----------



## teo (Nov 19, 2019)

unitrunker said:


> I do. Relevant line in my '~/.xinitrc' file.
> 
> ```
> exec /usr/local/bin/jwm
> ...


This topic I opened some time ago, if you see the configuration I had, however it was quite complicated configuration and customization that gave errors. Would you be so kind as to publish your .jwmrc configuration and customization file? 









						Other - JWM
					

Hello community! Does anyone have any idea how to configure this lightweight window manager?  There is not much documentation of this beautiful lightweight window manager on the internet and the little there is on its home page are just clues.




					forums.freebsd.org


----------



## Phishfry (Nov 20, 2019)

OJ said:


> @unitrunker gave the right answer


While I agree he gave a right answer I would like to expand on it for a fuller understanding.


unitrunker said:


> Try this:
> control + alt + F2 to get a virtual terminal.
> control + alt + F9 to go back to X.


There are 7 virtual terminals available when using Xorg.
Under Xorg there are separate virtual terminals located at all these spots.
control + alt + F2
control + alt + F3
control + alt + F4
control + alt + F5
control + alt + F6
control + alt + F7
control + alt + F8

This terminal contains all the inner workings of an Xorg session
control + alt + F1

And as mentioned above
control + alt + F9 gets you back to an Xorg window.

You can see the settings yourself in /etc/ttys

```
#
ttyv0    "/usr/libexec/getty Pc"        xterm    onifexists secure
# Virtual terminals
ttyv1    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv2    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv3    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv4    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv5    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv6    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv7    "/usr/libexec/getty Pc"        xterm    onifexists secure
ttyv8    "/usr/local/bin/xdm -nodaemon"    xterm    off secure
```


----------



## unitrunker (Nov 20, 2019)

teo said:


> Would you be so kind as to publish your *.jwmrc *configuration and customization file?


Don't want to take this thread too far off topic. I'll post an example in the jwm thread you linked above.


----------

