I thought I would keep my notes on my PI configurations, in case it helps anyone else.
Using the PI without a monitor
You can plug your Pi into the Network and your laptop USB for low power usage and use VNC and SSH, also this method frees up the USB ports from mouse and keyboard.
I am assuming you have already used the boot.rc file to enable SSH and managed to login to the PI over SSH, or are using the HDMI for initial interfacing with the PI.
Static IP Address
If your running your PI on the local LAN. Chances are the PI will be getting the same IP Address everytime you boot. However if you want to be sure that this is the case you can edit the following config file /etc/network/interfaces. You can use whatever text editor you wish to do this, but you must run it as sudo. Once you have opened the file complete the network information that relates to your network. Use the sample below for reference, but use your IP range, gateway etc. This will give your PI the same IP each time it boots. Note: make sure nothing else on the network has the same IP.
Code: Select all
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.1
Code: Select all
sudo /etc/init.d/network stop
sudo /etc/init.d/network start
Code: Select all
sudo reboot
Code: Select all
sudo apt-get install tightvncserver
Code: Select all
pi@raspberrypi:~$ vncserver
You will require a password to access your desktops.
Password:
Warning: password truncated to the length of 8.
Verify:
Would you like to enter a view-only password (y/n)? n
New 'X' desktop is raspberrypi:1
Creating default startup script /home/pi/.vnc/xstartup
Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/raspberrypi:1.log
Code: Select all
pi@raspberrypi:~$ cd /etc/init.d
pi@raspberrypi:/etc/init.d$ sudo vim tightvncserver
Code: Select all
#! /bin/sh
# /etc/init.d/tightvncserver
#
# Carry out specific functions when asked to by the system
case "$1" in
start)
su pi -c '/usr/bin/vncserver'
echo "Starting VNC server "
;;
stop)
pkill vncserver
echo "VNC Server has been stopped (didn't double check though)"
;;
*)
echo "Usage: /etc/init.d/blah {start|stop}"
exit 1
;;
esac
exit 0
Code: Select all
sudo chmod +x tightvncserver
Code: Select all
sudo pkill Xtightvncserver
Code: Select all
ps aux | grep vnc
Code: Select all
pi@raspberrypi:/etc/init.d$ sudo /etc/init.d/tightvncserver start
Code: Select all
New 'X' desktop is raspberrypi:1
Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/raspberrypi:1.log
e.g.
192.168.1.5:1