Category: ubuntu

Aug 26 2012

To enable automatic start and stop of VirtualBox VM in Ubuntu do this…

Put this script into your /etc/init.d folder. give it a name without an extension…in this case start-stop-vbox-vm.

Give it execute permissions by running
sudo chmod +x /etc/init.d/start-stop-vbox-vm

then run this to enable auto start and stop…

sudo update-rc.d start-stop=vbox=vm defaults 99 01

###THE SCRIPT

### BEGIN INIT INFO
# Provides: start-stop-vbox-vm
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start vbox --headless at boot time.
# Description: Script will start VBOX VM at startup savestate for the VM at shutdown.
### END INIT INFO

#! /bin/sh
# /etc/init.d/start-stop-vbox-vm
#

#Edit these variables!
VMUSER="seths"
VMNAME="Win2003Server"

case "$1" in
start)
echo "Starting VirtualBox VM..."
sudo -H -b -u $VMUSER /usr/bin/VBoxManage startvm "$VMNAME" --type headless
;;
stop)
echo "Saving state of Virtualbox VM..."
sudo -H -u $VMUSER /usr/bin/VBoxManage controlvm "$VMNAME" savestate
;;
*)
echo "Usage: /etc/init.d/SpodeVM {start|stop}"
exit 1
;;
esac

exit 0

Aug 26 2012

To enable Remote Desktop to ubuntu

Just (all from the terminal)…

sudo apt-get install xrdp

That will download and start xrdp.

For it to work and show more than the background do this…
echo “gnome-session –session=ubuntu-2d” > .xsession

Then you need to restart the session…
To kill all xrdp sessions and restart do …
sudo /etc/init.d.xrdp restart

HT to blog.derakkilgo.com/2011/12/19/xrdp-is-great/

Seth

Nov 19 2011

To get postgresql running on ubuntu to listen for external connections I did this…

  1. From a terminal window run “sudo gedit” and type your password when prompted.  Gedit opens and you edit the conf files using it.
  2. Edit the file at /etc/postgresql/8.3/main/postgresql.conf and change
    listen_addresses='*'
    . This will enable TCPIP connections to the server.
  3. Edit the file at /etc/postgresql/8.3/main/pg_hba.conf and add the following line(s)
    host    all         all         192.168.0.0/16          trust
  4. This will allow tcpip connections (host) on any database (all) for any user (all) for CIDR-address 192.168.0 – any 16 high-level bits (192.168.0.0/16)  and authenticates anyone that can connect to the server-no pass (trust)
    See http://www.postgresql.org/docs/8.2/static/auth-pg-hba-conf.html for details
  5. Add any additional ip address ranges you need to that file
  6. From a new terminal window restart postgresql by typing the following command from a new terminal window…
    sudo /etc/init.d/postgresql-8.4 restart
    and type your password…if you setup the configuration correctly you should get an [OK] from the terminal.

I was also worried I would have to learn how to open up an ubuntu firewall but that was not needed.

This article helped me…

https://help.ubuntu.com/8.04/serverguide/C/postgresql.html

Seth