## ## This script will run the first time the virtual machine boots ## It is ran as root. ## ## before use: set LOCALE according to your preferences. ## ## use: called by vm.cfg ## ## ## background: http://www.wepoca.net/doc/drupal-lamp-virtual-server ## ## created by doka@wepoca.net ## 2009-02-15 ## www.wepoca.net ## echo "" echo "" echo "This script runs the first time the virtual machine boots" echo "" echo "1. Set locales and keyboad" # # give the opportunity to change the keyboard # change the next line according to your preferences. For English use LOCALE=en_US # LOCALE=hu_HU # # cat /usr/share/i18n/SUPPORTED | grep $LOCALE > /var/lib/locales/supported.d/local dpkg-reconfigure locales update-locale LANG=$LOCALE.UTF-8 # update & upgrade echo "" echo "2. Update and upgrade" apt-get update apt-get upgrade # Install openssh-server echo "" echo "3. Install openssh-server" apt-get install -qqy --force-yes openssh-server # clean up echo "" echo "4. Clean up" apt-get autoclean apt-get autoremove # display info for first login # # the first user from config file USER=`ls /home | grep -v 'lost+found'` # # actual IP IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'` # echo "" echo "" echo "Your virtual machine has been booted!" echo "Copy/paste next line into a terminal, and login to the new virtual machine!" echo "ssh $USER@$IP" echo ""