Skip to content

Use VS Code Remote Development w/o marketplace, update connectivity #15

Closed

Description

Is there anyway to get around this limitation "VS Code Server requires outbound HTTPS (port 443) connectivity to update.code.visualstudio.com and marketplace.visualstudio.com"?

To clarify: will this work if the local os and remote machine both have ssh connectivity to each other but no outbound connectivity?

Activity

  1. Chuxel commented on May 2, 2019

    @Chuxel
    Member

    Lester Cheng (@LesterCheng) Currently the machine you connect to needs to have outbound connectivity to both update.code.visualstudio.com and marketplace.visualstudio.com. These are used to acquire and update the "VS Code Server" and the extensions installed remotely. So, if I'm understanding correctly, I think the answer to your question is no.

  2. LesterCheng commented on May 2, 2019

    @LesterCheng
    Author

    Chuck Lantz (@Chuxel) is there any possibility of getting a packaged version of the "VS Code Server" that could be loaded onto the remote machine manually to avoid creating an outbound connection?

  3. kieferrm commented on May 2, 2019

    @kieferrm
    Member

    Lester Cheng (@LesterCheng) not at this time.

  4. LesterCheng commented on May 2, 2019

    @LesterCheng
    Author

    Kai Maetzel (@kieferrm) Understood, thanks! Any plans to introduce something like this? Otherwise this issue can be closed.

  5. Chuxel commented on May 2, 2019

    @Chuxel
    Member

    Lester Cheng (@LesterCheng) Beyond VS Code server, extensions are also installed on the remote host from the marketplace. We are in preview, so while we don't have specific plans, we are interested in understanding what people need to shape our direction.

    That said, our of curiosity, what is your use case? Is there anything in particular preventing you from getting out bound access that we should be aware of?

  6. LesterCheng commented on May 2, 2019

    @LesterCheng
    Author

    Chuck Lantz (@Chuxel) without getting into specifics, this is an enterprise environment where development is only done on remote machines which need to be ssh'd into. Neither the remote machine nor the local os (where you ssh from) have connectivity to outside connections. I'd be happy to continue this over email you if it would help. I think a similar scenario was mentioned in the blog announcing this release: "Because the code bases are so large, we see engineers at shops like Facebook (and Microsoft!) use editors like vim to work remotely against secure and powerful "developer VMs".

  7. changed the title [-]Offline Connectivity[/-] [+]Use VS Code Remote Development w/o marketplace, update connectivity[/+] on May 2, 2019
  8. added
    feature-request
    on May 2, 2019
  9. Chuxel commented on May 2, 2019

    @Chuxel
    Member

    Lester Cheng (@LesterCheng) Got it - interesting scenario. I changed the title and made it a feature request.

    Is this due to security requirements? Happy to interact via email - you can find my mail in my GH profile (but I won't paste it due to crawlers.)

  10. underchemist commented on May 3, 2019

    @underchemist

    Just tagging on to say that I am also developing in a remote environment where we don't have access to outside internet except for certain mirrored repositories like pypi.

  11. WSLUser commented on May 3, 2019

    @WSLUser

    I would like to add that I'm in the same situation as Sebastien Tremblay-Johnston (@underchemist). I will add supplement that with the caveat that my Windows VM can connect to the Internet to download extensions but in order to connect to the corporate network, I need to re-enable the VPN. The Linux server I develop on doesn't and will never have outside access. Everything is done using mirrored repos including PyPi as mentioned already. Basically I need extensions that I install locally to my VM to duplicate over to the server once I connect to it. A prompt that appears once it activates the ssh connection to the server asking if you would like to install and/or update the Linux extensions with a yes/no option to click on would be ideal. A status bar showing the transfer would great to see as well. This would be done through a sftp or scp session.

  12. added
    ssh
    on May 3, 2019
  13. lamnguyenx commented on May 4, 2019

    @lamnguyenx

    I'm on the same situation. At work I have to connect to a remote desktop before SSH to server. The remote desktop isn't allowed to access world wide web so I always have to install extensions from VSIX files.

    Recently, I've switched from VSCode + SSHFS combo to Code-Server, which runs on browser and offer Intellisense. However, it still messing up with browser's keyboard shortcuts, which is a nightmare.

    I'd really hope that you guy could build a standalone version soon!!

  14. soul4soul commented on May 6, 2019

    @soul4soul

    Similar situation. We have server machines that we can SSH to but they can't access the www. Our dev machines that we SSH from can access the www. It would be great to have an option to have the VSIX be downloaded on the dev machine and SCP'ed to the remote machine.

  15. jlugjb commented on May 7, 2019

    @jlugjb

    I also has the similar problem.
    manual solve, only for ssh mode

    step 1: download the vscode-server
    wget -nv -O vscode-server-linux-x64.tar.gz https://update.code.visualstudio.com/commit:daf71423252a707b8e396e8afa8102b717f8213b/server-linux-x64/insider

    step 2: copy vscode-server-linux-x64.tar.gz to direction /
    cp vscode-server-linux-x64.tar.gz /vscode-server-linux-x64.tar.gz

    step 3: modify C:\Users\administrator\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.35.0\out\extension.js
    search "wget -nv -O vscode-server-linux-x64.tar.gz https://update.code.visualstudio.com/commit:$COMMIT_ID/server-linux-x64/${t}"

    replace it with "cp /vscode-server-linux-x64.tar.gz ."

    then retry connected, it's ok.

  16. 69 remaining items

  17. WSLUser commented on Aug 22, 2019

    @WSLUser

    Jeremy Junac (@jjunac) FWIW, the error message I get when it attempts (and fails since I can't be connected to download server and connect to remote host) shows it only retries once. However my remote host runs Fedora so maybe your remote host has a different default timeout for ssh.

    roblourens

    The thing is, we publish a bunch of flavors of the server, and that number will grow, and they are large.

    What are those flavors based on? It really should just be rpm based, deb based, bsd/mac, and arm. None of these servers should have a dependency on systemd and should be agnostic as possible. I would expect Ubuntu and Debian for example to work with the same exact server just like I would expect Oracle Linux and RHEL should use the same server (along with derivatives). (the only difference is the BerkeleyDB implementation in which Oracle provides a bunch of nasty hacks to get certain things running).

    Worse comes to worse, you simply add a check so you know which server to download if you really want to maintain a ton of servers. That would only take a few seconds to run and ensure you're not just grabbing them all. You could also have an explicit setting that allows the user to tell the extension which server to download. I can file a new issue for this as suggested if it will allow this issue to be fully resolved.

  18. roblourens commented on Aug 24, 2019

    @roblourens
    Member

    Jeremy Junac (@jjunac) I set connect timeout and dns timeout. If you don't have internet access, that should be enough, right? I don't want to set --read-timeout because I don't want to fail just for slow connections. (not yet, maybe that is a use case for letting the user explicitly pick which side to download on)

  19. roblourens commented on Aug 24, 2019

    @roblourens
    Member

    WSLUser There will be several versions for architecture/OS (including windows, eventually), and the download is about 30MB, so I think it's not ok for us to predownload every version ahead of time.

    Thinking this goes along with the comments above about offline clients so I opened #1242 for this, feel free to add any comments.

  20. jjunac commented on Aug 26, 2019

    @jjunac

    roblourens Yes sure it is enough if there is no internet connection, I just wanted to raise that the read timeout is awfully long by default, but if you have a plan for that then it's fine :)

    However is there a plan to hardcode the number of tries to make sure the behavior is the same for every machine ? As in my company we are running SLES 11 with an old version of GNU Wget (1.11.4) and by default wget tries 20 times:

           -t number
           --tries=number
               Set number of retries to number.  Specify 0 or inf for infinite retrying.  The default is to retry 20 times, with the exception of fatal errors like "connection refused" or "not found" (404), which are not retried.
    
    
  21. roblourens commented on Aug 26, 2019

    @roblourens
    Member

    Oh, does it retry for the offline error you get? In my testing, it is not retrying for "Network is unreachable".

    If you just run wget for microsoft.com or something else on your offline host, what error do you get?

  22. roblourens commented on Aug 27, 2019

    @roblourens
    Member

    And I've pushed a fix for the path issue on windows that Thomas George (@Helloimbob) and Sebastien Tremblay-Johnston (@underchemist) are seeing.

  23. jjunac commented on Aug 27, 2019

    @jjunac

    roblourens I set the timeout to 1s and tried to wget something, and it is indeed trying 20 times:

    --2019-08-27 09:15:41--  http://whatever.com/
    Resolving whatever.com... ***an IP***
    Connecting to whatever.com|***an IP***|:80... failed: Connection timed out.
    Retrying.
    
    --2019-08-27 09:15:43--  (try: 2)  http://whatever.com/
    Connecting to whatever.com|***an IP***|:80... failed: Connection timed out.
    Retrying.
    
    --2019-08-27 09:15:46--  (try: 3)  http://whatever.com/
    Connecting to whatever.com|***an IP***|:80... failed: Connection timed out.
    Retrying.
    
    --2019-08-27 09:15:50--  (try: 4)  http://whatever.com/
    Connecting to whatever.com|***an IP***|:80... failed: Connection timed out.
    Retrying.
    
    .... and so on
    

    On the other hand, I just did another test, and the path error is indeed fixed. However, I'm getting a Failed to connect to the remote extension host server (Error: Connection error: Unauthorized client refused.) error shortly after. Here are the logs:

    [07:11:20.862] Remote server is listening on port 59753
    [07:11:20.862] Parsed server configuration: {"agentPort":59753,"osReleaseId":"sles","webUiAccessToken":""}
    [07:11:20.863] Starting forwarding server. localPort 56314 -> socksPort 56310 -> remotePort 59753
    [07:11:20.865] Forwarding server listening on 56314
    [07:11:20.865] Waiting for ssh tunnel to be ready
    [07:11:20.869] Tunneled remote port 59753 to local port 56314
    [07:11:20.869] Resolved "ssh-remote+remotemachine" to "127.0.0.1:56314"
    [07:11:20.869] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"success","osReleaseId":"sles"},"measures":{"resolveAttempts":1,"retries":1}}
    [07:11:20.870] ------
    [07:11:20.870] [Forwarding server 56314] Got connection 0
    [07:11:20.884] [Forwarding server 56314] Got connection 1
    [07:11:20.886] [Forwarding server 56314] Got connection 2
    

    And here is the stack trace I'm getting in the JS console:

      ERR [remote-connection][Management   ][4efe7…][initial][127.0.0.1:56314] received error control message when negotiating connection. Error:
    log.ts:173   ERR Error: Connection error: Unauthorized client refused.
        at _ (remoteAgentConnection.ts:553)
        at o.onControlMessage.l (remoteAgentConnection.ts:189)
        at d.fire (event.ts:572)
        at v.fire (ipc.net.ts:449)
        at _receiveMessage (ipc.net.ts:732)
        at _socketDisposables.push._socketReader.onMessage.e (ipc.net.ts:588)
        at d.fire (event.ts:572)
        at g.acceptChunk (ipc.net.ts:235)
        at _register._socket.onData.e (ipc.net.ts:196)
        at Socket.t (ipc.net.ts:28)
        at Socket.emit (events.js:182)
        at addChunk (_stream_readable.js:283)
        at readableAddChunk (_stream_readable.js:264)
        at Socket.Readable.push (_stream_readable.js:219)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94)
    log.ts:173   ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
    log.ts:173   ERR Error: Connection error: Unauthorized client refused.
        at _ (remoteAgentConnection.ts:553)
        at o.onControlMessage.l (remoteAgentConnection.ts:189)
        at d.fire (event.ts:572)
        at v.fire (ipc.net.ts:449)
        at _receiveMessage (ipc.net.ts:732)
        at _socketDisposables.push._socketReader.onMessage.e (ipc.net.ts:588)
        at d.fire (event.ts:572)
        at g.acceptChunk (ipc.net.ts:235)
        at _register._socket.onData.e (ipc.net.ts:196)
        at Socket.t (ipc.net.ts:28)
        at Socket.emit (events.js:182)
        at addChunk (_stream_readable.js:283)
        at readableAddChunk (_stream_readable.js:264)
        at Socket.Readable.push (_stream_readable.js:219)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94)
    notificationsAlerts.ts:40 Failed to connect to the remote extension host server (Error: Connection error: Unauthorized client refused.)
    onDidNotificationChange @ notificationsAlerts.ts:40
    notificationsAlerts.ts:40 Could not fetch remote environment
    onDidNotificationChange @ notificationsAlerts.ts:40
    log.ts:173   ERR [remote-connection][ExtensionHost][14b57…][initial][127.0.0.1:56314] received error control message when negotiating connection. Error:
    log.ts:173   ERR Error: Connection error: Unauthorized client refused.
        at _ (remoteAgentConnection.ts:553)
        at o.onControlMessage.l (remoteAgentConnection.ts:189)
        at d.fire (event.ts:572)
        at v.fire (ipc.net.ts:449)
        at _receiveMessage (ipc.net.ts:732)
        at _socketDisposables.push._socketReader.onMessage.e (ipc.net.ts:588)
        at d.fire (event.ts:572)
        at g.acceptChunk (ipc.net.ts:235)
        at _register._socket.onData.e (ipc.net.ts:196)
        at Socket.t (ipc.net.ts:28)
        at Socket.emit (events.js:182)
        at addChunk (_stream_readable.js:283)
        at readableAddChunk (_stream_readable.js:264)
        at Socket.Readable.push (_stream_readable.js:219)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94)
    log.ts:173   ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
    log.ts:173   ERR Error: Connection error: Unauthorized client refused.
        at _ (remoteAgentConnection.ts:553)
        at o.onControlMessage.l (remoteAgentConnection.ts:189)
        at d.fire (event.ts:572)
        at v.fire (ipc.net.ts:449)
        at _receiveMessage (ipc.net.ts:732)
        at _socketDisposables.push._socketReader.onMessage.e (ipc.net.ts:588)
        at d.fire (event.ts:572)
        at g.acceptChunk (ipc.net.ts:235)
        at _register._socket.onData.e (ipc.net.ts:196)
        at Socket.t (ipc.net.ts:28)
        at Socket.emit (events.js:182)
        at addChunk (_stream_readable.js:283)
        at readableAddChunk (_stream_readable.js:264)
        at Socket.Readable.push (_stream_readable.js:219)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94)
    extensionHostProcessManager.ts:76 Error received from starting extension host
    _extensionHostProcessProxy._extensionHostProcessWorker.start.then.e @ extensionHostProcessManager.ts:76
    extensionHostProcessManager.ts:77 Error: Connection error: Unauthorized client refused.
        at _ (remoteAgentConnection.ts:553)
        at o.onControlMessage.l (remoteAgentConnection.ts:189)
        at d.fire (event.ts:572)
        at v.fire (ipc.net.ts:449)
        at _receiveMessage (ipc.net.ts:732)
        at _socketDisposables.push._socketReader.onMessage.e (ipc.net.ts:588)
        at d.fire (event.ts:572)
        at g.acceptChunk (ipc.net.ts:235)
        at _register._socket.onData.e (ipc.net.ts:196)
        at Socket.t (ipc.net.ts:28)
        at Socket.emit (events.js:182)
        at addChunk (_stream_readable.js:283)
        at readableAddChunk (_stream_readable.js:264)
        at Socket.Readable.push (_stream_readable.js:219)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94)
    _extensionHostProcessProxy._extensionHostProcessWorker.start.then.e @ extensionHostProcessManager.ts:77
    log.ts:173   ERR Connection error: Unauthorized client refused.: Error: Connection error: Unauthorized client refused.
        at _ (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1676:506)
        at o.onControlMessage.l (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1674:659)
        at d.fire (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:107:468)
        at v.fire (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:350:801)
        at _receiveMessage (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:355:324)
        at _socketDisposables.push._socketReader.onMessage.e (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:352:321)
        at d.fire (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:107:468)
        at g.acceptChunk (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:348:234)
        at _register._socket.onData.e (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:347:592)
        at Socket.t (file:///C:/Users/jjunac/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:357:518)
        at Socket.emit (events.js:182:13)
        at addChunk (_stream_readable.js:283:12)
        at readableAddChunk (_stream_readable.js:264:11)
        at Socket.Readable.push (_stream_readable.js:219:10)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
    

    It seems to be linked to the extension server. Am I missing something ?
    Thanks for your work

  24. underchemist commented on Aug 27, 2019

    @underchemist

    I can confirm that I can now connect to remote host by having my vs code client transfer the server code instead of fetching through wget. cheers.

  25. roblourens commented on Aug 27, 2019

    @roblourens
    Member

    Progress. Jeremy Junac (@jjunac) looks like you are now seeing #103 which means that you might not have a compatible glic version. Some details and tips here: https://code.visualstudio.com/docs/remote/linux#_remote-host-container-wsl-linux-prerequisites

  26. jjunac commented on Aug 28, 2019

    @jjunac

    roblourens Indeed, the version of glibc on the machine is below the requirements. Thank you for the doc, I will see what I can do.

  27. LiXiaYu commented on Sep 10, 2019

    @LiXiaYu

    I also has the similar problem.
    manual solve, only for ssh mode

    step 1: download the vscode-server
    wget -nv -O vscode-server-linux-x64.tar.gz https://update.code.visualstudio.com/commit:daf71423252a707b8e396e8afa8102b717f8213b/server-linux-x64/insider

    step 2: copy vscode-server-linux-x64.tar.gz to direction /
    cp vscode-server-linux-x64.tar.gz /vscode-server-linux-x64.tar.gz

    step 3: modify C:\Users\administrator.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.35.0\out\extension.js
    search "wget -nv -O vscode-server-linux-x64.tar.gz https://update.code.visualstudio.com/commit:$COMMIT_ID/server-linux-x64/${t}"

    replace it with "cp /vscode-server-linux-x64.tar.gz ."

    then retry connected, it's ok.

    Hi there.
    Your method is cool! but I can't finish it because extension.js
    changed form in version 0.46.0.
    Could you help me see how to use it in the new version?
    Thanks

  28. lpetre commented on Sep 19, 2019

    @lpetre

    roblourens thanks so much for adding this! I've been eagerly awaiting it.

    I'm having trouble with proxy settings on the local side, running on Windows with system proxy settings. I have no problem installing extensions locally, but with allowLocalServerDownload=true the client server download is failing:

    [15:10:31.982] [email protected]
    [15:10:31.982] win32 x64
    [15:10:31.982] SSH Resolver called for "ssh-remote+lhs", attempt 1
    [15:10:31.982] SSH Resolver called for host: lhs
    [15:10:31.982] Setting up SSH remote "lhs"
    [15:10:32.011] Using commit id "8b6e0efc0a98639085fabeb5226a516785424796" and quality "insider" for server
    [15:10:32.014] Testing ssh with C:\Windows\System32\OpenSSH\ssh.exe -V
    [15:10:32.068] ssh exited with code: 0
    [15:10:32.068] Got stderr from ssh: OpenSSH_for_Windows_7.9p1, LibreSSL 2.6.4
    [15:10:32.069] Using SSH config file "c:\Users\lukep\.ssh\config"
    [15:10:32.069] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 54268 -F c:\Users\lukep\.ssh\config lhs bash
    [15:10:32.073] Install and start server if needed
    [15:10:32.226] > 
    [15:10:32.226] Got some output, clearing connection timeout
    [15:10:33.298] > 96508ccb4aba: running
    > Acquiring lock on /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabe
    > b5226a516785424796/vscode-remote-lock.8b6e0efc0a98639085fabeb5226a516785424796
    > Installing to /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabeb522
    > 6a516785424796...
    > Downloading with wget
    > 
    [15:10:33.748] > Acquiring lock on /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabeb5226a516785424796/vscode-remote-lock.8b6e0efc0a986390
    > 85fabeb5226a516785424796
    > Installing to /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabeb5226a516785424796...
    > Downloading with wget
    > 
    > 
    [15:10:39.885] > Acquiring lock on /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabeb5226a516785424796/vscode-remote-lock.8b6e0efc0a98639085fabeb5226a516785424796
    > Installing to /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabeb5226a516785424796...
    > Downloading with wget
    > 
    > 
    > 
    [15:10:40.384] > wget download failed
    > failed: Connection timed out.
    ...
    > 
    [15:10:40.472] > Trigger client server download
    > VSCODE_ARCH==x64==
    > 96508ccb4aba__trigger_vscode_server_download__
    > Waiting for client to transfer server archive...
    > Waiting for /home/lukep/.vscode-server-insiders/bin/8b6e0efc0a98639085fabeb5226a516785424796/vscode-scp-done.flag and vscode-server-linux-x64.tar.gz to exist
    > 
    [15:10:40.473] Got request to download on client for x64
    [15:10:40.677] Failed to download VS Code Server: HTTP 407 - Proxy Authentication Required
    

    I'm not sure how to debug this further, can you help?

  29. locked and limited conversation to collaborators on Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature-requeston-testplanssh

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions