VMware Virtual Appliances Community
samwyse
Enthusiast
Enthusiast

Stupid inittab tricks

If you aren't using X11, and if your primary user interface is via a web browser, create a script called /root/msg:

#!/bin/sh

stty noecho

while true

do

clear

for i in 1 2 3 4 5 6 7 8 9

do

echo

done

echo " This virtual machine should only be accessed via"

echo " a web browser directed to the following URL:"

echo

echo -n " "

ifconfig eth0|sed -n -e 's=inet addr:=http://=' -e 's=Bcast.*==p'

read

done

Next, in /etc/inittab, remove the standard getty for console 1 and replace it with this:

1:2345:respawn:/root/msg >/dev/tty1 </dev/tty1

Lastly, "kill -HUP 1" to get init to re-read /etc/inittab, then use "ps" to get the PID of the current getty and kill it.

Ta-da! Instant user-friendliness!

0 Kudos
0 Replies