Remote SSH via Visual Studio Code

  • Hi All,


    I am running OMV on top of regular Raspberry Pi OS.


    I would like to use Visual Studio Code on my Windows machine to Remote SSH into the Pi's directories to edit files.


    But I cannot get a ssh connection with Visual Studio. sadly...

    Failed to parse remote port form server output


    ssh is actived in OMV with port 22.

    I can ssh into the Pi using Windows Terminal without an issue.


    Does anyone have a clue?

    Maybe someone is also using Visual Studio Code?


    Thnx & BR

  • https://www.raspberrypi.com/ne…-with-visual-studio-code/


    The vscode repos were removed from the the vscode.list some time ago but it can be installed just the same.

    • Offizieller Beitrag

    I am running OMV on top of regular Raspberry Pi OS

    You mean Raspberry Pi Desktop? Or Raspberry OS Lite?

  • I don't understand what you are saying...

    The vscode.list that point to the repository (where you can download the packages) is empty.


    The Raspberry community was outraged when that was added by the developers of the RaspiOS without anyone's knowledge

    (A Micro$oft repository under the hood of a Debian/Linux OS, hell no).


    You can try to install vscode on the Pi with sudo apt install code -y but since there are no repositories pointing to the packages, it will (most likely) fail.

    (Don't know, haven't tried it, nor will)

    If you try it and it installs, great.


    [EDIT] Found a faster solution:

    If not, run these 3 commands and your back in business. SOURCE

    Code
    wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    echo "deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main" | sudo tee -a /etc/apt/sources.list.d/vscode.list
    sudo apt-get update


  • Do you mean the VS Code extension Remote SSH?


    VS Code running on your windows desktop and editing files on a remote Pi with ssh connection?


    Can check tomorrow when I am closer to my pi

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Do you mean the VS Code extension Remote SSH?


    VS Code running on your windows desktop and editing files on a remote Pi with ssh connection?


    Can check tomorrow when I am closer to my pi

    With this, the Pi doesn't need to have VScode installed?!?

    Zitat

    No source code needs to be on your local machine to gain these benefits since the extension runs commands and other extensions directly on the remote machine.

    This looks to me that it has to be installed on the remote (Pi) machine, but would like another opinion, :/

  • VS Code will connect to the Pi via ssh and install the "server part" of VS Code automatically. There is no need to have a GUI on the Pi.


    Tried it with my Pi 1 i have here:


    This is what is show in the VS Code Output Window in Windows. DONE01-19 , gkchimz Please check your output an paste it here.
    The reason in my case is on the top:

    Code
    ssh: connect to host 192.167.7.24 port 22: Connection timed out

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Checked today on a Pi 4 (whithout OMV):


    • Connecting with VS Code Remote Extention works as expected
    • VS Code server part gets installed on the pi


    OMV does not change anything regarding the sshd. So i quess, your ssh connection is not configured properly in your windows %USERPROFILE%\.ssh\config file or you made a mistake by entering the ssh connection / credentials.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Do you mean the VS Code extension Remote SSH?


    VS Code running on your windows desktop and editing files on a remote Pi with ssh connection?


    Can check tomorrow when I am closer to my pi

    This is precisely what I want to do.


    VS Code will connect to the Pi via ssh and install the "server part" of VS Code automatically. There is no need to have a GUI on the Pi.


    Tried it with my Pi 1 i have here:


    This is what is show in the VS Code Output Window in Windows. DONE01-19 , gkchimz Please check your output an paste it here.
    The reason in my case is on the top:

    Code
    ssh: connect to host 192.167.7.24 port 22: Connection timed out

    Same prolem here 🙄...

    Code
    Failed to parse remote port from server output
  • scroll to the top and see what is in the loga before this. The reason in the case i demonstrated was the wrong ip address and a connection timeout.


    post the whole contents of the window please, not only a single line.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • You mean Raspberry Pi Desktop? Or Raspberry OS Lite?

    Desktop...


    (because I wanted to maintain the ability to access the root system via RDP. Ironically this isn't working either at the moment. But it did in the past, so I assume it's a bullseye related issue. - That's next on my bugfixing list :D)

  • alright guys, I was able to solve the problem - here is what helped:


    I had specified on ssh config file for both Windows Terminal and VS Code.

    Also in the Remot SSH extension menu, there was still a range of old hosts stored.


    I have now both created a specific ssh file for VS Code and deleted the deprecated hosts.


    Now I am able to login successfully via VS Code over ssh.


    Thanks you so much for helping to solve this one.

    • Offizieller Beitrag

    Desktop...

    So that's the root of the problem. OMV cannot coexist with a desktop system.

    Installing OMV5 on Raspberry PI's, Armbian SBC's, & i386 32-bit platforms

    You should solve this. It will bring you other problems.

  • I also met similar problems but they were solved!


    The failure is due to the lack of source for downloading vscode in OMV. Just try:


    1. set the Repo for the installation of VScode:

    Code
    sudo apt install software-properties-common apt-transport-https curl
    
    curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    
    sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
    
    sudo apt update


    2. Set: AllowTcpForwarding yes in /etc/ssh/sshd_config


    3. Restart the ssh service:sudo service sshd restart


    4.Delete the vs folder: rm -rf .vscode-server/


    Then restart connecting from your vscode IDE.


    Hope it would help!

  • I never had to add a repo to a host I am accessing with VScode by ssh. VS code will download and instal lthe server part on its own without using the repo.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Hi


    I may be late at the party but I just add this issue: unable to connect to OMV using VSCode SSH Extension.

    I went in OMV in SSH settings and checked "TCP Transmission Allow SSH Tunnels" and it worked !

  • Hi


    I may be late at the party but I just add this issue: unable to connect to OMV using VSCode SSH Extension.

    I went in OMV in SSH settings and checked "TCP Transmission Allow SSH Tunnels" and it worked !

    Never too late.... been banging my head against a wall for half an hour trying to figure this out. Finally got it working. Thank you!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!