Make Backtrack 5 automatically login and start X

This is a quick tip on getting backtrack 5 to automatically login as root and startx which will run the graphical interface. There is a disclaimer though as this method does work but isn’t exactly secure. Then again, if you are using Backtrack, you probably know that already :)

First step is to install rungetty

aptitude install rungetty

Next we have to edit /etc/init/tty1.conf

nano /etc/init/tty1.conf

use the arrow keys to move down to the last line and add a “#” before the line “exec /sbin/getty -8 38400 tty1” so it looks like so

#exec /sbin/getty -8 38400 tty1

Once that is done, add the following line which will automatically login as root

exec /sbin/rungetty tty1 --autologin root

Press CTRL+X an enter to save and close nano

Next, you need to set the .bash_profile for the root user to automatically run startx which starts your graphical interface

nano /root/.bash_profile

Add the following to this file


CTRL+X to save and close

Reboot your BT5 install and there you go. Obviously, going back to the above warning, this isn’t recommended for any machines that could fall into the wrong hands or if you store data on your BT5 install. Personally, I have a proxmox cluster that runs BT5 and this makes it easier to get to the console without logging in constantly, I have just have to start the VM and then vnc to the console.