microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.62k stars 277 forks source link

Please add support for FreeBSD #727

Open yzgyyang opened 5 years ago

yzgyyang commented 5 years ago

Can't connect to azure: unreachable or not Linux x86_64 (FreeBSD amd64 )

Since the Electron support is premature on FreeBSD, running vscode in my laptop and connect to my FreeBSD server seems to be a great solution. I'm looking forward to the support on FreeBSD platforms.

pjbates commented 4 years ago

+1

bobmagicii commented 4 years ago

+1

DavMig commented 4 years ago

Hello, is there an expected date for this ? thanks

zatarain commented 4 years ago

I don't think they will even consider it, unfortunately :(

nhooyr commented 4 years ago

code-server works on FreeBSD! It's VS Code but running in the browser instead of electron.

https://github.com/cdr/code-server#quick-install

mike-pt commented 4 years ago

Thanks and that sure helps, but remote vscode allows you to connect to several machines via ssh from the same place, now that there is port in freebsd seems to work fine and even code server works as you posted this shouldn't be hard to implement I imagine, its just a matter of getting prioritized, its one of the most voted features here so there is "demand" for it :) 🤞

bobmagicii commented 4 years ago

i will literally delete and remake a few cloud instances i made this past month once this gets settled. i had them all set up on freebsd it never even crossed my mind this would not work. so at the moment they are ubuntu.

a few people here seem to be confusing remote working upon freebsd and literally using vscode while sitting at a freebsd machine though.

zatarain commented 4 years ago

Does someone knows how can I actually clone the code of vscode-remote? So, I can try to add something by my self and then try to contribute.

nhooyr commented 4 years ago

Does someone knows how can I actually clone the code of vscode-remote? So, I can try to add something by my self and then try to contribute.

It's unfortunately closed source.

bobmagicii commented 4 years ago

Does someone knows how can I actually clone the code of vscode-remote? So, I can try to add something by my self and then try to contribute.

It's unfortunately closed source.

which is really interesting considering microsoft's recent pushes about things.

jonasnordlund commented 4 years ago

This was an unfortunate surprise and makes it difficult to work with NearlyFreeSpeech hosting. :-(

davidone commented 4 years ago

Any update on this?

ghost commented 4 years ago

+1

zatarain commented 4 years ago

Does someone knows how can I actually clone the code of vscode-remote? So, I can try to add something by my self and then try to contribute.

It's unfortunately closed source.

We are hopeless 😢

mike-pt commented 4 years ago

I must admit I'm a bit disappointed at Microsoft since this is so high voted here, and since vscode works on FreeBSD now there's really no excuse I think .... Its fine if they want to keep this part closed source, but considering how many people have requested this a least a word on if this planed or not would be nice..

zatarain commented 4 years ago

I'm too, but to be fair it's understandable. I mean, they started to offer support for Linux, I think they never said will start to be open for all *nix world, which is really sad unfortunately 😞

amit-nath commented 4 years ago

Please support for FreeBSD

Nexulo commented 4 years ago

+1

caio-vinicius commented 3 years ago

+1 for FreeBSD

pousterlus commented 3 years ago

👍

zouyonghao commented 3 years ago

Any update?

mike-pt commented 3 years ago

Sadly nope... It remains one of the most requests features though: https://github.com/Microsoft/vscode-remote-release/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc

I was truly hoping this would be in the roadmap at least since there's even a port for vscode itself, and code-server works in a FreeBSD host (https://github.com/cdr/code-server, this has been my workaround until eventually, Microsoft picks this up)

szporwolik commented 3 years ago

+1 for FreeBSD

yaazkal commented 3 years ago

I was truly hoping this would be in the roadmap at least since there's even a port for vscode itself, and code-server works in a FreeBSD host (https://github.com/cdr/code-server, this has been my workaround until eventually, Microsoft picks this up)

@mike-pt I've tried code-server on a jail some days ago. It just shows "Cannot reconnect. Please reload the window." over and over again. So no way to work with it. I'll appreciate if you can share your configuration so I can see if I'm able to run it on my jail. I'm Using FreeBSD 12.1p10

mike-pt commented 3 years ago

I haven't tried in a Jail yet, but I had issues in the host using yarn and npm worked (or the other way around ). I later had issue using search and replace and was able to find help on their GitHub. You might get faster help if you just open an issue there.

natalka1122 commented 3 years ago

+1 for FreeBSD.

ykla commented 3 years ago

+1 for FreeBSD.

36roentgen commented 3 years ago

+1 for FreeBSD.

fahadshery commented 3 years ago

+1 for FreeBSD. I am using MacOS to connect to FreeBSD Jail. I am can ssh into FreeBSD jail without any issues. However, when connecting via vscode I get this error:

[17:58:32.289] Log Level: 2
[17:58:32.291] remote-ssh@0.61.0
[17:58:32.291] darwin x64
[17:58:32.293] SSH Resolver called for "ssh-remote+ha_jail", attempt 1
[17:58:32.293] "remote.SSH.useLocalServer": true
[17:58:32.294] "remote.SSH.sshPath": undefined
[17:58:32.294] "remote.SSH.sshConfigurationFile": undefined
[17:58:32.294] "remote.SSH.useFlock": true
[17:58:32.294] "remote.SSH.lockfilesInTmp": false
[17:58:32.294] "remote.SSH.localServerDownload": auto
[17:58:32.295] "remote.SSH.remoteServerListenOnSocket": false
[17:58:32.295] "remote.SSH.showLoginTerminal": false
[17:58:32.295] "remote.SSH.maxReconnectionAttempts": 9007199254740991
[17:58:32.295] SSH Resolver called for host: ha_jail
[17:58:32.295] Setting up SSH remote "ha_jail"
[17:58:32.299] Acquiring local install lock: /var/folders/2s/jzqgfm0x5qddggpk0__qv2dh0000gn/T/vscode-remote-ssh-homeassistant_jail-install.lock
[17:58:32.313] Looking for existing server data file at /Users/Fahad/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-homeassistant_jail-e5a624b788d92b8d34d1392e4c4d9789406efe8f-0.61.0/data.json
[17:58:32.314] Using commit id "e5a624b788d92b8d34d1392e4c4d9789406efe8f" and quality "stable" for server
[17:58:32.318] Install and start server if needed
[17:58:32.325] Checking ssh with "ssh -V"
[17:58:32.334] > OpenSSH_8.1p1, LibreSSL 2.7.3

[17:58:32.337] askpass server listening on /var/folders/2s/jzqgfm0x5qddggpk0__qv2dh0000gn/T/vscode-ssh-askpass-6552e9c10564a38e60cfabc27fba2de6f5cd09e2.sock
[17:58:32.338] Spawning local server with {"ipcHandlePath":"/var/folders/2s/jzqgfm0x5qddggpk0__qv2dh0000gn/T/vscode-ssh-askpass-d4118b1aa570228a1c8100f53270c17224915774.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","55805","-o","ConnectTimeout=60","homeassistant_jail"],"dataFilePath":"/Users/Fahad/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-ha_jail-e5a624b788d92b8d34d1392e4c4d9789406efe8f-0.61.0/data.json"}
[17:58:32.338] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/Fahad/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/Fahad/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/2s/jzqgfm0x5qddggpk0__qv2dh0000gn/T/vscode-ssh-askpass-6552e9c10564a38e60cfabc27fba2de6f5cd09e2.sock"}
[17:58:32.341] Spawned 78295
[17:58:32.459] > local-server> Spawned ssh: 78296
[17:58:32.463] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[17:58:32.568] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:xpSFxeKEjm+pzDWop+2GRoWp+alaHqOSKxL31k0D3tE
[17:58:32.675] stderr> Authenticated to XXX.XXX.X.XXX ([XXX.XXX.X.XXX]:22).
[17:58:32.708] > Having trouble using fetch through a firewall? Try setting the environment
> variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details.
[17:58:32.709] > ready: 6c8849c640ca
[17:58:32.716] > FreeBSD 12.2-RC3 FreeBSD 12.2-RC3 7c4ec6ff02c(HEAD) TRUENAS 
[17:59:34.342] Terminating local server
[17:59:34.350] Resolver error: Error: Connecting with SSH timed out
    at Function.Timeout (/Users/Fahad/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/extension.js:1:82451)
    at Timeout._onTimeout (/Users/Fahad/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/extension.js:1:351807)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
[17:59:34.352] Local server exit: 15
[17:59:34.357] ------

thanks

grahamperrin commented 3 years ago

@jimboca and all, please don't use comments to up-vote. Instead, please use the up-vote feature of GitHub.

zheng8501 commented 3 years ago

+1 please support FreeBSD

dfr commented 3 years ago

+1

elovelan commented 3 years ago

This comment section reflects poorly on the FreeBSD community (i.e. we aren't willing to read the rules) emphasis mine:

If you find your issue already exists, make relevant comments and add your reaction. Use a reaction in place of a "+1" comment:

  • 👍 - upvote
  • 👎 - downvote

Also, all of these extraneous comments make it really hard to find helpful comments!

@Rob4226, @krowvin, @geunyul, @n0x32schneider, @arymkus, @dghiringhelli, @dpetrov, @luchoman08, @xcdr, @RocketSquirrel, @tkanjar, @hansinator, @cdsim, @guilhermedrud, @cwlin0416, @cookys, @jimying (4 comments???), @Rob4226, @chickenwing, @netops2devops, @eogloblin, @fedqx, @ohmantics, @dyeske, @cleoold, @alexseitsinger, @nkev, @thenicknash, @duartejbrito, @sh1dow3r, @shellqiqi, @sean0921, @isarantis, @Rabenda, @zeon-ua, @danniehansen, @zatarain, @leyang95, @kentippens, @mrschofield, @pjbates, @bobmagicii, @amit-nath, @maisen20, @madisonblue, @caio-vinicius, @yaazkal, @pousterlus, @xpader, @szporwolik, @tprelog, @natalka1122, @ykla, @36roentgen, @fahadshery, @csfreak, @zheng8501, @dfr please remove your comment(s) and 👍 the first comment if you haven't already.

Comments to help other users get cdr/code-server or similar solutions working (especially in a jail) would be more than welcome; especially since someone like @Chuxel may see them and push a similar solution in MS's private repo for this feature!

rob4226 commented 3 years ago

@elovelan btw I got cdr/code-server working in a jail no problem. Just use their install script after creating a jail with iocage It goes something like this (this is for an internal network, not facing the open internet. You'd need to secure it better):

pkg install py37-iocage
iocage create -r 13.0-RELEASE -n vscode boot=1 ip4_addr="vnet0|192.168.1.20/24" interfaces=vnet0:bridge0 vnet=1 allow_raw_sockets=1
iocage console vscode
pkg update
pkg install curl npm-node14
npm install -g code-server --unsafe-perm
curl -fsSL https://code-server.dev/install.sh | sh
vi ~/.config/code-server/config.yaml
# Change the below from:
bind-addr: 127.0.0.1:8080
# to (this will allow access on all network interfaces, instead of just localhost)
bind-addr: 0.0.0.0:8080
# take note of the password in this file then save and close with `shift ZZ`
# start up the vscode server
code-server > & /dev/null &
# Then access with http://192.168.1.20:8080  from another computer on your network!
# Enter the password from the `config.yaml` you noted eariler.

Some more things I want to do:

Here is my rc.d script that goes in usr/local/etc/rc.d

#!/bin/sh

# PROVIDE: code_server
# REQUIRE: NETWORKING DAEMON
# KEYWORD: shutdown

. /etc/rc.subr

name=code_server
rcvar="code_server_enable"

: ${code_server_enable:=no}

# Choose user
code_server_user=root
code_server_group=${code_server_user}

export PATH=/usr/local/bin:$PATH

# Uncomment to use open-vsx marketplace:
# export SERVICE_URL=https://open-vsx.org/vscode/gallery
# export ITEM_URL=https://open-vsx.org/vscode/item

# Choose directories
code_server_chdir="/root"
config_file="/root/.config/code-server/config.yaml"
user_data_dir="/root/.local/share/code-server"

command="/usr/local/bin/code-server"
command_args="--config ${config_file} --user-data-dir ${user_data_dir} > /dev/null 2>&1 &"
procname="node"

load_rc_config $name
run_rc_command "$1"

Now you can control code-server as a service: Enable at start up: service code_server enable Start service: service code_server start Stop service: service code_server stop Restart service: service code_server restart Status of service: service code_server status

I put it behind an Nginx reverse proxy with a self-signed TLS cert and I even got it to serve fonts locally like Fira Code!

I have to say, I am pleasantly surprised how well this works. If you use Chrome, after navigating to your servers URL, you can click the install button in the URL bar which creates an icon on your desktop, and makes it a full window. This makes it look and work exactly like the desktop version of Codium! I actually like it better than the remote ssh extension that we have been begging for lol.

EDIT 5/25/2021 I created a port as www/code-server and submitted it to FreeBSD. I also made a GitHub repo for it here: https://github.com/Rob4226/code-server-freebsd-port

davidchisnall commented 3 years ago

@Rob4226, would you be willing to submit a port containing that so that folks can install code-server as a package?

rob4226 commented 3 years ago

@Rob4226, would you be willing to submit a port containing that so that folks can install code-server as a package?

@davidchisnall Sure, that's a good idea. I'll work on one.

EDIT Ok I finished the port! I submitted it to FreeBSD as www/code-server and make a repo for it here: https://github.com/Rob4226/code-server-freebsd-port

xpader commented 3 years ago

Code-server is not full function like vscode-remote, alots of extensions can not install on code-server, Can microsoft consider to supporting FreeBSD? There seems to be no movement of this.

blindone0 commented 2 years ago

Please make it.

Linkoid01 commented 2 years ago

Very much interested in this.

da-tai commented 2 years ago

Learning Freebsd, would love this added

xpader commented 2 years ago

I hope fleet can running on freebsd now.

Nexulo commented 2 years ago

Really a pity that this is still not supported. So we can't upload via SFTP plugin over sftp but only over ftp and with this unencrypted connection I just don't have a secure feeling.

han-fastolfe commented 2 years ago

+1. I use FreeBSD servers everywhere.

frank716 commented 2 years ago

+1

DoLooP commented 2 years ago

+1

ohmantics commented 2 years ago

I tried again a few years later and not even the Remote-SSH plugin can target FreeBSD, which remains closed source. It's odd that the Azure team has gone out of their way to court FreeBSD users for their cloud, sponsoring FreeBSD conferences and such, but the tools folks at Microsoft seem to have their own priorities.

bobmagicii commented 2 years ago

folks at Microsoft seem to have their own priorities.

there is ok, there is another bug on the main repo where all people want is a button to clear the problems pane and its been years.

davidchisnall commented 2 years ago

I tried again a few years later and not even the Remote-SSH plugin can target FreeBSD, which remains closed source. It's odd that the Azure team has gone out of their way to court FreeBSD users for their cloud, sponsoring FreeBSD conferences and such, but the tools folks at Microsoft seem to have their own priorities.

Summarising the discussion from above (not speaking for the maintainers of this project):

There is no strong objection from the VS Code team to supporting FreeBSD but the way that the system is currently designed makes this very difficult due to external dependencies. Currently, VS Code does not provide plugins with an different interface between running things on the host and the remote system. Adding an abstraction layer to do that and porting existing plugins across would be a huge engineering effort. I'd imagine that you'd want to start by providing remote file access proxies and then gradually enlightening plugins to use explicit communication and that's a difficult problem (for example, should I run clangd or some other LSP server locally and require copying the entire source tree across the network to index, or should I run it remotely and require a big program on a system that might be a low-end embedded target?). To avoid this, the remote extension installs VS Code on the remote system and runs it headless, proxing commands, so any plugin that you have on your local system can be installed remotely and work there.

This means that the requirement for the remote extension to work on a given platform is the same as the requirement for VS Code to work on that platform. This brings us to the next set of problems:

VS Code uses Electron. Electron will support any platform that their dependencies run on but they are mostly a wrapper around Chromium and Node.js. Node.js works fine on FreeBSD, Chromium does not. Chromium is a Google project and they support only platforms that Google uses internally or sells products on (Android, iOS, macOS, Windows, desktop Linux, and Fuchsia). To make this worse, the Chromium project has explicitly refused to take patches to support FreeBSD, even with external volunteers maintaining them and providing CI infrastructure, so there is no obvious path to supporting FreeBSD in Chromium.

Neither the Electron team nor the VS Code team is willing to take on the effort of maintaining a fork of Chromium that supports FreeBSD. If you want VS Code to support FreeBSD then you should encourage Google to accept the FreeBSD patches for Chromium. Until they decide to, or an antitrust regulator forces them to, all downstream projects are blocked.

This issue has the second-highest number of thumb-up reactions of any issue on this repo, so it's likely that it would receive some attention if it were unblocked upstream.

dyeske commented 2 years ago

David Chisnall, so you are saying the blocker here is google and chromium. Can you share the patches that need to go upstream? I have maintained over 40 FreeBSD ports in the last 20 years. If we need to pull in some chromium bits and patch then as a vscode dependency we can probably do that. It wouldn't be the first time. Sometimes short solutions are required to get the long term solution completed. Feel free to contact me directly.

xpader commented 2 years ago

Look around files in .vscode-server folder on server, looks like there's no any file exists about chromium binary, only node and js files, base on this, looks like vscode-remote doesn't need Electron's features by itself, may be this is more of an architectural problem? I didn't view any vscode-remote codes, it's just my humble opinion.