The Raspberry Pi is an awesome little computer that can feed either a composite video feed, or a HDMI output, however most of the time I want the thing headless, If you set up Rasbian the same way as I showed in the last guide then this will work for you:
A Video 🙂
Getting Terminal access (SSH)
- Turn Internet sharing on, sharing your connection from Wi-Fi, to Ethernet
- Plug your R-Pi Ethernet cable first, then power in and wait for a few moments (gives it time to boot).
- Open a terminal window and type
cat /private/var/db/dhcpd_leases
you will get back information regarding your Pi, including the ip address
- type
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected]{ip address}
- Now you are in the R-Pi you should run the Raspberry Pi configuration tool
sudo raspi-config
- Before doing anything else
sudo apt-get update sudo apt-upgrade
Getting VNC
- Type
sudo apt-get install tightvncserver
- Once you’re back at the Bash prompt you need to set up Tight VNC Server, so type
vncserver
and give it a password, unfortunately you can’t leave it blank 🙁 and when you have finished that type
vncserver :1
- Download Chicken (used to be Chicken of the VNC), Open and Run
- In the hostname type the ip address of your R-Pi, the display number you want to connect to (in our case 1), and the password from above.
Setting VNC up as a Demon (auto start)
- Install netatalk
sudo apt-get install netatalk
- Make a file in /etc/init.d:
sudo nano /etc/init.d/tightvncserver
with the following content:
### BEGIN INIT INFO # Provides: vncboot # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start VNC Server at boot time # Description: Start VNC Server at boot time. ### END INIT INFO #!/bin/bash # /etc/init.d/tightvncserver # # Carry out specific functions when asked to by the system USER=root HOME=/root export USER HOME case "$1" incase "$1" in start) su pi -c '/usr/bin/vncserver -geometry 1440x900' echo "Starting VNC server" ;; stop) pkill vncserver echo "VNC Server has been stopped (didn't double check though)" ;; *) echo "Usage: /etc/init.d/tightvncserver {start|stop}" exit 1 ;; esac exit 0
- Make the file executable using
sudo chmod +x tightvncserver
sudo update-rc.d tightvncserver defaults
- Create the avahi rfb service file
sudo nano /etc/avahi/services/rfb.service
and add this content:
<?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_rfb._tcp</type> <port>5901</port> </service> </service-group>
- To keep LXDE happy:
cp -rp /etc/xdg/lxpanel/profile/LXDE/* ~/.config/lxpanel/LXDE/