Can't get Unity to find VSCode. Unity showing /usr/sbin rather than /usr/bin

Linux newbie here trying to migrate Unity from Windows to Linux (Pop OS). I’m having problems getting VSCode to work with Unity. I’ve loaded VS code a number of different ways (debian & flatpack via the Pop OS store as well as from the official VS Code web page located here Visual Studio Code and Unity), added the Unity extension to VS Code, and in each case can run VS Code stand alone with no errors. The code is located at /usr/bin/code. Unity has the Visual Studio Editor installed (2.0.22). The Visual Studio Code Editor package is not installed. I’ve tested this on both 2021 LTS and 2022 LTS versions of the Unity editor.

The trouble comes when I try to link Unity to VS Code. Going to Preferences/External Tools, Unity only shows the generic Visual Studio Code entry. Trying to browse and navigating to /usr/bin/ actually brings up the contents of /usr/sbin/ which doesn’t have “code”. Therefore, I can’t link VS Code to Unity. Interestingly, using the “Show In File Browser” button the the Unity Hub and navigating to /usr/bin/ shows the actual contents including “code”.

Any sudo the voodoo that you do so well would be much appreciated.

You need it. Install it. That should fix your problem.

Also If you install VS Code with flatpak then it might not be detected by Unity. Hopefully this problem should be fixed soon but until then you should install VS Code with the official package. If your VS Code is installed in /usr/bin then it should be good.

ChiwTheNeko, thanks for your kind and quick response.

Sadly, I tried adding the Visual Studio Code Editor package and it still didn’t work. I’m using the VS Code installed from the page linked above (not FlatPak). I think that’s the “official” package. BTW, that page has the following comment "Note: The Visual Studio Code Editor package published by Unity is a legacy package from Unity that is not maintained anymore." ???

Thinking about a fresh install of Pop OS as a next step…

WTF? Just a few weeks ago I talked with a Unity dev on this forum about fixing it so that it detect Flatpak installs of VS Code. And it isn’t maintained anymore?

Anyway, I’m not sure I understand what your problem is exactly. You said you get the VS Code option when you go into Preferences → External Tools. So what is the problem then?

Okay, I finally got it to run (Unity to find VS Code in Preferences/External Tools). To recap, on Pop OS, regardless of what VS Code I downloaded, Unity was steadfastly refusing to locate VS code at /usr/bin/code or anywhere else.

Solution: Deleted Unity Hub, which I had installed via the Pop OS store, and loaded it directly off the Unity site. I also avoided both versions of VS Code available on the Pop OS store and loaded VS Code from here…

…using it’s recommended link here…

…to download the .deb version.

This worked on Unity editor 2022.3.11f1 with Visual Studio Editor v2.0.21 installed. Additionally, I note that Visual Studio Code Editor 1.2.5 is also installed (included in the Engineering package).

And I was so looking forward to switching over to Godot!

Thanks for the help, ChiwTheNeko.

The sentence means the new package is now developed by microsoft for unity, https://discussions.unity.com/t/925353 , which is called “visual studio editor” instead of the old name “visual studio code editor”. Last time i managed to submit a patch for this package to microsoft and they took it.

We’re in this together bud. I’m on Fedora 38 and the old method was working for me but upon an update EVEN with Visual Studio Editor enabled, I only get the generic “Visual Studio Code”. I tried building from the VS Code directly from the site but all to no avail.

Things seem to be getting tougher for anyone considering Game Dev on Linux.

What else did you expect to get? What’s not working?