Visual Studio Code comes to Raspberry Pi

Microsoft’s Visual Studio Code is an excellent C development environment, and now it’s an easy install on Raspberry Pi. Here’s Jim Bennett from Microsoft to show you all how to get VS Code up and running on our tiny computer. Take it away, Jim…

There are a few products in the tech sphere that get me really excited. One of them is Raspberry Pi (obviously), and the other is Visual Studio Code or VS Code. I always hoped that the two would come together one day — and now, to my great pleasure, they have!

VS Code is a free, open source developer text editor originally released for Windows, macOS and x64 Linux. Out of the box it supports generic text editing and git source code control, as well as full web development with JavaScript, TypeScript and Node.js, with debugging, intellisense and all the goodness you’d expect from a full-featured IDE. What makes it super powerful is extensions — bringing a huge range of programming languages, developer tools and other capabilities.

For example my VS Code setup includes a Python extension so I can code and debug in Python, a set of Microsoft Azure extensions so I can manage my cloud services, PlatformIO to allow me to program micro-controllers like Arduino boards coupled with a C++ extension to support coding in C and C++, and even some Docker support. Not a bad setup for a completely free developer tool.

Jim’s Raspberry Pi 400 running VS Code

I’ve been hoping for years VS Code would come to Raspberry Pi, and finally it’s here. As well as supporting Debian Linux on x64, there are now builds for ARM and ARM64 – both of which can run on Raspberry Pi OS (the ARM build on Raspberry Pi OS, the ARM64 on the beta of the 64-bit Raspberry Pi OS). And yes — I am writing this right now on a Raspberry Pi 400 running VS Code!

Why am I so excited about this?

Well, there are a couple of reasons.

Firstly, it brings an exceptional developer tool to Raspberry Pi. There are already some great editors, but nothing of the calibre of VS Code. I can take my $35 computer, plug it into a keyboard and mouse, connect a monitor and a TV and code in a wide range of languages from the same place.

I see kids learning Python at school using one tool, then learning web development in an after-school coding club with a different tool. They can now do both in the same application, reducing the cognitive load – they only have to learn one tool, one debugger, one setup. Combine this with the new Raspberry Pi 400 and you have an all-in-one solution to learning to code, reminiscent of my ZX Spectrum of decades ago, but so much more powerful.

The second reason is to me the most important — it allows kids to share the same development environment as their grown-ups. Imagine the joy of a 10-year-old coding Python using VS Code on their Raspberry Pi plugged into the family TV, then seeing their Mum working from home coding Python in exactly the same tool on her work laptop as part of her job as an AI engineer or data scientist. It also makes it easier when Mum has to inevitably help with unblocking the issues that always come up with learners.

As a young child it was mind-blowing when my Dad brought home a work PC so he could write reports and I could use it to write up my school work – I was using what Dad used at work, making me feel important. I see this with my seven-year-old daughter, seeing her excitement that I use Microsoft Teams for work, the same as she uses for her virtual schooling (she’s even offered to teach me how to use it if I get stuck). To be able to bring that unadulterated joy of using ‘grown-up tools’ to our young learners is priceless.

Installing VS Code

The great news is VS Code is now available as part of the Raspberry Pi OS apt packages. Launch the Raspberry Pi Terminal and run the following commands:

sudo apt update 
sudo apt install code -y

This will download and install VS Code. If you’ve got your hands on a Pico, then you may not even need to do this – VS Code is installed as part of the Pico setup from the Getting Started guide.

After installing VS Code, you can run it from the Programming folder in the Raspberry Pi menu.

Getting started with VS Code

VS Code may seem daunting at first – it’s a powerful tool with a huge range of extensions. The good news is Microsoft has you covered with lots of hands-on, self-guided learning guides on how to use it with different languages and development tools, from using Git version control, to developing web applications — there’s even a guide to learning Python basics with Wonder Woman.

Go grab it and happy coding!

Jim with his arms folded wearing a dark t shirt
There he is – that’s the real life Jim!

Brilliant Jim Bennett shares loads of Raspberry Pi builds and tutorials over on Expecting Someone Geekier and tweets @jimbobbennett. He also works in Developer Relations at Microsoft. You can learn pretty much everything there is to know about him on github.

134 comments

Avatar

VS Code is not open source. It is “Built on open source” but released under a proprietary license (https://code.visualstudio.com/license).

Avatar

If you want open source “vscode”, use vscodium!
They also have some ARMhl and ARM64 packages for quite some time now.
https://github.com/VSCodium/vscodium/

Avatar

All of the VScode source is available here. https://github.com/Microsoft/vscode. In my book (which might not be the same book as yours) that makes it open source.

Avatar

FYI open source has an actual definition: https://opensource.org/osd

And whilst the source code is indeed open source, the distributed binaries are not. They are based off the open source code but with additional code added (e.g. Microsoft telemetry services) and they are subject to a different (non-open-source) license, as one of the commentators above has already pointed out.

Avatar

Which is why I said “In my book”….

Avatar

You do not need to say “In my book” because your definition of open source is the same as everyone else’s. Your use of the phrase is just a red herring, trying to distract attention from your previous false statement “All of the VScode source is available here”

Thus you attempt to prove that VScode conforms to the real definition of open source — but your argument is based upon a lie.

Avatar

My definition of open source is pragmatic, not zealous.

Avatar

Then why do you feel the need to convince us that “All of the VScode source is available”?

Avatar

so ok, your smart. The fact is its free to use and thats all that matters in this context.

Avatar

you’re

Thank you

Avatar

For the future, but I understood what you were getting at!
https://www.slant.co/versus/3575/3579/~mit-license_vs_gplv2

Avatar

You’re absolutely right, VS Cod. it’s proprietary – and we should use Open Source programs, just because Microsoft doesn’t support Open Source, but nien continuously ataqua shouldn’t be let into Open Source projects.
Greetings and thanks.

Avatar

No. Not all of the source code is available in the vscode GitHub repo. One cannot build the VSCode that is installed with the PiOS package from just those sources. Which in my book classifies it as “not open source”. Far better to install vscodium or build the thing yourself, which is not so hard.

Having said that I love VSCode and don’t much worry about the situation re: using the MS build.

Avatar

The package is not available on raspbian stretch i believe.

Avatar

You need a fully update / full-upgrade Raspberry Pi Operating System.

Raspbian Stretch is well past its use by date.

Avatar

Are there any advice on how much RAM you need to have to get a good experience? I’ve not tried it on my 4GB Pi 4 yet but on my laptop (running Ubuntu LTS) with a bunch of Python and GitHub-centric extensions installed I find it’s a race between my web browser and VSCode as to which can consume all my RAM first. Will it run well on the older Pi hardware?

Avatar

Well, no wonder, VS code is an Electron app (i.e. a website taped to Chromium, pretending to be a real program).

Avatar

Yes, trying VSCode on a Raspberry Pi 4 4GB is possible and very quick, too.

Avatar

It is good to see this as another excellent option.
Thanks.

Avatar

If you program on multiple platforms — including Windows — VS Code seems a good way to go, especially after using Visual Studio since version 1. The issue of Open Code or not is moot as this is an EDITOR with endless extensions, that might be proprietary or not.
In the end, is this a tool that adds to our development universe: yes it is.

Avatar

Very useful and as soon as I get a moment I will install it and start configuring it. I’ve been using Qt creator for a while already, this will b a good addition and some real world IDE experience.

Avatar

You if you could just add in in the Recommended Software program you have built in to the OS, that would be even easy as nothing to remember. In the same way we add Mu and Thonny.

And sorry, but the Cognitive load just to learn VSCode and figure out how to do things it quite high compared to the likes of Thonny and Mu. Yes it’s feature (and more) rich, but it’s interface it not inviting. You sort of need to know what you are doing to understand it.
As someone that has tired (and can just use it) and seen people give up.

Avatar

I really like it if I can just use any old text editor. No need for color coded syntax or debugger. It would be nice if CLI instructions for compilation is available for all languages. It saves on computer specs requirements as well.
Not everyone has the smarts to use complicated IDE. So many tried and failed, as Ben noted. Do people forget that they are once beginners?

Avatar

I found pycharm even worse. I’m going to give code another try, though I expect I’ll migrate back to thonny as it’s so simple and easy to use and works well with my ESP modules as well as the Pico.

Avatar

Agreed, far too complicated. Why bother with this when you have Geany, Thonny, Blue java, etc. easy to learn and does most of everything you need. VS seems to be win10 orientated, and like win 10 crashes when you least expect it.

Avatar

Yes, i would definitely agree with that sentiment. Mallet to crack a nut comes to mind in this environment but a useful skill to acquire for budding techies.

Avatar

I really don’t like the fact that a Microsoft repo was added automatically to my Pi, I would prefer that RPi foundation had used VSCodium through the regular repos, and those who wanted MS binaries could add that repo on their own Pi.

I know it’s probably not the case, but it strongly gives the impression that MS bought the leadership on RPi foundation.

Avatar

I think vscode looks more open source then some of the other stuff that gets shipped with Rasbian. So in itself I don’t mind getting anothe closed source bit added.
But it would be cool if someone can choose a clean install that has no proprietary stuff included at all.
Just a thought, nothing fancy.

Avatar

I agree Raspberry should give users the choice of using an OS without the MS repo and other Proprietary software (looking at you wolfram)

Avatar

This is actually one of the most reasonable responses. Everyone who gets super jammed up about “closed source” repos being added probably are running a ton of proprietary drivers and don’t even realize. I get the FOSS philosophy but the Pi foundation is about education and learning to code. VS Code is a premier IDE and it’s completely free. Shipping this repo makes sense in line with the foundations mission.

Avatar

Sure, but make it optional. Since the foundation’s aim is to promote education and learning, for those that want the Microsoft repository instruction should be provided as to how to add it – and the trusted key. I certainly learnt a bit when I removed both from my PiOS. And I may well tweak my PiHole to make sure it can’t come back. Lest not forget Microsoft is the “M” in “MAGA FT”.

Avatar

I agree with you but I think that Raspberry should take into account that, while they are an educational organization, it’s the maker community who made the RPi famous and I see that most makers (myself included) support the FOSS philosophy and aren’t very happy with VSCode on RPi. So, while Raspberry targets education, it’s the makers that really use it.

P.S.: I know that VSCode isn’t the only proprietary component, but blobs and drivers are in the nonfree not the main component. Also VSCode could compromise user privacy.

Avatar

Yes. agreed absolutely

Avatar

One thing I like about a fresh install of Ubuntu 20.04, is that it puts the highly-user-friendly privacy controls right in front of the user’s face, **right upon first boot**. This makes for a very easy opt-out of any telemetry, etc. Privacy-lovers really dig a feature like this.

@Jim Bennet, since you work for Developer Relations for Microsoft, I wish to respectfully request, on behalf of the privacy-loving, and privacy-sensitive Linux community, that VS Code do the same sort of thing upon first launch of VS Code: **please similarly put those telemetry options right in front of the user’s face, facilitating a super-easy opt-out of any and all telemetry features, in a single click. Please don’t require the user go searching and hunting as to where to turn the telemetry off.**
Thank you, and good day.

Avatar

Proprietary soft with tracking included, eat or get silenced.

Avatar

+1. Your comment and my reply should be removed soon so that there remains no evidence anyone is bothered by this.

Avatar

Hardly worth pointing out, but if you don’t like it, you really don’t need to use it. Using it is YOUR choice. We are just pointing out you can use it should you so desire.

Avatar

I wonder what will happen when they find out uf2 is a Microsoft thing too.

Avatar

Not really. You silently added Microsoft’s repo to everybody’s install of Raspbian. Now at the very least Microsoft gets a ping from every user who runs apt update and at worst can put up fake packages.
All without the user doing anything to consent of even having a choice.

Avatar

I hope for your sake you are using proton mail, duck duck go and Firefox. That you exclusively use a VPN with your own DNS resolution and that you exclusively use FOSS. Otherwise this comment could be construed as contrarian.

Avatar

Exactly. By including the Microsoft repository in the Raspberry Pi OS the company has additional telemetry to track users of the Pi, which it can aggragate with use of Bing, Edge, Skype, Office 365 and now VSCode. Privacy is one of the main reasons open source is popular. Hence VSCodium exists. Capice?

Avatar

The trouble with this logic is that the act of doing an upgrade (pings rasbian servers) or downloading a new raspbian version is consent. If you log into Facebook, you consent to their terms, that’s the nature of something made my someone else. You don’t want to consent to their terms, make your own operating system. That’s to much effort? Well then consent or don’t use a computer.

Avatar

Except that every time you apt update it pings Microsoft repo, allowing them to build a profile of raspberry pi users if they so wish.

Avatar

Just use VS Codium if you’re that paranoid.

Avatar

Caring for your privacy isn’t paranoid. Some people called as paranoid when we said that MS compromises user privacy, but we were right as Edward Snowden showed us. There are many reasons to worry about MS and their handling of Personal Data.

Avatar

I see a lot of misinformation in this article. You should know that vscode is not open-source nor free software. While the source code is distributed under MIT License the binaries here aren’t completely open-source because of the proprietary telemetry. This leads to the other problem of vscode: telemetry. I believe that it greatly compromises user privacy if Microsoft (who has a history in compromising our privacy, remember PRISM in 2013) knows every customization in my editor and even recording the keystrokes when you write code.
In addition having the microsoft gpg keys in rpi-os makes every ms repo trusted which greatly compromises user privacy.
Also I think that it is wrong for RP Foundation to put a nonfree text-editor in the main component (it should be in ‘nonfree’) and not even notify the users of this change (The repo was added before this post). All in all I believe that the Foundation should let users know of this change, because the community is what made RPi what it is today.
This made me lose trust to the foundation.
I am leaving RPi OS for an OS and a foundation that cares for the community’s privacy.

P.S: If you want a text-editor for Pico you can use VSCodium which lacks telemetry.

Avatar

Any easy way to opt-out for this feature, and also avoiding having a Microsoft repo added ?

Avatar

Sometimes I really don’t understand some comments.
Indeed, it’s a good thing to promote full open source softwares.
VSCode is really a great IDE. It may doesn’t promote full open source by itself, but should allow access for more developers, to make softwares.
Don’t forget it’s just a tool, feel free to use it or not, to make open source code with it or proprietary. Freedom is important here.

Avatar

How about privacy: freedom _from_ data collection by Microsoft?

Or the new, deliberately proprietary Python Language Server—sounds like an attempt at lock-in.

Avatar

I don’t really have a problem with them including the repo for VS Code or with people using it. However, this article says “VS Code is a free, open source developer text editor” which is untrue. It is not “open source”.

Avatar

It does seem that some folks don’t care about privacy until Microsoft are involved. Perfectly happy to let telemetry go to any number of big tech raptors, but mention Microsoft and people suddenly become sanctimonious.
In order not to be hypocritical, we need to consider many other areas of our lives where there is telemetry building profiles.

Avatar

It’s not just the fact that the software has telemetry, but the fact that they now know every time a machine runs apt update, the fact that the repo AND it’s key were added silently and forcefully, and that it’s This specific software. Why not for example docker repo? Or any other repository with popular developer software? Why the lack of transparency?

Avatar

They know every time a machine runs apt-update in the same way that you know that a grain of sand moves when you see the wind shifting a dune.

Avatar

That’s a really silly remark Anders. If only there was a unique identifier to a grain of sand which is sent along a packet over the internet… One can’t help but wonder how do those packets know where they come from and where they’re going.

Avatar

Do you imagine there are geeks in Microsoft watching your unique ID and every time you apt-update they are all high fiving each other and shouting “HEY John’s just updated again!”.

In fact, it’s just a stat in a billion stats, they all get rolled up into a analysis chart which shows MS execs how things are going. A measurement of a massive aggregration. It’s our extreme conceit-cum-paranoia to think that they are interested in us as individuals.

Avatar

No Anders, I don’t know what they do with that information. And neither do you.

Avatar

It (the repository and the key) should be optional. If they add this repo today who’s to say they won’t continue to add repos? What is the criteria? Why this specific repo? And why not just announce it rather than silently shove it down our throats?
It just feels incredibly shady.

Avatar

vscode is not free open source software (foss). there is probably no problem that children or newbies in programming can use convenient learning tools, but for everyone else, using proprietary software can be a negative factor when choosing an operating system. few people want to get used to a tool that in the future may be subjected to the EEE strategy from Microsoft. IE browser, silverscript platform, nokia are examples of this.

Avatar

It doesn’t matter to me if it is really “open” source or not. I don’t have any expertise to peek in the source code and understand if the source code is real or not.
I admit that I want free (as in beer) software, not “free as in freedom” software. If it comes compiled, better. And it comes from a somewhat reliable source.
Ah, but someone can say that Microsoft isn’t a reliable source? Maybe. But I’m a part-time Windows user, too, so, it will not be the first time that I’m using software from this vendor.
People like to complain.
It’s nice that this software is available to RPi and I praise the Foundation for adding the repository to my sources.list.

Avatar

This is a poor move on the foundations part, it undermines all the good they have done making IT in schools about learning to writing code rather than using MS products. There is no need for such an IDE to teach coding, all it will do is make the MS way, the only way children expect to code. This is just like the years of forced use of other MS tools, now means most children and young adults equate writing documements to exclusive use of MS tools. MS want this to be the same for software. Exclusive use of one suppliers tools is not preparing people for the workplace, its conditioning. I wont even mention the awful way this has been introduced, breaking the trust I gave to the foundation to provide software on my PI devices.

Avatar

It’s an excellent IDE to teach coding. It offers GIT integration, it’s flexible for language and compiler and it is likely to be encountered in the real world of career coding. It’s also increasing on Uni Computer Science undergrad courses.

Avatar

Ah, paranoia!
Having lived through the days when Microsoft behaved as an ethically challenged organization (I am being politically correct here, many of my older wizard friends would have called MS a criminal conspiracy, at times with considerable justice) I fully sympathize with those who express discomfort, if not outright nausea, at the inclusion of VS Code in the previously (relatively) ‘pure’ Raspberry Pi project. However, I observe that the current leadership of MS has changed course radically, embracing open source projects and making major contributions to the ecosystem. Admittedly this is business realpolitick–MS management realized it could not beat FOSSH and thus decided to join it–but I believe us wizards must accept, as we have with the involvement of IBM (also once unethical in its behavior), that cooperation, collaboration, and mutual support are much better than promoting (as IBM and MS used to) fear, uncertainty and doubt. As for the telemetry–if MS wants to know who is using this clearly valuable new tool, why not let them.
In passing, I note the very real possibility that future versions of Windows (an OS that mostly works, but occasionally irritates the heck out of us wizards) may well be based on the Linux kernel. Having said that, I also note that, with current hardware technology now bouncing off the upper limit of what may be achieved with Silicon based technology, that it may be time to revisit the whole topic of operating system design and implementation, particularly in view of what might be achieved through use of (older) concepts of I/O channeling and synchronous but coordinated execution. Yes, at times what was old becomes new again….

Avatar

We as a society do not forgive individuals with criminal records who did the crime even after they have done the time. We take away their rights, such as gun ownership, access to the job market and the right to vote. For some offenses, such as sex offenses they are required to register. We never forgive these criminals even after they’ve reformed.
Microsoft has been convicted of crimes as well. See http://techrights.org/2020/01/08/microsoft-criminality/ for example. Lives and businesses have been destroyed along the way. Why forgive Microsoft just because Satja Nadella says his company is now in love with Linux? Many do not forgive.
This whole business is very sad. IMHO the individuals that work at Microsoft are honest, skilled, caring hard workers, a credit to their communities. But somehow the beast that is Microsoft does not reflect this. So we see the Raspberry Pi foundation putting a Microsoft repository into the OS and people react negatively, as they should. Which is really too bad because VSCode is tecnically a very nice tool.

Avatar

For me, the issue isn’t making VS Code available, it’s the forcing it on my systems, it’s the telemetry that I did not agree to, it’s the fact that this was done silently.

Well, the cat is out of the bag, so the saying goes and now the trust in Raspian has been compromised.

Avatar

Does it now run on Raspberry PI Zero?
I found it useful when first debugging prototypes on the Zero on the bench to be able to have the GUI loaded and have all the windows on the same screen without needing a whole other machine to SSH in but found lack of support for the same VS Code I was using on the Mac and Windows to be a pain. So I ended up with a Pi 4 to do the prototyping and debugging and then verifying on a (headless) Zero to finalize.

Avatar

Such a shame! You injected a repo in your uses computers without telling them, and denied anyone commented on how this is privacy-invasion and now announcing it like you conquered Mars. This blog post should’ve been an apology to your users for not informing them in advance about your action as well as giving them the option to turn it on for the current users, even if you decide to default it to on for new users.

Avatar

Since Raspberrypi is explicitly targetting kids, I think it’s a big moral fault to expose them to the Microsoft’s telemetry and spying. Every time a Raspbian device is updated it will ping a Microsoft server. Microsoft is gonna empower its footprint database quality to track people on the net.
Using https://vscodium.com/ would have been a better choice.

Avatar

You mean the kids are are using XBOX, MS Windows on Intel PC, and Android phones?

Avatar

No Xboxes or Windows in this household. That is what the Pi is for to provide a more educational alternative for the kids to spend their time on which they love. As for phones, after making sure to only buy ones that are listed on LineageOS those get re-flashed immediately to run a completely open source system.

Avatar

But it’s not all about you Henry.

Avatar

This is awesome news! Now all I need is a version of Cura that works with the pi, and I’ll never have to open a laptop again for all my 3d printing needs!

Avatar

A very welcome addition: great opportunity for kids to get a head start.
VS Code is widely utilized in the tech industry from full-on DEVs to IT teams and everybody in between.

Avatar

There’s been an ARM version of VS Code since at least April 2020 last year when I compiled my Asteroids game on a Pi and blogged about it (see https://learncgames.com/building-asteroids-on-a-raspberry-pi/). I got that VS Code from the site code.headmelted.com but when I just checked it no longer exists. I suspect after the official Microsoft ARM version appeared there was no further need for it. Thanks to Jay Rodgers who built it. I found it from a post by Scott Hanselman in February 2020. https://www.hanselman.com/blog/how-to-install-visual-studio-code-on-a-raspberry-pi-4-in-minutes

Avatar

Hi David,
Just want to say that your book is an excellent tutorial for SDL2 programming. I’m surprised that it’s not marketed as such. I hope that’s still true on your Raspi programming book, and that you give some thought about it.
Also, I wonder if Raspi Zero is in your radar, because that is what I’m using most of the time. I’m not too hopeful since you’re using VSCode, but at least give it a consideration for those of us who code on the go, and need to go as small/light as possible, including power supply.
I bought your ebook today. Thank you and have a nice day!

Avatar

Do you have python code along with the kits ?

Avatar

Please revert this change. Please allow the VSCode repository package and GPG key to be *optionally* installed by those who want it, rather than force-installing it to everyone without consent. I do not wish to send any third-party any additional information about myself or my systems than what they already collect.

Avatar

As Raspberry Pi is mostly targeting children, it is disgusting at best to let microsoft track them. Vscodium would have been much better choice!

Avatar

Word!

Avatar

That would be children who are using XBox probably outnumber children using Pi by an order of magnitude.
Disgusing to let them use Xbox.

Avatar

“Disgusing to let them use Xbox” I agree with you Anders, but not to the extent of using such a strong word as ‘disgusing’ ;) ! From an educational point of view it is much more useful to invest in Rasperry Pi and some HATs. What I loved in the Raspberry Pi Foundation was the spirit of teaching kids what is inside the ‘black box’. I am sure that they will use this as a great learning opportunity for kids and explain what is under discussion. This will empower them and help them acknowledge different and subtle ways data is collected and sent, regardless of the intention. :)

Avatar

“With a great power comes great responsibility”

Looks like some one @ raspberry Pi foundation forget about it and start making decision for their users. Even on headless machine they pushed this telemetry machine which CAN NOT run there.

History is repeated: https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish

Very disappointed, going to remove Raspberry Pi OS in our tech school.

Avatar

For some reason I get this error today.
E: Unable to locate package code

Avatar

You need to fully update Raspberry Pi Operating System:
sudo apt update
sudo apt full-upgrade

Avatar

I do not mind proprietary software. What I DO have problems with are any software and companies tracking me, especially without stating up front or providing any easy way to disable all tracking. I will not install, use or promote such software. Windows 10 was the last straw. Having to answer a 100 different questions about what private information to deny BEFORE even getting to the desktop is very annoying. But on top of that, after answering NO to all the questions, there are still many services like Windows Defender for which there is no easy way to disable it or prevent it from sending “suspicous” files to Microsoft.

Therefore on a Linux operating system I expect more control over such settings. For non-free software that I decide myself to install I am used to instructions specifying how to download a deb file or being provided steps along the lines of:
sudo add-apt-repository repository_url
sudo apt update
sudo apt instal package_name

So finding out that Rasberry OS will now automatically add a repo for a vendor known to step on the privary rights of users, for software I will not be installing, is very alarming! This may have been unintential on the part of the Pi Foundation with their trusting nature, but many users do not give Microsoft that benefit (look no further than Windows or Office or IE for why). I do not know if this will mean it will be soon necessary to migrate over to Debian proper on the Pi if this continues.

Avatar

This does not disable the “telemetry” sent by Raspberry Pi OS to Microsoft when `sudo apt update` happens. Plus there is no guarantee that these telemetry settings don’t revert back to the “on” state after an update. Or that a new telemetry item is crafted that defaults to “on” after an update to keep the telemetry flowing. This is a cat and mouse game. There should be just one switch to turn it all off. Permantly. Like macOS does. Like Linux does. Capice? We don’t have that. We have MSFT’s dismal past behavior hanging over the entire industry. Satja Nadella posturing that he loves Linux has the foul stench of desperation and hypocrisy about it. That is why all the negative comments. And they are not going away.

Avatar

VS Code is great, I use it on all my development machines. What is NOT great is silently adding the repo and the gpg key *even on RasPiOS Lite*. Lite has no desktop! I have about 10 Zeros with RasPiOS Lite doing various stuff and now, whenever I update, they all have to ping Microsoft for absolutely no reason. Well, no reason to me…

Please inform us how to best reverse this in a way that is both permanent and will not break future updates.

Avatar

I am happy with this choice.
you worry about telemetry but maybe you use Alexa, Google, vacuum cleaner robots and many other devices that use telemetry and do not expect it.
Let the users choose, if you don’t want vs code don’t install it.
I want it to work with rpi instead.
good life

Avatar

Easy step to follow. I don’t face any problem. Thank’s for the information.

Avatar

To all those who don’t want to use vscode just remove the link.
sudo rm /etc/apt/sources.list.d/vscode.list

Avatar

So my Raspberry Pi 400 doesn’t have the Microsoft repositories included. I can’t just ‘sudo apt-get install code -y” and have it actually install. You might need to update the article to included either grabbing it from git, or to edit the config to include the microsoft repositories.

Avatar

You need to fully update Raspberry Pi Operating System:
sudo apt update
sudo apt full-upgrade

Avatar

Tried to install VS on my Raspberry Pi4 4GB but when I typed “sudo apt install code -y” in terminal it just says “E: Unable to locate package code”.

Avatar

I’m sure this will get ignored but could Jim Bennett kindly tell us what extensions they use? When I try to follow C coding in VS Code guides, there are half a dozen extensions that people install. By some random person and no source. So it would be nice to hear from a Microsoft official, thanks.

Avatar

I use the Microsoft C/C++ extension:

https://code.visualstudio.com/docs/languages/cpp

It works perfectly for me. I also couple it with PlatformIO for embedded development:

https://platformio.org

PlatformIO is dependent on the Microsoft C/C++ extension, so installing PlatformIO installs the C/C++ extension by default.

Avatar

Hmm..I tried that about four months ago on Linux/Mac and I kept getting errors. Tried again today and runs fine.

Thanks for the reply!

Avatar

It is time to use another Linux distribution.

Avatar

Children, teachers and hobbyists alike will follow the foundations documentation to get the Pico up and running.

Many of them have no real choice because they do not have the time nor the skills to deviate from this path.

Their trust in the foundation’s integrity is part of the “installation requirements”.

I am very disappointed to see Microsoft running telemetry in schools and homes supported by the foundation.

I for myself fight tracking whereever I can using VPN, Tor and letsencrypt.
I encrypt my email whenever the receiver provides me with a public key.
I use ad blockers. I use duck duck go instead of google.
I delete my browsers history and cookies on every shutdown of the browser.
I prefer firefox over chrome.
I use Signal instead of WhatsApp whenever my contact is reachable via Signal.
And so on and on and on…

Very often my struggle to prevent data from beeing gathered in hazardous amounts may be far from perfect,
but this is no excuse for the foundation to give in.

Avatar

Gosh, what a heated comments section. Personally I’m very glad to be able to use the same code editor on Pi that I use everywhere else so I’m very glad of the addition.
For those who worry about it not being entirely open source, well, it’s an interesting point, but then as I understand it the VideoCore stuff that underlies the Pi itslef isn’t open source either so it kinda comes with the teritory.
With regard to Microsoft’s attempt to track everything I do, for me, with my Android phone and Windows PCs, that’s a world I’m already in, though I do take some precautions to reduce nuisance adevertising etc. If you don’t like having the repository on your machine just remove the .list file in /etc/apt/sources.list.d. I kind of agree that maybe it should have been more optional. So, Raspberry Pi Foundation, why not remove the repository .list file from the standard images then add a ‘code’ stub programme in the usual raspbian repository that puts up a warning and, if accepted, adds the Microsoft repository and installs ‘code’ proper from that, then people can make an informed choice about it up front and your installation instructions remain the same. It would seem like a lot more sensible option and save folks throwing out their teddies in disgust.

Avatar

If you have the skills to install VSCode on your other platforms then you have the skills to install it on your Pi and as a VOLUNTARY option. It is not FOSS and should not be there by stealth in this way.

Avatar

I’m not sure I’d classify installing Code on other platforms as requiring skill! It’s a download and a double-click install. It used to need some skill to install it on a Pi, which is why I like that it has been made significantly easier. BUT, I do agree with you that it should have been made voluntary, which is why I say there should be a stub programme in the main repository that gives you a warning that, if accepted, then adds the MS repository and installs Code for you from that. When it comes to stealth non-FOSS software, the VideoCore firmware which allows Linux to talk to the hardware is non-FOSS and has been since day one, so there has always been non-FOSS software on every Pi. I believe Mathematica is also non-FOSS and is in the main repository. So I’m really not sure FOSS/non-FOSS is part of the problem, but I can understand that many regard Microsoft’s not-quite-open-source, sneaky-telemetry approach with deep suspicion, hence why it should it be voluntary.

Avatar

VSCode is largely open source, it is even promoted as open source. Not for VideoCore or Mathematica, nobody claims that is FOSS.
Apparently Microsoft sneaks in proprietary code for telemetry and tracking and still promotes it like open source. Why doesn’t Microsoft offer a 100% open source install?
@Jim Bennet?

Avatar

Excellent news. Up till now been building my own version with various levels of failure. :D
As for all the moaners, I prefer to get on with my work than to worry if the lift (elevator) is open source or not. ;)

Avatar

“There are already some great editors, but nothing of the calibre of VS Code.”
I don’t think this is true. Vim and Emacs have been available on the Pi for a good while.

Avatar

Definitely will give it a try. I am an Atom user at work and on my laptops at home, but have messed around with VScode. I think I need a tutorial or two on how to use an IDE over a fancy text editor.

Avatar

Quite a few comments here saying to “just use vscodium”.
Well, I used it for ages for the stuff I do with PlatformIO. After an update to vscodium, I had to reinstall some extensions, one of which was PlatformIO. It could not be found!

I’m not 100% sure why, but I believe it was some terms and conditions of using Marketplace. Maybe on the side of vscodium, maybe on the PlatformIO side, regardless, vscodium was no longer an option for me.

I installed vscode and disabled the telemetry in the settings. Thete are two options to disable, just search for “telemetry”. Regardless, because I’m running PiHole, it blocks the telemetry destination anyway.

Vscodium, while great, might not be suitable for everyone given the “Marketplace” changes.

Cheers,
Norm.

Avatar

With so many other good text editors out there (Geany, Kate for example in the GUI world), I really see why we have to bring M$ VS baggage into the mix on the Linux side. Especially ‘pushing its use’ (which is how it comes across to me)…. Even on Windows we have Notepad++ in lew of using VS. I’ve used/use VS in the Windows world because I have too at work now and then, but I find it overly ‘complicated’ and slow to use compared to Notepad++. Especially, when in the Linux world, you can simply edit a source file with your favorite text editor, kick off ‘make’ from the command line, and (in this case) copy/paste the executable to the Pico. It just doesn’t get any easier for writing ‘C’ code (or Python). Nor does a text editor need much memory run.
Sometimes I think we over complicate what we are attempting to accomplish. But that’s just me :) .
BTW, I am kicking the wheels of a Pico from my Ubuntu 20.04 workstation . I haven’t used any of my RPIs for development as they run headless here and accessed via SSH. The process would be the same on the RPI, if you used a local monitor or setup a remote desktop with VNC of course.
I did test uploading a Pico from an RPI the other day using the command-line by using just ‘mount, cp, and umount’ for kicks. It works too. I was just a bit more involved, as I had to first sftp the Pico executable to the RPI first, and then ssh into the RPI. Using fdisk find the /dev/sd[x]1 device to mount before doing the copy.

FWIW, the best IDE I ever used was Borland’s Delphi/C++ IDE back when. That was a fast, intuitive, and productive environment.

Avatar

I fully understand why some people are excited about this. I really don’t care much one way or another except I was horrified to find my Pi pinging an M$ server. It would have been nice to have the option to opt in. That said, it’s silly easy to opt out.

sudo rm /etc/apt/sources.list.d/vscode.list
sudo rm /etc/apt/trusted.gpg.d/microsoft.gpg
sudo apt update
Just like that, problem solved.

Avatar

Thanks to Jeff Geerling I learned this news. My raspberry have unattended update active because I use it like vpn/dhcp and need latest security updates. I have immediately executed the commands that you suggested. Now I need to create a script to execute this steps in every new raspberry I will install. I am really angry about this choice made by the foundation. Why not choose VSCodium for this purpose?
I am really thinking to change linux distribution for my next installations. I hope they will remove this in the future because I think it is unfair to the community!

Avatar

64 bit Ubuntu works very well on the Pi 4. There are several other Linux distros that work as well but other than Ubuntu most of them have YouTube issues. For everything else though there are a lot of options.

Avatar

Removing the microsoft signing key doesn’t solve the larger problem. How did the key get there in the first place. The issue is that some people have expectations about who will get signing keys, and for what, as RPF can add new keys at will. If RPF cannot be trusted to do what is expected, then one has to remove any keys that might enable more keys to be installed.

Avatar

Great news! Thanks! It saves a lot of my time by developing on Rasp in java ;)

Avatar

this article would have been a good platform for the RPF to divuldge the microsoft repo. no i do not think it’s evil, but I think it’s existence and the good reasoning behind it’s existince should have been elaborated upon. it’s just a missed opportunity to demonstrate a bit of transparency. again, i don’t feel at all slighted by the inclusion of the ms repo for the benefit of vscode in rpios… but some do, so imo it’s just prudent to dedicate a few lines in the article to the subject.

Avatar

I could not believe it having just read this news here. But there it was vscode.list sitting on my Pi with Microsoft within. If I did not check here I never would know. Was anyone else aware of the ties between Raspberry Pi and Microsoft? Shocking to find this sudden new change. How is it possible Microsoft have forced to give preferential treatment and have to link them in the OS like this now for all Pis.

Avatar

Microsoft doesn’t have preferential treatment more than any other non installed applications that have a repo link. I don’t think you’ve thought too hard about this subject:

https://arstechnica.com/gadgets/2021/02/raspberry-pi-os-added-a-microsoft-repo-no-its-not-an-evil-secret/

Avatar

All those pointing out that adding the repo is harmless like this article are missing the point. The main issue is the moral aspect of remotely exerting a change without any prior knowledge to a personal device one bought and already set up in a specific way. This is the first time this has occurred for a repo that was not from Raspberrypi.

However forget for a moment that it was microsoft.com repo. To illustrate the point, change the repo to an x-rated site or to nazi.com that had been pushed instead. Even though they are still harmless based on the same reasons being given, there would have been no question to people objecting.

Obviously there would still be those who would not care, but wanting to be associated with x-rated.com is a personal preference. That being the case for x-rated.com, there is no argument for any other repo as well. Especially for a repo that had never been there before. If a Microsoft repo had been added from the start of the Pi, then people would have upfront information to determine the position of the product. That is a choice then whether to purchase it in the first place, to install and back the Pi Foundation.

No one can argue that any choice was given here. Sure the Pi team can do whatever they want, but many were led to believe the Pi stood for user freedom since it had been stated the purpose of the Pi was to get away from closed restrictive platforms. This step is clearly not any freedom of choice for users. Any other technical details are irrelevant.

So this is disappointing, with all the time, money and praise given only to have this happen.

Avatar

Hopefully over time it will be possible to install PyCharm, IntelliJ IDEA and other JetBrains products.

Avatar

I installed Raspberry Pi Desktop (from https://www.raspberrypi.org/software/raspberry-pi-desktop/) into a Hyper-V VM.
I made all updates I read about: update during installation, apt full-upgrade, apt update.
But the installation of VS code (apt install code -y) always ends with:
“E: Package ‘code:amd64’ has not installation candidate”
Thanks for help in advance :)

Avatar

I guess maybe having a really nice obvious GUI option to give the end-user complete control and visibility to what repos are trusted and available on their system might be something to think about for future Pi OS versions. (Perhaps as part of the setup process)

Avatar

so why is it that when i follow your instructions i get “unable to locate package code” ??

Avatar

Ohh thank god I came across this. Now I can finally use my favourite text editor on my raspberry. In my opinion, it’s the most productive code editor that i’ve ever used. Cheers to the addition.

Avatar

Thanks. It is good to see this as another excellent option

Avatar

today I updated my raspis, and on each one I got this:

Setting up raspberrypi-sys-mods (20210310) …
Blocking vscode repo…
Removing obsolete conffile /etc/apt/preferences.d/3rd_parties.pref …

what does that mean exactly? Has the Foundation made a change to the vscode situation?

Avatar

This is a good thing! I intend to use VS Code with platformio extension running on Raspberry Pi to flash ESP-based sensors for smart home and training materials. However, I was using a Pi3 and VS Code seemed just fine, but I was unable to load the Anaconda environment (no binary available there), and I was using VNC to access the Pi from my normal Win10 laptop and external monitor… I know, layers upon layers, but a real use case. I couldn’t get it to work well enough to use. ditched it on the Pi3 and intend to swap back the Pi3 for my Home Assistant Server and allocate that Pi4 to the Pi-based VS Code & PlatformIO development / flashing / training environment. Hopefully the Pi4 HW is beefy enough to run this sufficiently well! Thank you for the blog on this topic.

Avatar

Microsoft doesn’t have preferential treatment more than any other non installed applications that have a repo link. I don’t think you’ve thought too hard about this subject:

https://arstechnica.com/gadgets/2021/02/raspberry-pi-os-added-a-microsoft-repo-no-its-not-an-evil-secret/




Avatar

Open Source or not Open Source , who cares
VS Code on the Pi , this is all that matters .
Thanks for the article :-)

Avatar

I can finally use my favourite text editor on my raspberry. In my opinion, it’s the most productive code editor that i’ve ever used. Cheers to the addition.

Avatar

Visual Studio Code is officially distributed via the Raspberry Pi OS (previously called Raspbian) APT repository, in both 32-bit and 64-bit variants.

Avatar

Sorry if this is a stupid question, but if I open VS Code from a Remote Desktop Connection, VS Code opens on the main display, but not in the RDC window. Any way to change this ? BTW – using Raspian buster with Raspberry Pi 4. Thanks.

Avatar

Jim! Thank you! I’ve used Visual Studio for C, C++ for over 30 years. I then got into hardware again with Arduino’s. Simple apps. Suffered and tolerated Arduino “IDE”. Got into IP. Now, two weeks ago, I decided the best microcontroller for a new project is the Pi. Big surprise – just discovered the amazing recent Pi 4. I hoped to use a good IDE again, especially if done interactively on the product. Therefore –> beautiful, oh so elegant, Python. Now, I find that you facilitated using all three together just last week with this very article! I can tell my team members we have state-of-the-art hardware, software, and software development system. Now all I need to do is unlearn my Source-Safe and use whatever is integrated into VStudio. Experience really counts. Thank you, again! – Mitch (MIT ’73 EE Comp.Sci)

Avatar

I really excited to use it, I am using it since February and it’s awesome and user-friendly code editor i have used ever.

Avatar

I’ve been using Thonny (Editor) for Raspberry Pi for 1 year, I’ve installed Microsoft’s Visual Studio Code, let’s see how it change the overall experience. Thanks for the information.

Avatar

Visual Studio Code is officially distributed via the Raspberry Pi OS (previously called Raspbian) APT repository, in both 32-bit and 64-bit variants.

Avatar

I’ve used Visual Studio for C, C++ for over 30 years. I then got into hardware again with Arduino’s. Simple apps. Suffered and tolerated Arduino “IDE”. Got into IP. Now, two weeks ago, I decided the best microcontroller for a new project is the Pi.

Leave a Comment

Comments are closed