Skip to main content

Connect to Raspberry Pi via VNC

Server side (Raspberry Pi running Raspbian)

Install tightvnc:

# apt-get install tightvncserver

Launch tightvnc with:

$ tightvncserver

It will ask you for a password and then show something like this:

New 'X' desktop is raspberrypi:1

Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/raspberrypi:1.log

Note the raspberrypi:1.

Client side (my laptop running Arch Linux)

Install tightvnc:

# pacman -S tightvnc

Connect to your Raspberry Pi with (adapt your ip address):

$ vncviewer 192.168.1.4:1

Configure pacman

Auto-completion

For advanced completion, install the bash-completion package:

# pacman -S bash-completion

The "command not found" hook

Install pkgfile:

# pacman -S pkgfile

Then update the database with:

# pkgfile --update

Note: didn't work for me.

Add color output

EDIT: the following trick is not needed anymore since pacman (>= 4.1) now supports color output.

Install pacman-color from AUR.

Backup the original pacman executable:

# mv /usr/bin/pacman /usr/bin/pacman.bak

Make a symlink from pacman to pacman-color:

# ln -s /usr/bin/pacman-color /usr/bin/pacman

Syslinux: change bootup resolution

To know which resolutions are supported by your screen, install hwinfo:

# pacman -S hwinfo

Then execute:

# hwinfo --vbe | grep 'Mode '

Modes are displayed in hexadecimal.

Now edit /boot/syslinux/syslinux.cfg and add to the APPEND line the desired resolution with:

vga=<resolution>

where <resolution> is the corresponding hexa code.

For example: add vga=0x037f if you want 1920x1080x24.

Configure i3bar and VPN pid

In this case, I use the privatvpn script, which install the OpenVPN client.

Replace the command line in /usr/bin/privatvpn with:

/usr/sbin/openvpn --config /etc/openvpn/privatvpn.conf --writepid /var/run/openvpn.pid

Then point the .pid file in ~/.i3status.conf, in run_watch VPN:

pidfile = "/var/run/openvpn.pid"

Configure NTP

Install ntp:

# pacman -S ntp

Add the following lines in /etc/ntp.conf:

server 0.be.pool.ntp.org iburst
server 1.be.pool.ntp.org iburst
server 2.be.pool.ntp.org iburst
server 3.be.pool.ntp.org iburst

Enable ntpd at startup:

# systemctl enable ntpd