Changing the Screen Resolution for Raspberry Pi in Debian Wheezy

The Raspberry Pi has two video outputs, an HDMI output and some stanky old component composite video output that you would expect to see on the back of an old VCR. Using the HDMI output on a newer LCD screen will result in an amazingly crisp image that is quite impossible to read unless you are sitting directly in front of it as though it is a monitor, which is a great way to look ridiculous while simultaneously hurting your eyes. Why not enjoy your TV while sitting on a comfy sofa, and not with your face a couple feet in front of it?

After a vigorous 20 minutes of searching on how to change the font size and eating some toast, I got a bit bored with the lack of results and flavor, respectively. This made me start looking at how to change the resolution which landed a few results for booting with Grub and passing the resolution parameters that way, but I’m not terribly keen on installing grub to require more time during the 30 second boot. Getting no immediate satisfaction from the internet answers, I decided to look around Debian Wheezy until I came across the /boot/config.txt file, which allows you to change the resolution from there.
You’re going to have to access the file as root, so do a little

sudo nano /boot/config.txt

to open the file in nano.
Inside of the file, there are a few lines commented out with hashes that read


Uncomment those, or add a few new ones below.

PROTIP: By careful when trying to add a hash symbol to the file, since it will likely end up being a pound symbol. Raspberry Pi is made by British people who don’t use American keyboards (those savages), so the default keyboard layout is different. The hash symbol is the forward back slash key. I am assuming that everyone reading this blog is American because as an American, everything is by default American, which is a very delightful American trait which I am certain that you enjoy immensely.
You can change the keyboard layout, memory split, and setup ssh access by entering the following command;

sudo raspi-config

Next, reboot by either yanking the power cord out of the damn thing and plugging it back in, or by gracefully entering

sudo shutdown -r now

into your console.

1024 by 700 is a decent resolution, but still a bit difficult to read on a 37 inch screen from 2 meters away.

A width of 800 makes things slightly easier to read from across the room.

A width of 480 transports you back to a magical time when text was huge and fonts were ugly.

UPDATE: 2015-12-26
Since writing this, the Raspberry Pi’s documentation has improved greatly. To see a full listing of what is possible with the config.txt file, please check out Raspberry Pi’s documentation.

30 thoughts on “Changing the Screen Resolution for Raspberry Pi in Debian Wheezy

  1. Ah-ha, an American who knows the difference between the hash symbol and the pound symbol – excellent!!

    PS. You might be surprised how refreshing it is for a Brit to find something where you install a program, and it complains that the default is enGB, not enUS… (-:

  2. It took me far too long to find out how to do something as simple as this.
    I was trying to code on a 50 inch plasma screen while on a recliner. At 1080p, it was bloody impossible

    • That haggard keyboard was once great. It’s a Logitech G14 keyboard with the faceplate and little LCD screen removed.
      At some point in time, it got possessed by ghosts or something, because it would think that CTRL+A, CTRL+S, and CTRL+D were being held down at random intervals. There wasn’t anything wrong with the keys, so I pulled it apart to take a look at it, but I have no goddam idea what I am doing half of the time and just started undoing a lot of the ribbon cables in there until it was functional again. The particular ribbon cable that was causing the problem was the one that controlled the 18 function keys on the left of the keyboard.
      I never got around to putting it back together, thinking that I could use the LCD for some project with the Raspberry Pi.

      All things considered, it was a pretty decent keyboard for the couple of years it wasn’t controlling the A, S, and D keys.

  3. Not to be rude or anything but this doesn’t work on my board.

    A possible workaround is something like this.setfont /usr/share/consolefonts/Lat15-Terminus32x16.psf.gz

    I just need to google some larger fonts and set “/etc/default/console-setup” apparently.

    Nice blog though, especially like the url. 🙂

    • Thanks for the information!
      This was done on one of the earlier Model Bs that had 256 megs of RAM. Do you have a newer one?

  4. The “stanky old component video output” is actually “composite” video, “component” is a bit different. Also, it’s probably good you didn’t try to install grub on the Pi, I don’t think you would have gotten very far with that (the Pi has a funky boot strapping process that grub wouldn’t know what to do with).

    • Thanks for the post!
      Usually when I speak to people about that yellow plug for video, I just mumble the word quickly and hope that nobody notices that I don’t know the difference between “composite” and “component”. Writing “composnite” was out of the question, so I had to guess.
      If only there was some giant network of knowledge that I could have consulted.

  5. The backslash ‘\’ on a US keyboard is mapped to the hash symbol under GB mapping, not the forward slash ‘/’. Just sayin…

    • Thank you for pointing that out! This will probably help some folks, so I’m going to add it to the post.
      You’re awesome, just sayin….

  6. I am a Brit in the US, using a British Pi with a US keyboard that the Pi thinks is a UK keyboard.
    I am so confused.

  7. Oh, what I actually wanted to say was the resolution was driving me nuts. I had a perpetual black border around the screen.
    Tried several iterations of the config file and reboots, and even looking up some video settings for particular HDMI modes.
    Then I noticed the last half dozen rows of config.txt were adding overscan. So I hashed them out. Problem fixed.
    Must’ve taken me a fortnight. ps for the Brits – The locals have no idea what a fortnight is. I try to use it as often as possible in meetings at work. Causes mayhem 🙂

  8. it says i do not have permissions. i have tried changing permissions but it says i do not have permission, lol, and i dont know what to do because i have tried editig the config file. TIA

    • Let’s see if we can fix your issue!

      What user are you logging in as? Can that user run “sudo”? If that user cannot run “sudo”, let’s log in as root for the time being. Run “su” and enter the root password. This should fix things, but if it doesn’t, post the exact commands, error messages, and other important information and I can try to give more precise information.

      If you don’t want to do that and want to go hog wild in your system, follow the instructions below!
      If you are running “sudo” successfully as a user or logged in as root and you are still getting permission errors, run “ls -al /boot/config.txt”. If there is no “w” in the first 3 characters (if the output looks something like -r-x—— instead of -rwx——), then something is a little fucky (I think that the permissions were messed with) and we need will need to allow root the ability to write to that file. I *think* the file is owned by root by default, so the following command *should* work, but none of this has been confirmed. “chmod u+w /boot/config.txt”.

      Hope this all helps.

  9. I’m not sure that you’re really an American, despite your professing of the same, since you use a distance measurement of meters.

    To any normal America, “meter” is what he’s going to do after work, at the bar, with the girlfriend.

    And, thanks.

  10. “I am assuming that everyone reading this blog is American because as an American, everything is by default American, which is a very delightful American trait which I am certain that you enjoy immensely.”

    Why would this be relevant? Pride, race and competition are merely antropocentric abstractions and also clear signs of emotional immaturity :-).

    • It was to point out that the default language is English, but the default keyboard layout isn’t ANSI.

      This was demonstrated using a bit of self-deprecating humor mixed with sarcasm.

      I didn’t mean to confuse and upset you to the point of feeling the need to comment 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *