Does this extension support code-server?
Closed this issue ยท 24 comments
When I try to install it on code-server, I got the message below:
The 'Open Remote - SSH' extension is not available in code-server for the Web. Click 'More Information' to learn more.
Hi @kaiyuhou, code-server is just the server side (installed on the remote), this extension is meant to be installed in the vscode desktop forks like vscodium (installed locally) and it will install the compatible vscode-server on the remote automatically.
Can you explain a little more about your use case?
- If you want to access your remote machine using vscodium (local vscode) then install this extension
- if you want to access your remote machine using the browser then keep using code-server
Thanks for your quick response!
I would consider code-server
as a "locally" installed vscode on the remote machine. The only difference between code-server and vscodium is the front-end UI of code-server is browser-based. (Please correct me if I am wrong.)
Since the remote machine (where code-server is installed) has the SSH client, it should have the ability to SSH into a target remote.
So you have remoteMachine1 with code-server and want to connect to remoteMachine2 (and I guess remoteMachine2 cannot be exposed to the internet) and access both of them using the browser? I think that's a really special case, so what you want is:
- connect with ssh to remoteMachine2 and install code-server running in port X
- create an ssh tunnel from remoteMachine1 to remoteMachine2 in port X and expose remoteMachine1 port X or setup a reverse proxy ๐ค
- connect using the browser
This extension uses a special vscode API to connect the local ui to the remote machine, in your case that's not needed as they are independent each code-server serves it's own front end resources
Thanks for your response.
I now think I may misunderstand the target use case of remote ssh externsion.
- Suppore we have a vscodium in the local
desktop1
with the ssh extension. - We access the
remoteMachine1
by ssh extension to access theproject1
. - Now, we can access the files of
project1
as we accesing the files of local projects. - I initially thought when we run and debug the
project1
, theproject1
runs on the local machine. (So, we just useremoteMachine1
as the file storage, and leverage the horsepower ofdesktop1
to compile). Now, I thought I am wrong.
Back to my case:
remoteMachine1
is a powerful machine with code-server.remoteMachine2
is not that powerful, so it even cannot support a self-hosted code-server.- Now, I think, the externsion I want to find is to help me access the files in
remoteMachine2
as the local file ofremoteMachine1
.
I initially thought when we run and debug the project1, the project1 runs on the local machine. (So, we just use remoteMachine1 as the file storage, and leverage the horsepower of desktop1 to compile). Now, I thought I am wrong.
yeah that's not correct, on the contrary all the heavy stuff is done on the remote machine
Now, I think, the externsion I want to find is to help me access the files in remoteMachine2 as the local file of remoteMachine1
Maybe this extension fits your use case
This extension uses a special vscode API to connect the local ui to the remote machine, in your case that's not needed as they are independent each code-server serves it's own front end resources
Hi @jeanp413 , you mentioned a SPECIAL API, right? When we try to enable Open Remote SSH in code-server, it warns that This extension is disabled because it is defined to run only in code-server for the Desktop.
May I know what the api is? Do you think the code-server's lack of support for the special api the is root cause of this problem?
@Creling The This extension is disabled because it is defined to run only in code-server for the Desktop
message is because this extension explicitly tells vscode to only run in the ui
(native desktop) in package.json as it doesn't make sense to run this extension on the remote.
If you want to install code-server on another machine that's not exposed to the internet then tunnel it through another machine with internet access, that would be a different extension, though some of the ssh code from this extension can be reused.
Thank you for your quick response. I changed the value of extensionKind
and repacked it but it didn't work in code-server still, I will give a feedback to the code-server team.
Just to be clarity, I do NOT want to connect to a code-server
instance via remote-ssh
. Instead, I want to install the remote-ssh
as an extension of a code-server
instance and use it to connect other machines, just like what we do in a desktop distrubtion. :)
Just to be clarity, I do NOT want to connect to a code-server instance via remote-ssh. Instead, I want to install the remote-ssh as an extension of a code-server instance and use it to connect other machines, just like what we do in a desktop distrubtion
Just to double-check I'm hearing you're right:
- code-server is running on a machine
- you access it install this extension
- now you want to use the extension to remot-ssh into another machine (maybe a remote vm somewhere?)
is that right?
If that were the intended use case why not just use ssh jump hosts?
Just to be clarity, I do NOT want to connect to a code-server instance via remote-ssh. Instead, I want to install the remote-ssh as an extension of a code-server instance and use it to connect other machines, just like what we do in a desktop distrubtion
Just to double-check I'm hearing you're right:
- code-server is running on a machine
- you access it install this extension
- now you want to use the extension to remot-ssh into another machine (maybe a remote vm somewhere?)
is that right?
Yes, it is.
If that were the intended use case why not just use ssh jump hosts?
well, I assume you are talking about accessing a code-server instance that runs on an inner-net vm via a ssh jump host.
Firstly, I have multiply servers and installing the code-server many times on different servers is not an interesting work. Yes, coder/coder might be a life saver, but syncing settsings and extensions is another problem.
Secondly, many users and I access code-server instances with iPad, it is not so easy to keep a ssh jump host alive in the backgroud, unless the ssh tunnel is maintained by code-server itself, just like what ms vscode server does.
@Creling nice - I wasn't even aware of that use case. Also setting that up on more than a couple of remote hosts is painful and should be dealt with differently.
@Creling nice - I wasn't even aware of that use case. Also setting that up on more than a couple of remote hosts is painful and should be dealt with differently.
Glad to get your understanding :)
Yes, it is.
Cool! @jeanp413 I don't know what's needed to support this in code-server, but if it's something we (the code-server team) can help with, please let me know!
Just to double-check I'm hearing you're right:
- code-server is running on a machine
- you access it install this extension
- now you want to use the extension to remot-ssh into another machine (maybe a remote vm somewhere?)
is that right?
Yes, it is.
I'm still not understanding correctly, this extension is not meant to connect a remote machine to another remote machine, if you are using code-server you are already connected to a remote machine.
As I said before, if you want to access remote machine B using code-server then just install it in there, this extension kinda does the same in the end it installs the vscode/codium server on the remote machine (code-server is the same just with the web bits so you can connect from the browser) and tunnels the connection locally to desktop vscode.
If you don't want to install code-server on remote machine B, then maybe this extension vscode-sshfs
is a better fit for your use case.
if you are using code-server you are already connected to a remote machine.
I guess it depends on how you define "remote machine." I have code-sever installed on my local macOS laptop and I'd want to use an extension like this one to connect to another remote machine.
If you don't want to install code-server on remote machine B, then maybe this extension vscode-sshfs is a better fit for your use case.
Awesome! We'll recommend that moving forward. Thanks!
if you are using code-server you are already connected to a remote machine
FWIW I use code-server locally because I prefer my editor to be a browser tab. I am currently running everything locally, but for some tasks I'd like to connect to a remote host.
Hey, I want to go over my requirements to prove that remote ssh isn't meaningless on code-server. First of all, due to the internal network of the server, I usually need remote ssh 3 machines on window vs code to reach the server environment I need, but now I hope to use code-server on the first machine at the beginning, so I only need to carry an ipad with me for office. However, code-server alone cannot directly connect to the final server for code compilation, file viewing and other operations. Therefore, I think the use of remote ssh in code-server is very important. Is there any way to achieve the effect I want?
@Breeze-Zero for your use case one way would be to install code server on the remote machine and then just create an ssh tunnel from the local machine to the port coder server is running
I'm still not understanding correctly, this extension is not meant to connect a remote machine to another remote machine, if you are using code-server you are already connected to a remote machine.
@jeanp413 The use-case that has not been defined here is Chromebooks (without running Linux). This is why I'm here. I have a server running in the cloud with OnlyOffice, Code-Server, etc. They are my "local apps" on a Chromebook.
So the use case I have is:
- Open
https://my-code-server
as a window on my Chromebook ("local app" using overhead resources on my remote server) - Use
Open Remote - SSH
to connect tocustomer-server
via SSH, and have all the overhead work occur oncustomer-server
, while the UI is redirected to my "local app" running on my remote server
Unless I run Linux on the Chromebook, I can not run a true local version of VSCode. This is probably similar to the iPad use case described above.
@jeanp413 The use-case that has not been defined here is Chromebooks (without running Linux).
Chrome OS is based on Linux kernel.
@jeanp413 The use-case that has not been defined here is Chromebooks (without running Linux).
Chrome OS is based on Linux kernel.
How is this relevant? It's an ARM variant, so is FreeBSD and MacOS, doesn't mean you can run the same code.
You have to run a virtual Linux container inside ChromeOS to use VSCode locally. This is not what we want. We want to run remote, but also have the option of running Open Remote on that remote host.
@Breeze-Zero for your use case one way would be to install code server on the remote machine and then just create an ssh tunnel from the local machine to the port coder server is running
I understand, however, if that's possible, no one would be raising this issue.
The issue exists because for many reasons it can't (server ops disagree, resource constraints, change request approval etc.)
For example, if we need to remote debug a staging environment, then we need to install code server on every single staging environment.
There is also an use case where coder is installed on android and turning an android phone or tablet into a coding environment, since some android devices are advertised as such.