Boot KALI Linux in console mode (command line) as it was in BackTrack

A good thing i like in BackTrack was it boot in console mode. It is quite helpful if we have to run few console commands instead of using full GUI.

But Kali linux directly boot into graphical mode. To make it boot into command line mode we need to remove auto start of xdm service (or kdm or gdm based on your desktop manager) from current runlevel.

To do it first we need to know current runlevel. Issue following command

$ who -r

Remember your current runlevel from output of previous command. Mine is 2.

We also need to know service name of display manager we are running, check it with following command (replace 2 with your run level)

$ chkconfig --list | grep '2:on'

It will list all services set to autostart for run level 2. Look here for entry similar to gdm or kdm or xdm etc. I am running gdm3.

Ok, now we have identified which service (gdm3 in my case) we have to turn off at which run level (mine is 2).

Now issue following command to stop gdm3 service for run level 2.

$ chkconfig --level 2 gdm3 off

Now on next boot it will boot into command line login. After login use startx command to start xsession.

Failsafe: If something went wrong or later you decided to boot again into graphical mode, revert it back with following

$ chkconfig --level 2 gdm3 on

Note: I do not remember if chkconfig is pre-installed with Kali or i installed it manually. In case it say ‘chconfig command not found’ then you can install it with following command

apt-get install chkconfig

That’s all. Happy pentesting with Kali linux 🙂

17 thoughts on “Boot KALI Linux in console mode (command line) as it was in BackTrack

  1. Hey, that’s great! It works pretty fine, don’t know why I couldn’t think of that! Had to google all the way until bumped into here. Thanx for saving me lots of time.

  2. There’s a new version of something or another now where this locks me out of the computer. The login screen still shows up and it fails to authenticate my login attempts.

  3. Pingback: Boot KALI Linux in command line mode | KTech Share

  4. No need for this just type $ sudo vi /etc/default/grub then comment that two: GRUB_CMDLINE_LINUX_DEFAULT=”quiet”
    GRUB_CMDLINE_LINUX=”initrd=/install/gtk/initrd.gz”
    And put this right above:
    GRUB_CMDLINE_LINUX=”text”

    Below where it says: # Uncomment to disable graphical terminal (grub-pc only)
    uncomment this:
    GRUB_TERMINAL=console

    EXTREMELLY SIMPLE, much better. No need for all that commands.

  5. No need for this just type $ sudo vi /etc/default/grub then comment that two: GRUB_CMDLINE_LINUX_DEFAULT=”quiet”
    GRUB_CMDLINE_LINUX=”initrd=/install/gtk/initrd.gz”
    And put this right above:
    GRUB_CMDLINE_LINUX=”text”

    Below where it says: # Uncomment to disable graphical terminal (grub-pc only)
    uncomment this:
    GRUB_TERMINAL=console

    EXTREMELLY SIMPLE, much better. No need for all this commands.

    • Ya, Without persistence you have to do it every time.
      Another option is, during boot, when grub menu appear, edit it (press e with that entry hilighted) and add ‘quiet’ parameter to grub cndline then boot. It will save you from making those changes and rebooting again.

  6. Yeah, I can’t get any of these to work either. The only thing I managed to change was the color scheme of the page where you select what to boot

  7. chkconfig is depreciated, and thus is no longer supported.
    So instead of using that install sysv-rc-conf
    Command `apt-get install sysv-rc-conf`
    and repeat the steps mentioned above the same way
    For example
    sysv-rc-conf –level 2 gdm3 off

  8. Hi there Kali napcakes c”,)

    To get Kali to boot into console mode:
    (useful on slow and bad hardware such as ARM Raspberry Pi)
    Just simply run the following commands:

    1: root@kali:~# systemctl get-default
    2: root@kali:~# systemctl set-default multi-user.target
    3: root@kali:~# sudo reboot

    After you reboot Kali will start in consol mode everytime after this.

    To revert these changes, all you have to do is use this command:

    root@kali:~# systemctl set-default graphical.target
    root@kali:~# sudo reboot

    After a reboot Kali will start normaly with GUI login screen everytime again.

    Good luck champ!
    /cheers

Leave a reply to samtech09 Cancel reply