# How to stop GDM starting automatically at boot



## dalpets (Aug 16, 2019)

I have just installed Gnome with  11.2.  The system is configured to automatically start gdm on system boot.
I  didn't realize this & as a result i can't use sudo or make other system changes.
Could you tell me what code I would need to use to disable/remove the automatic feature. However, I can't see any way I could do this as there appears to be no available command line feature.
Thank You


----------



## badbrain (Aug 16, 2019)

dalpets said:


> I have just installed Gnome with  11.2.  The system is configured to automatically start gdm on system boot.
> I  didn't realize this & as a result i can't use sudo or make other system changes.
> Could you tell me what code I would need to use to disable/remove the automatic feature. However, I can't see any way I could do this as there appears to be no available command line feature.
> Thank You


What? On Gnome you should already have a Terminal emulator, why don't use it? I don't think Gnome started automatically too. Please show me the tutorial you use installed FreeBSD with Gnome. If it's a video on youtube they should already adjust rc.conf to start Gnome automatically.


----------



## dalpets (Aug 16, 2019)

Yes, I've found the terminal.
I used the Gnome instructions in the handbook at 5.7.1 (desktop environments).  I also installed the  xorg package & prefixed the /etc/rc.conf entries (dbus etc) with 'sysrc'


----------



## badbrain (Aug 16, 2019)

dalpets said:


> Yes, I've found the terminal.
> I used the Gnome instructions in the handbook at 5.7.1 (desktop environments).  I also installed the  xorg package & prefixed the /etc/rc.conf entries (dbus etc) with 'sysrc'


If you simply want to disable GDM and start Gnome manuallly via `startx` you should change `gdm_enable="YES"` to `gdm_enable="NO"`. If you also want to not loading Gnome related services you should also have `gnome_enable="YES`" changed to `gnome_enable="NO"`.


----------



## dalpets (Aug 16, 2019)

I can't do that as /etc/rc.conf is 'read only', given that I am in a non-root environment.


----------



## badbrain (Aug 16, 2019)

dalpets said:


> I can't do that as /etc/rc.conf is 'read only', given that I am in a non-root environment.


Use `su` to switch to root, then install `doas`, and create a /usr/local/etc/doas.conf. An example content of it:

```
permit keepenv nopass root as root
permit keepenv nopass [your_local_account_name_here] as root
```
Remember to have a newline at the end of the file. You should install `nano` or `joe` for a more user friendly command line text editor other than the default `vi` or `ee`. After already set up `doas`, type `exit` and test if you could `doas poweroff`. If it works since then you only have to add `doas` before the command you want to run as root.


----------



## dalpets (Aug 16, 2019)

Thanks. I'll give it a try.


----------



## dalpets (Aug 19, 2019)

I haven't installed doas yet but I am able to su to root. When I try to change permissions from read only with su I get the following reply. 

```
'root@FreeBSD:/home/brenton/bash # ./bashrc
./bashrc: Permission denied.'
```
Why can't I  access bashrc with su so that I an can save it? Do I definitely have to activate doas to do so?

Thanks.


----------



## SirDice (Aug 20, 2019)

You're trying to execute a script that's not executable, hence the permission denied. You typically _source_ the file, not execute it; `. ~/.bashrc`


----------



## badbrain (Aug 21, 2019)

Or he could just simply reboot and everything will be OK.


----------

