Difference between revisions of "RaspberryPi-VNC"
Smaldonado (talk | contribs) (Reclassified under Category:Avionics) |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
== Getting Started == <!--T:3--> | == Getting Started == <!--T:3--> | ||
<!--T:4--> | <!--T:4--> | ||
− | # Ensure that SSH is enabled on the Pi. This is the default out of the box setting. You can verify the setting by typing <code> raspi-config</code> into terminal and navigating to ssh | + | # Ensure that SSH is enabled on the Pi. This is the default out of the box setting. You can verify the setting by typing <code> raspi-config</code> into terminal and navigating to ssh >> enable |
# Download a VNC server program. If you are using a MAC and don't have an external monitor/keyboard/mouse handy, you can wait to set this up after you've established an SSH connection to the Pi. You can also try installing a VNC server program via SSH on Windows but I can't guarantee that it will work (I'm not sure how internet sharing works in Windows). From the Pi's terminal type <code> sudo apt-get update</code> and then <code>sudo apt-get install tightvncserver</code>. You will be prompted to confirm installation by typing <code>Y</code>. | # Download a VNC server program. If you are using a MAC and don't have an external monitor/keyboard/mouse handy, you can wait to set this up after you've established an SSH connection to the Pi. You can also try installing a VNC server program via SSH on Windows but I can't guarantee that it will work (I'm not sure how internet sharing works in Windows). From the Pi's terminal type <code> sudo apt-get update</code> and then <code>sudo apt-get install tightvncserver</code>. You will be prompted to confirm installation by typing <code>Y</code>. | ||
# Power off the pi and connect it to your laptop with the ethernet cable. | # Power off the pi and connect it to your laptop with the ethernet cable. | ||
Line 17: | Line 17: | ||
== SSH for MAC/Linux == <!--T:5--> | == SSH for MAC/Linux == <!--T:5--> | ||
# Congratulations on owning a MAC. Ensure that the ethernet cable is securely connected between your computer and the Raspberry Pi. | # Congratulations on owning a MAC. Ensure that the ethernet cable is securely connected between your computer and the Raspberry Pi. | ||
− | # Enable internet sharing by navigating to | + | # Enable internet sharing by navigating to System Preferences >> Sharing and turn Internet Sharing on for your Thunderbolt or USB ethernet connection. |
# Plug in the wall power adapter into the Raspberry Pi, and then plug it into the wall to turn the power on. The Raspberry Pi will take a minute to boot up. | # Plug in the wall power adapter into the Raspberry Pi, and then plug it into the wall to turn the power on. The Raspberry Pi will take a minute to boot up. | ||
− | # Open terminal and SSH to the Pi with <code> ssh pi@raspberrypi.local</code>. If you're getting a host or timeout error, the Pi probably hasn't finished booting up yet. If all lights on the Pi are flashing indicating a full boot up but you're still not able to SSH, make sure SSH is enabled and type in <code>arp -a</code> to view your network cache. The Pi should appear as a <code>198.162.-.-</code> IP address. | + | # Open terminal and SSH to the Pi with <code> ssh pi@raspberrypi.local</code>. If you're getting a host or timeout error, the Pi probably hasn't finished booting up yet. If all lights on the Pi are flashing indicating a full boot up but you're still not able to SSH, make sure SSH is enabled and type in <code>arp -a</code> to view your network cache. The Pi should appear as a <code>198.162.-.-</code> IP address. Try using this IP to connect with <code>ssh pi@<IP ADDRESS></code> |
# You’ll be prompted to verify you’re trying to login to the Raspberry Pi. Type “yes” and press return. Type the password, which is “raspberry” and press return. Boom! You’re logged into your Raspberry Pi. | # You’ll be prompted to verify you’re trying to login to the Raspberry Pi. Type “yes” and press return. Type the password, which is “raspberry” and press return. Boom! You’re logged into your Raspberry Pi. | ||
Line 30: | Line 30: | ||
== Setting up VNC == <!--T:7--> | == Setting up VNC == <!--T:7--> | ||
− | # We now need to run the VNC Server, so enter the following command into your SSH window: <code> vncserver :1</code>. If you haven't downloaded the VNC server application, follow step 2 of Getting Started. If you're using Windows, I can't guarantee that | + | # We now need to run the VNC Server, so enter the following command into your SSH window: <code> vncserver :1</code>. If you haven't downloaded the VNC server application, follow step 2 of Getting Started. If you're using Windows, I can't guarantee that <code> tightvncserver</code> will download over your SSH connection. You may need to connect the Pi to an external monitor/keyboard/mouse to install the application. |
# If this is the first time you've started the VNC server, you will be prompted to enter and confirm a password. It would make sense to use “raspberry” for this, but passwords are limited to 8 characters, so I use “raspberr”. Note that this is the password that you will need to use to connect to the Raspberry Pi remotely. You will also be asked if you want to create a separate “read-only” password – say no. | # If this is the first time you've started the VNC server, you will be prompted to enter and confirm a password. It would make sense to use “raspberry” for this, but passwords are limited to 8 characters, so I use “raspberr”. Note that this is the password that you will need to use to connect to the Raspberry Pi remotely. You will also be asked if you want to create a separate “read-only” password – say no. | ||
− | # The VNC server is now running | + | # The VNC server is now running! We can attempt to connect to it, but first we must switch to the computer from which we want to control the Pi. Open the VNC viewer you downloaded earlier and enter <code>raspberrypi.local:1</code> for the VNC Server. Leave the Encryption at the default setting and click Connect. Ignore the warning and enter the password you created earlier ("raspberr"). |
# The VNC window itself should appear. You're all set! | # The VNC window itself should appear. You're all set! | ||
[[Category:Avionics]] | [[Category:Avionics]] |
Latest revision as of 05:07, 31 December 2015
Hate having to plug in the Raspberry Pi to an external monitor and keyboard/mouse? This guide will let you set up a remote session on the Pi directly from your laptop. You'll be able to view and interact with the Pi desktop with just an ethernet cable.
Hardware
If your computer has an RJ45 ethernet port, all you need is an ethernet cable! Notebooks without this port will need an adapter (ie. thunderbolt to ethernet or USB 2.0/3.0/C to ethernet). Note that the MacBook Pro will require a thunderbolt to ethernet adapter -- USB to ethernet will only work on the MacBook Air.
Software
Connecting to the Raspberry Pi via SSH will require an SSH client application (ie. the Unix terminal in OSX). If you're using a Windows machine, you'll have to download PuTTY from http://www.greenend.org.uk.
Windows, MAC, and Linux machines will all require a VNC viewer program. RealVNC is known to work with the Raspberry Pi VNC server, it can be downloaded from http://www.realvnc.com/download/vnc/latest/. Download the package file and open it. During the setup you'll be offered a choice of the type of installation. Deselect VNC Server, because you only want VNC Viewer. Click Continue and go ahead with the rest of the installation.
Getting Started
- Ensure that SSH is enabled on the Pi. This is the default out of the box setting. You can verify the setting by typing
raspi-config
into terminal and navigating to ssh >> enable - Download a VNC server program. If you are using a MAC and don't have an external monitor/keyboard/mouse handy, you can wait to set this up after you've established an SSH connection to the Pi. You can also try installing a VNC server program via SSH on Windows but I can't guarantee that it will work (I'm not sure how internet sharing works in Windows). From the Pi's terminal type
sudo apt-get update
and thensudo apt-get install tightvncserver
. You will be prompted to confirm installation by typingY
. - Power off the pi and connect it to your laptop with the ethernet cable.
SSH for MAC/Linux
- Congratulations on owning a MAC. Ensure that the ethernet cable is securely connected between your computer and the Raspberry Pi.
- Enable internet sharing by navigating to System Preferences >> Sharing and turn Internet Sharing on for your Thunderbolt or USB ethernet connection.
- Plug in the wall power adapter into the Raspberry Pi, and then plug it into the wall to turn the power on. The Raspberry Pi will take a minute to boot up.
- Open terminal and SSH to the Pi with
ssh pi@raspberrypi.local
. If you're getting a host or timeout error, the Pi probably hasn't finished booting up yet. If all lights on the Pi are flashing indicating a full boot up but you're still not able to SSH, make sure SSH is enabled and type inarp -a
to view your network cache. The Pi should appear as a198.162.-.-
IP address. Try using this IP to connect withssh pi@<IP ADDRESS>
- You’ll be prompted to verify you’re trying to login to the Raspberry Pi. Type “yes” and press return. Type the password, which is “raspberry” and press return. Boom! You’re logged into your Raspberry Pi.
SSH for Windows
- Buy a Mac. If that doesn't work, ensure the ethernet cable is securely connected between your computer and the Raspberry Pi.
- Plug in the wall power adapter into the Raspberry Pi, and then plug it into the wall to turn the power on. The Raspberry Pi will take a minute to boot up.
- On your computer, open Putty and enter the Host Name as
raspberrypi.local
and press open. - If everything goes according to plan, you’ll be prompted with a security prompt. Press “Yes”
- This will open a terminal and ask for a Username and Password. The username is “pi” and the password is “raspberry“. After entering the credentials, you’ll get logged on to the Raspberry Pi terminal.
Setting up VNC
- We now need to run the VNC Server, so enter the following command into your SSH window:
vncserver :1
. If you haven't downloaded the VNC server application, follow step 2 of Getting Started. If you're using Windows, I can't guarantee thattightvncserver
will download over your SSH connection. You may need to connect the Pi to an external monitor/keyboard/mouse to install the application. - If this is the first time you've started the VNC server, you will be prompted to enter and confirm a password. It would make sense to use “raspberry” for this, but passwords are limited to 8 characters, so I use “raspberr”. Note that this is the password that you will need to use to connect to the Raspberry Pi remotely. You will also be asked if you want to create a separate “read-only” password – say no.
- The VNC server is now running! We can attempt to connect to it, but first we must switch to the computer from which we want to control the Pi. Open the VNC viewer you downloaded earlier and enter
raspberrypi.local:1
for the VNC Server. Leave the Encryption at the default setting and click Connect. Ignore the warning and enter the password you created earlier ("raspberr"). - The VNC window itself should appear. You're all set!