# Added XDM - now stuck in a 'loop'



## fitz (Nov 19, 2014)

Hello forum,

I have been learning to install FreeBSD and, after some problems, finally got Xorg server to run successfully. Hooray! I have been following the 'Handbook', and so have just installed Xdm, and edited `/etc/ttys` to change off to on via ttyv8.

As I have had some trouble previously configuring Xorg, I have been routinely rebooting my installation, and, am now stuck with the Xdm manager loading, but with no instruction to follow after login.  So, it goes back to the login prompt.

One of the problems that I have had with my Xorg server configuration is that ctrl-alt-F1 or F2 etc. simply freezes my screen and does not give me access to a terminal to be able to edit my mistake allowing me to continue my installation. I cannot 'break' out of the loop that I have engineered it seems!

I have tried ctrl-C ctrl-X ctrl-Z etc, etc.  Ctrl-alt-backspace does nothing and Ctrl-alt-del simply reboots, putting me back in the 'loop'. Please could someone advise how I can get to a terminal?

I should also mention that I have chosen encryption for my HDDs.

Thank you everyone for any help.


----------



## wblock@ (Nov 19, 2014)

Boot into Single User Mode.
`mount -u /`
`echo "kern.vty=vt" >> /boot/loader.conf`
`shutdown -r now`
That will enable the vt(4) console so it can be seen after X is started.

xdm uses ~/.xsession rather than .xinitrc.  If the contents of .xinitrc do what is desired for `startx`, that file can just be copied to ~/.xsession.


----------



## fitz (Nov 20, 2014)

Hi wblock@,

Thanks for that.


```
# mount -u /
# echo "kern.vty=vt" >> /boot/loader.conf
/boot/loader.conf: No such file or directory.
```

Please could you talk through the above (apart from `shutdown -r now`). How can I just log in as root please? What I would also really like to know is how I can enable Ctrl-Alt-F1 to allow me into a console and not to 'lock' the machine?

Appreciate your assistance,

Fitz.


----------



## wblock@ (Nov 20, 2014)

Ctrl-Alt-F1 works, it is just that the default console does not show anything after X has been started.  This procedure switches the default console to vt(4), which _does_ work after X has been started.

If /boot is not available, it's probably because some encrypted devices need to be mounted.  I don't know how bsdconfig(8) sets that up now.  Did you choose ZFS when installing?


----------



## fitz (Nov 20, 2014)

wblock@ said:


> Ctrl-Alt-F1 works, it is just that the default console does not show anything after X has been started. This procedure switches the default console to vt(4), which _does_ work after X has been started.



OK, thanks, I guess that trying this out will be the only way to understand!



wblock@ said:


> If /boot is not available, it's probably because some encrypted devices need to be mounted. I don't know how bsdconfig(8) sets that up now. Did you choose ZFS when installing?



ZFS, yes, stripe and encryption, I thought as much. Time to start afresh, yet again! Why do we do it when there are so many stable distros out there.

I know the answer to that!


----------



## wblock@ (Nov 20, 2014)

It would probably be beneficial in the long term to figure out just what commands are needed to get /boot to be available on this type of setup.


----------



## fitz (Nov 20, 2014)

Please could you be a little bit more specific? I.e: do you mean learn what exactly happens during the boot process? Do you have any recommended link to start from? Thanks for your help, it's very kind of you.


----------



## wblock@ (Nov 20, 2014)

I mean that it's useful to know how something like this encrypted ZFS setup works, because a reinstall is often impractical.

Unfortunately, I don't know how bsdconfig(8) sets up an encrypted ZFS-on-root.  But I can ask around.


----------



## dteske@ (Nov 20, 2014)

fitz said:


> Hello forum,
> 
> I have been learning to install FreeBSD and, after some problems, finally got Xorg server to run successfully. Hooray! I have been following the 'Handbook', and so have just installed Xdm, and edited `/etc/ttys` to change off to on via ttyv8.
> 
> As I have had some trouble previously configuring Xorg, I have been routinely rebooting my installation, and, am now stuck with the Xdm manager loading, but with no instruction to follow after login.  So, it goes back to the login prompt.



Solution: install x11/xsm

The default configuration for xdm is to launch (first) xsm, *then* twm.
--
Devin


----------



## allanjude@ (Nov 20, 2014)

fitz said:


> `/boot/loader.conf: No such file or directory.`



You shouldn't have this problem, but, the unencrypted pool where /boot lives in called bootpool, try `zfs list` to find it.
It was set up with /boot as a symlink to /bootpool/boot.
It turns out `freebsd-update` eats this.


----------



## wblock@ (Nov 20, 2014)

So to enable vt(4), we can just write to loader.conf in /bootpool/boot?
`echo "kern.vty=vt" >> /bootpool/boot/loader.conf`


----------



## allanjude@ (Nov 21, 2014)

wblock@ said:


> So to enable vt(4), we can just write to loader.conf in /bootpool/boot?
> `echo "kern.vty=vt" >> /bootpool/boot/loader.conf`



Normally it should be the same /boot/loader.conf, but something odd must be going on this this particular install. I'd love to see the output of `zpool list`, `zfs list`, and `ls -al /boot` to try to debug it


----------



## fitz (Nov 23, 2014)

Sorry for the delay.

I rebuilt in the meantime due to having no system.

I have rebuilt as before, and, as requested:


```
root@:~ # zfs list
NAME  USED  AVAIL  REFER  MOUNTPOINT
bootpool  486M  1.45G  485M  /bootpool
zroot  2.10G  666G  96K  none
zroot/ROOT  1.51G  666G  96K  none
zroot/ROOT/default  1.51G  666G  1.51G  /
zroot/tmp  120K  666G  120K  /tmp
zroot/usr  607M  666G  96K  /usr
zroot/usr/home  96K  666G  96K  /usr/home
zroot/usr/ports  607M  666G  607M  /usr/ports
zroot/usr/src  96K  666G  96K  /usr/src
zroot/var  640K  666G  96K  /var
zroot/var/crash  96K  666G  96K  /var/crash
zroot/var/log  224K  666G  224K  /var/log
zroot/var/mail  120K  666G  120K  /var/mail
zroot/var/tmp  104K  666G  104K  /var/tmp
root@:~ # zpool list
NAME  SIZE  ALLOC  FREE  FRAG  EXPANDSZ  CAP  DEDUP  HEALTH  ALTROOT
bootpool  1.98G  486M  1.51G  17%  -  23%  1.00x  ONLINE  -
zroot  690G  2.10G  688G  0%  -  0%  1.00x  ONLINE  -
root@:~ # ls -al /boot
lrwxr-xr-x  1 root  wheel  13 Nov 11 21:06 /boot -> bootpool/boot
```


----------



## fitz (Nov 24, 2014)

wblock@ said:


> echo "kern.vty=vt" >> /boot/loader.conf





wblock@ said:


> That will enable the vt(4) console so it can be seen after X is started.



Please could you explain this statement (kern.vty=vt) a little more so that I can try it more in the future?

Many thanks for your help.


----------



## wblock@ (Nov 24, 2014)

Click vt(4) to see the web page.  vt(4) is a console that supports graphics mode for use with KMS video drivers.  FreeBSD 10.1 has both vt(4) and the older sc(4).  sc(4) is still the default, and shows only a black screen after X has been started.

kern.vty=vt just selects the new vt(4) as the one to use.


----------



## fitz (Nov 24, 2014)

Thank you wblock@.

I am hooked, what a fantastic OS!


----------



## fitz (Nov 25, 2014)

I am now getting a console thanks!

Also, it is reporting that:


```
VT: Replacing driver "vga" with new "fb"
```

Please could you let me know about this 'error'?

I'm presuming that I can edit xorg.conf to deal with this - but just want to check first, as, when the tty console access went last time, I had to rebuild.

Many thanks.


----------



## wblock@ (Nov 25, 2014)

As far as I know, it's just a status message.  No changes are needed.


----------



## fitz (Nov 25, 2014)

Thank you.


----------

