# Login GUI accepts user/pass but keeps asking to login



## JW0914 (Mar 7, 2015)

I enabled a login GUI (I think through Xorg or X Window), however, every time I login now, the login is successful but the Login GUI doesn't exit to the terminal/shell prompt; instead, the Login GUI accepts the successful login then immediately loads a new login gui window.  This will repeat endlessly until the server is rebooted (occurs with both my user account and root's).

If someone could please point me in the right direction of what configuration file I need to look at and what options I either didn't edit correctly or missed entirely, I would be extremely appreciative =]

(BTW, this could very well be the wrong section this should be posted in, and if it is, I apologize)


----------



## rmoe (Mar 7, 2015)

Based on what you say I can only offer a vague guess: Your "login GUI" is "slim" and you don't have a window manager installed.

If you tell us more and more detailed we might be able to help.


----------



## JW0914 (Mar 8, 2015)

Solved it... sort of.  While I don't know why the login gui screen keeps asking to re-login over and over again, or know how to troubleshoot it, I was able to go back to the shell login by commenting out ttyv8 in /etc/ttyv.

I'll apologize ahead of time, as I'm not sure what information I should provide...  If you can let me know the information I should post, I'll get it all together for you guys. (I always try to supply as much information as possible, as it makes it easier for others to help; however, I'm new to FreeBSD and UNIX based OSes and wasn't sure what information I should or should not include.)

I'm currently using FreeBSD 10.1 x64 non-UEFI (couldn't get the UEFI install to boot, either in UEFI only or via CSM).  I have both Xorg and X Window installed, and for the most part, it's still a vanilla FreeBSD.  I may be missing one, at most two, but the only software I've installed thus far is sudo,_ xorg, X11, StrongSwan, and Vim_... all were installed from ports.

I was following a tutorial of suggested customizations (I didn't bookmark the page unfortunately), and the configuration edit that caused this was to /etc/ttys and adding the following to ttyv8:

```
ttyv8 "/usr/local/bin/xdm - nodaemon" xterm on secure
```
I'm obviously missing some steps somewhere, I'm just not sure where... I was under the impression you could have a login GUI without running a desktop GUI, however my understanding could very well be flawed.


----------



## rmoe (Mar 8, 2015)

What do you want? X to run a terminal emulator?

I suggest you undo the /etc/ttys change (by resetting it to "off") and then go clean from there depending on what you want.

If you want a pure console system then get rid of the X stuff. If you want a typical GUI desktop then pick your choice and install it. Here's a pretty nice and useful relatively newb proof guide -> https://cooltrainer.org/a-freebsd-desktop-howto/

Feel free to ask for detail help if there's a problem.


----------



## Kiiski (Mar 8, 2015)

Hi

Maybe you already have studied handbook about Xorg things, but if not I would suggest so.

https://www.freebsd.org/doc/handbook/x11.html

Because you mentioned that you are new to FreeBSD, you may not know that most of the time the best place to start looking for information about things is the Handbook (after man pages of course).


----------



## abishai (Mar 8, 2015)

This means that window manager couldn't be started. Check your .xinitrc and ensure that startx works from the console.


----------



## JW0914 (Mar 8, 2015)

Thanks a bunch =]

I'm not looking for a desktop environment since the purpose of the server is just NAS, and I only need the server as a VPN to allow sharing of the drive array, however I do want a window manager for convenience.  I haven't been able to do enough research yet into how much/many resources a desktop environment utilizes, and how that would affect throughput and disk I/O while accessing data on drives over a network.  I know I have a fairly fast server, utilizing 16GB of RAM and an AsRock C2750d4i (Intel Atom octacore), and assume a desktop environment wouldn't utilize a lot of resources, however I haven't been able to research it thoroughly yet.

This server setup has been a crash course in FreeBSD and UNIX based OSes, and another concern of mine is how secure [network wise] a desktop environment would be in comparison to console based system.  I installed X because I was following the FreeBSD guide, as I've been heavily relying on the guide and other tutorials from others on how to setup the OS.


----------



## JW0914 (Mar 8, 2015)

abishai said:


> This means that window manager couldn't be started. Check your .xinitrc and ensure that startx works from the console.



Is .xinitrc located at

/home/[username]/.xinitrc

(I'm not at home and can't IPMI into JViewer to access the server)


----------



## rmoe (Mar 9, 2015)

JW0914 said:


> ... assume a desktop environment wouldn't utilize a lot of resources ...
> 
> This server setup has been a crash course in FreeBSD and UNIX based OSes, and another concern of mine is how secure [network wise] a desktop environment would be in comparison to console based system.  I installed X because I was following the FreeBSD guide, as I've been heavily relying on the guide and other tutorials from others on how to setup the OS.



Well, then you would be wrong. X and related stuff (read: All those nice GUI apps) do eat resources big time.

That said, you might want to look into either x11-wm/jwm or into x11-wm/openbox. While openbox is by far more frequently used and well known it's also kind of a modular building block system that by itself comes rather "naked" and needs additional modules. jwm on the other hand is somewhat more frugal yet pretty complete, i.e. after installing jwm you have a complete desktop GUI incl. panel. Both are quite small (in fact, _very_ small compared to, say gnome or kde) and might be just what you're looking for (and I've written auto-menu generators for both *g).

As for security, don't get me wrong, but I'm not taking that serious. Someone asking for a desktop GUI for a NAS ...

P.S. Yes, .xinitrc is located in the home directory, i.e. ~/.xinitrc


----------



## JW0914 (Mar 9, 2015)

lol I may not have articulated myself very well... I'm not looking for a desktop GUI, as it's not needed.  I was replying to your earlier post about what I was looking for/trying to do and my thought processes.  While also not needed, I was looking for a login gui outside the terminal because of aesthetics and my own personal design preference.

When I first started doing research into what I should buy to build my own server, I paid attention to what OS's the MB supported as I had no clue, and still know very little, of server OSes.  This led me into should I install an OS with a GUI, and while it would be convenient from time to time when I'm in WinPE on my laptop and need to research issues on something larger than my phone's screen, my concern was that a GUI would hog valuable system resources and is why I scrapped Windows Server 2012 after reading about how resource intensive the OS is... which led me to FreeBSD.  Even if I can find a fairly minimalistic desktop GUI, my next major concern is network security, as the extent of my knowledge of UNIX based firewalls is the few rules I added on my OpenWRT router to protect from brute force.  I use Comodo Internet Security on my laptop and have that heavily configured (I'm anal when it comes to my PC firewall), and while I've added a few rules to ipfw(8) that were suggested here:

https://www.digitalocean.com/community/tutorials/recommended-steps-for-new-freebsd-10-1-servers

my lack of knowledge of how to customize and lock down the firewall is of concern.  It's one of the many things I haven't got a chance to fully learn yet.

_EDIT: Totally off topic, can you point me in the right direction of where to look on how to uninstall the support software that gets installed when you install a port [say x11/xorg]  make deinstall obviously uninstalls x11/xorg, but what about all of the supporting software that was installed with it? Thanks =]_


----------



## rmoe (Mar 9, 2015)

Well, JW0914,

It's time for a confession. Just one of these days (womans day) I went to a flower shop and asked for a pound of nice red  flower stuff. After unwrapping them and putting them into a plastic bag (for practical transportation) I went home and gave the bag to my wife. Know what? She looked into the bag and said "asshole!".

I'm afraid, I'm lousy at remote guessing other peoples desires.

You want a console based NAS with a nice GUI for login for aesthetic reasons? But it should be secure? And the firewall should be aesthetically and visually pleasing, I assume? Probably I'm dumb and a frigtheningly exotic minded but I'm at a loss here.
For the moment I can only think of mac or i-something. It seems apple is strong in visually pleasing stuff.

But I'm well minded. As soon as you ask a concrete question related to FreeBSD I'll try to answer it.


----------



## JW0914 (Mar 9, 2015)

I apologize, as it's clear I'm not articulating very well what I'm trying to do, and it's not making logical sense and becoming a bit frustrating for you [my fault, not yours]. 

Here's what I'm looking for:

Console based system
Window manager for convenience to run multiple commands at the same time
ability to switch from window manager, to terminal, and back to the same window manager session
_(I don't know what config options to set to allow that, as currently, if start X, press ctrl+alt+F2, I can't get back into the the window manager session I was just in)_


Login GUI that starts the window manager upon login.


----------



## rmoe (Mar 9, 2015)

Question: Why not simply setting up a system with a desktop and saving the jumping tofro console/X by having as many terminal windows open as you like?

Why are you fixed on calling it a "console based system" when in fact you want a login gui and a full desktop?


----------



## JW0914 (Mar 9, 2015)

I was trying to avoid a full desktop gui because 99% of it simply won't be used because it's not needed (at least this is my perception, which could be flawed).  It might be better to explain my end plan here (disk layout terminology not accurate to zfs layout):

Configure the 17TB of drives using zfs-x
Create a setup similar to how Seagate configures their Central NAS with two partitions (Public and Private - client side) where each utilizes the same physical disk partition (?) (saving a 1GB file on Private also removes 1GB of storage availability from Public, each showing the same disk usage size on the client side)

Create and configure a VPN tunnel over the internet to connect the server to a remote location
Create a few different user groups and assign access permissions to disk usage_ (like Private and Public on Seagate Central, where the Private disk space is secured with a user name/pass)_
Nothing else_ (I may add a few other things like a PXE for WinPE, but the NAS portion is the sole purpose I built my server for)_
I'm used to Windows and I'm thinking about this in terms of WinPE and cmd... while in WinPE, I utilize multiple cmd windows, affording me the ability to run multiple commands at the same time.  This is why I was looking more so into a Window Manager instead of a full fledged Desktop GUI.

_EDIT: While I'd prefer a login gui that puts me directly into a window manager upon login, I have no problem issuing the command within the terminal to start the window manager... i was simply trying to eliminate a step_


----------



## JW0914 (Mar 9, 2015)

I should have also mentioned, I only want to be able to utilize a Window Manager when I need to physically do maintenance on the OS... all other times I'd like the OS to run with just the non-gui terminal/console open (at least I assume that's how it will work as a NAS, perhaps a user doesn't need to be logged into the OS for it still to operate as a NAS?)


----------



## sidetone (Mar 9, 2015)

You need a minimal .xinitrc file and an xsession file. This xsession file can be in the form of /usr/local/share/xsessions/*.desktop or .xession in your home directory. These two files have completely different syntax, and of course these have to be completely set.

It logged in, but then it can't find the command lines in the file needed to run, so it goes back in a loop.


----------



## sidetone (Mar 9, 2015)

Thread slim-configuration.25356
Thread how-to-configure-slim.48747/

The minimal coding is in those threads. This also applies to other window and login managers, including minimal configurations.


----------



## rmoe (Mar 9, 2015)

What is a "full desktop gui"? As opposed to what? A minimal desktop GUI? jwm, for instance, is just a couple of MB, i.e. less than most applications, even simple X terminal emulators.

Pardon me for stopping this merry go round and talking bluntly:

You are evidently not in a position to come up with a sensible concept because you simply lack the necessary understanding (particularly in FreeBSD/Unix). That doesn't mean you can't get what you want. It just means that you can't specify concept details and the implementation. An added problem is that you think in windows terms and paradigms.

How to proceed? Simply stop to enforce a concept and implementation upon yourself and us. Rather state what you want, state the desired functional result.
That means: do _not_ postulate "I want the server to connect through a VPN" but rather state what you want - independent of how to achieve that. State "I want some 2 - 20 users from anywhere in the world to securely connect to my file server and I want them to have a) a private area and b) access to some public area for all users or groups of users".

It might also be helpful to tell us whether you looked at shrink wrapped solutions like FreeNAS and if so why you didn't chose one of those.

P.S. Any Unix system can serve users through diverse servers (e.g. web, mail, files ...) without anyone being logged in. You only need to log in when you want to work on the system, e.g. for configuration or maintenance, etc. Btw, that would be typically done through a SSH remote connection (a secure "remote console").


----------



## JW0914 (Mar 9, 2015)

abishai said:


> This means that window manager couldn't be started. Check your .xinitrc and ensure that startx works from the console.





sidetone said:


> You need a minimal .xinitrc file and an xsession file. This xsession file can be in the form of /usr/local/share/xsessions/*.desktop or .xession in your home directory. These two files have completely different syntax, and of course these have to be completely set.
> 
> It logged in, but then it can't find the command lines in the file needed to run, so it goes back in a loop.





sidetone said:


> Thread slim-configuration.25356
> Thread how-to-configure-slim.48747/
> 
> The minimal coding is in those threads. This also applies to other window and login managers, including minimal configurations.



Thanks! =]


----------



## JW0914 (Mar 9, 2015)

rmoe said:


> What is a "full desktop gui"? As opposed to what? A minimal desktop GUI?...
> 
> You are evidently not in a position to come up with a sensible concept because you simply lack the necessary understanding (particularly in FreeBSD/Unix). That doesn't mean you can't get what you want. It just means that you can't specify concept details and the implementation. An added problem is that you think in windows terms and paradigms.
> 
> ...



You're not being rude and are absolutely right, I do lack a understanding of UNIX based OSes (I was honest and upfront about that; regardless, I apologize as I understand how it's probably a bit frustrating). I think I may have a misunderstanding of what a desktop gui is and what it entails...  Reading through the FreeBSD handbook it had a link to Window Managers and in another section discussed full desktop GUIs like KDE, Gnome, and XFCE.  The Window Managers I saw were just window managers with windows for terminals and windows running scripts (reminded me of rainmeter and it's .ini based scripts on windows) and the desktop GUIs were full desktop experiences with menus, control panels, bundled applications, etc.

I did do some basic research into FreeNAS, PC-BSD, and a few others, but in every forum I read, it always cropped up as a consensus that FreeBSD runs better than anything else on a server.


I want 2 remote locations with 2 - 5 users to securely connect to my file server and I want there to be a private area for me that's password protected, a private area for a group of individuals that's password protected, and a public area that is not secured with a password.
I need to be able to access data on disk _x_ as a network share (not ftp) in a remote location (i.e. _//server_host_name/disk partition/_ on a remote windows computer)
I need to be able to remotely ssh via PuTTy into FreeBSD (I can remotely ssh into the MB via IPMI, but it's more complicated)


----------



## JW0914 (Mar 9, 2015)

I know how frustrating it can be to try and walk someone through something they have little understanding of.  I have no problem researching issues or spending time looking up how to do something... I actually prefer it to someone giving all the answers.  I was able to get through most of the first page on the link you gave me earlier before I had to leave, and will finish it later tonight, but I'm perfectly okay with you just shooting me in the right direction of where to look for a few solutions, rather than trying to essentially teach me how to do quite a few different things (to me, I think it rude and inconsiderate to expect someone to do that)


----------



## rmoe (Mar 9, 2015)

Nice to see that you understood my friendly intentions. You see, I want to help you but I had to stop you and to guide you towards a more fertile path.

So:
- the desktop stuff basically comes down to "anything graphical, anything non pure console is some kind of X plus some desktop". Coming from windows it might strike you as odd but on Unix we have a plethora of desktops. The basis (right above X itself) is usually a window manager. openbox is a good example. Most people also want a panel ("taskbar"), a menu and possibly other stuff (like desktop icons). Those are usually "built in" with the better known Desktop environments (like Gnome or KDE or XFCE) but they can also be installed seperately. "tint2" for instance is a panel that is often installed along openbox. This game can be driven quite far to e.g. KDE, eating away hundreds of MB.
As you basically just want a somewhat friendly environment for administration (as opposed to, say, someone doing video editing) and as you almost certainly want most resources to go into the purpose of serving files, I suggested jwm. jwm is a) small and very resource friendly and b) simple; it comes with the basic essentials (taskbar, menu).

- FreeNAS is FreeBSD! It's just FreeBSD streamlined for NAS and incl. some nice GUI. It might, in fact, be just what you're looking for.

- If you want remote users to access the file server the way you described there are two issues to be addressed: a) security. Some kind of tunneling may be the most practical option (depending to a degree also on the equipment at those offices). b) file access. This usually comes down to NFS (unix) or SMB/CIFS (windows) depending on the OS your users use. All the rest (private areas, etc) are to be configured with the respective server (software, like Samba for CIFS).

- SSH (putty) is no problem at all. All BSDs support that. But careful! Any kind of remote access brings security issues with it. Those can be easily dealt with; I just mention them because you need to keep them in mind.

All in all I would strongly suggest that you have a second - and deeper - look at FreeNAS. And I guess their forum might be the right place for your questions; simply because that's what FreeNAS is all about.


----------



## JW0914 (Mar 9, 2015)

Thanks a bunch! =]

I will give FreeNAS a more in depth look then


----------



## kpa (Mar 9, 2015)

rmoe said:


> - FreeNAS is FreeBSD! It's just FreeBSD streamlined for NAS and incl. some nice GUI. It might, in fact, be just what you're looking for.



The full story is actually more complicated than you would think. The kernel may be quite standard with no heavy customizations but the so called "world" is reimplemented quite differently compared to vanilla FreeBSD. Much of the rc(8) infrastructure is replaced by PHP code, this is the heritage of it being based on m0n0wall that also replaced the rc(8) system with PHP to allow more customization possibilities. It also uses one central XML configuration file and many of the individual configuration files you're familiar with on FreeBSD are created "on the fly" from the central configuration. FreeNAS may look a lot like FreeBSD but it's not really FreeBSD and you'll run into problems very soon when you start applying FreeBSD specific solutions to configuration issues on FreeNAS, they won't work.


----------



## JW0914 (Mar 9, 2015)

kpa said:


> The full story is actually more complicated than you would think. The kernel may be quite standard with no heavy customizations but the so called "world" is reimplemented quite differently compared to vanilla FreeBSD. Much of the rc(8) infrastructure is replaced by PHP code, this is the heritage of it being based on m0n0wall that also replaced the rc(8) system with PHP to allow more customization possibilities. FreeNAS may look a lot like FreeBSD but it's not really FreeBSD and you'll run into problems very soon when you start applying FreeBSD specific solutions to configuration issues on FreeNAS, they won't work.



Does there exist any type of tutorial(s) that would be able to guide someone through configuring FreeBSD to match the GUI of FreeNAS as much as possible?


----------



## kpa (Mar 9, 2015)

JW0914 said:


> Does there exist any type of tutorial(s) that would be able to guide someone through configuring FreeBSD to match the GUI of FreeNAS as much as possible?



I doubt that anyone has even tried that. FreeNAS is specialized system for one purpose (NAS) and reason why it was created was simply that vanilla FreeBSD was not suitable for building such specialized solutions because it would have been enormous amount of work. You could easily mimic the look and feel of the FreeNAS GUI but getting the same functionality is out of reach completely.


----------



## sidetone (Mar 9, 2015)

JW0914 said:


> Does there exist any type of tutorial(s) that would be able to guide someone through configuring FreeBSD to match the GUI of FreeNAS as much as possible?



You can come close to the look by matching whichever windowmanger and other desktop programs it uses, if its available. You'd have to research those programs documentation, which aside from FreeBSD's configuration directories, much wouldn't be on FreeBSD forums.

What kpa said is usually true for most applications. It's better to say it's FreeBSD based, because to some extent it varies from FreeBSD.


----------



## rmoe (Mar 10, 2015)

PHP? FreeBSD rc system thrown out? Uhm ... I won't mention FreeNAS anymore then.

Apologies for my quick shot. I never actually used FreeNAS. I just found it mentioned frequently and had a quick look at it. But I had no need because obviously I personally would build everything with FreeBSD.
But then the OP here isn't that experienced a user plus he wanted a nice GUI (something I personally couldn't care less about).


----------

