Posts: 31
Joined: Thu Sep 12, 2013 5:59 pm

Using a TV as Display

Fri Apr 08, 2016 6:08 am


I have connected my RPi to my HD TV through a HDMI cable and I have keyboard & mouse connected to RPi.

Because of this I need to sit very close to TV to work

So I use SSH (using putty) to login to the RPi and to do programming from my study desk This option does NOT work whenever there is some graphics as putty terminal does not support graphics.

So one option to solve this problem is use VNC sever.

However when I run a graphics program from putty I would like the output (graphics screen) to appear on my TV.

Is there a way to do this - by setting some environment variable like DISPLAY etc ? I would like to see the graphics output of TV and putty terminal for programming. I had done this in Linux terminals by setting the DISPLAY variable, here that does not seems to work - Can you help me


User avatar
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Using a TV as Display

Fri Apr 08, 2016 7:09 am

There are so many ways to do this (with and without the TV) that I am inclined to recommend (and attempt to influence you) to try using (controlling) your RPI remotely with only VNC over SSH... just get the TV out of the 'picture' pun intended.

I am assuming you have another computer workstation (whatever) like an iMac, or something similar (gnu+linux) or, god forbid, windows... ?

My Raspberry PIs (my three primary PIs B+ 2B and 3B) are running headless... meaning no keyboard, no monitor, and no mouse... tightvncserver is running on all three, and I access all three from my iMac (large flat panel LED monitor similar to your HDMI TV) using port forwarding --- that is, I connect to the tightvncservers on the PIs from the iMac over an SSH tunnel (very fast, encrypted, and most importantly concurrent... that is, all of my PIs are up on the iMac at the same time (I just mouse into the one I want) Again, none of my PIs are ever actually connected to a real monitor except for the first thirty minutes just to get them setup. From then on its vnc over ssh (and yes, this even works over my openvpn server to locations 'out there' when I take my show on the road... I have all of my RPIs with me 'virtually' via openvpn and vnc over ssh.

There is a problem here (I am loath to point out) and that is that the VNC instuctions for the RPI on this site are wrong, and I might add, also incomplete. In other words, following the instructions will leave you frustrated. There are on-line tutorials explaining how to get this accomplished, and I am in the process of writing up one of my own for this site, should they wish to use it.

I am using my PI 3B now, displayed on an iMac secondary flat panel, using vnc over ssh... and the PI is sitting out on the desk looking dashing in its Black Ice Zebra case from C4Labs... and the only wires attached to it is the power cord. (true story)

User avatar
Posts: 772
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Using a TV as Display

Fri Apr 08, 2016 7:14 am

Have a look here, it will be the same for Rasbian. ... pc-via-ssh
Can't find the thread you want? Try googling : YourSearchHere

Posts: 765
Joined: Mon Jan 07, 2013 9:11 am

Re: Using a TV as Display

Fri Apr 08, 2016 9:44 am

girish_kumar wrote:...
However when I run a graphics program from putty I would like the output (graphics screen) to appear on my TV.
Is there a way to do this.. Can you help me


In my case I use 2 displays connected to Rpi, but in your case, you can just pretend there's a second display, & output to HDMI only when you wish to display graphics or video output.

You achieve this by enabling Rpi's very useful DPI mode. Read:

viewtopic.php?f=91&t=94424&sid=b9557b66 ... 1142031329

for more information.

In your case, you don't need to buy any extra hardware. You simply edit


to contain these 3 lines:


The requisite VGA666 overlay will already be present in /boot/overlays

Now, when you reboot, as you have elected to use your non-existent VGA display as the primary screen, there will be no screen output from HDMI, so you will SSH into your Rpi as you do at present.

A quick test to show you this is all working is, via your SSH machine:

omxplayer --display 5 some-videofile.mp4

& your HDMI connected Tv will show the video.

(you can uise the BigBuckBunny.h264 file provided in the "hello_video" examples folder in Raspbian if you don't have a video file handy)

When I started to use 2 displays, I programatically entered the display number (0 for the default HDMI, 1 for the DPI connected display), into my test ptrograms, but later the Foundation provided a useful environment variable:

VC_DISPLAY=relevant-display-# your-application-name

to allow your graphics application to divert video output to a specific display device. Strangely, this variable mysteriously isn't working at the moment. I'll investigate...
It won't affect what you want to achieve, as it's just a convenience.


User avatar
Posts: 38489
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Using a TV as Display

Sat Apr 09, 2016 8:48 am

Have a look at x11vnc that will mirror your RPi desktop to a VNC session (some programs that write directly to a framebuffer may not work).

Or use the TV and gain some distance from your RPi with a wireless keyboard/mouse.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Posts: 31
Joined: Thu Sep 12, 2013 5:59 pm

Re: Using a TV as Display

Sun Apr 10, 2016 2:36 am

Thanks a lot for all your response, it was really useful

Posts: 602
Joined: Mon Mar 09, 2015 5:20 pm
Location: corby, england

Re: Using a TV as Display

Sun Apr 10, 2016 1:40 pm

I use a Logitech wireless keyboard and mouse, the Logitech unifying dongle works great with the pi
Q; How many Windows users does it take to fix a Linux problem??
A; Whats a Linux problem

Return to “General discussion”