GithubHelp home page GithubHelp logo

Comments (6)

mohsenari avatar mohsenari commented on July 1, 2024

Hey @ts0818 can you expand on what you mean by devbox services? Are you running a web server as a devbox service locally? or is it hosted somewhere else?
We have built support to connect to devbox.sh instances from VSCode. But I need to understand your use case a bit better to see if what you're asking is possible and just lacks documentation, or if we need to build it.

from devbox.

ts0818 avatar ts0818 commented on July 1, 2024

Thanks for the quick reply.

I don't understand the devbox service very well.

It said that it was inspired by docker compose, so
I thought I could connect using something like docker exec.
As an image, a connection like Visual Studio Code's devContainer,
I would like to know if it is possible for devbox service as well.

I have two machines, local and remote, the devbox service is conducted remotely and I want to connect remotely from my local Visual Studio Code.

from devbox.

mohsenari avatar mohsenari commented on July 1, 2024

@ts0818 oh I see.
Devbox service and devbox shell don't create a virtualization layer like Docker to run your processes. What you're running in a devbox service is running on your machine as a process. So if you want to connect your VSCode to the remote environment, you should connect to the host machine that is running your devbox process via SSH following this guide.
If you want to actively develop using your local VSCode but in the remote environment, you can connect your VSCode to the remote machine using VSCode's remote ssh extension.
Hope this helps. If your use case is different than this, let me know if I can help.

from devbox.

ts0818 avatar ts0818 commented on July 1, 2024

@mohsenari
Thank you for your detailed explanation.
I understand.
your explanation is very good,
For many people, it would be great if you could add it to the documentation.
I think it's useful.

from devbox.

em-jones avatar em-jones commented on July 1, 2024

If I should start a new thread, please let me know.
My question is about the Reopen in devbox shell environment command that gets added by this plugin.
When I attempt to run this from a machine that's in a devbox project on a remote machine (using the ssh remote tooling), vscode closes as though it's about to restart, but never restarts.

Details:
local machine - pop-os
remote machine - windows wsl ubuntu
ssh - tailscale

Probably goes without saying, but this is an issue for VSCode tools that depend on a devbox-managed package (vale in my case).

Would love to hear from anybody that has this working/sees an obvious issue I'm not considering.

from devbox.

mohsenari avatar mohsenari commented on July 1, 2024

@em-jones apologies for late response, I missed this message somehow.
The Reopen in devbox shell environment command doesn't work if your VSCode is connected to a remote environment. The reason for that is because when Reopen in devbox is called, devbox extension in VSCode does the following steps (excluding other details):

  1. VSCode spawns a devbox CLI subprocess in the host machine (same machine that is running VSCode).
  2. VSCode opens an inter-process communication channel between the newly opened subprocess and VSCode.
  3. The subprocess sets up devbox shell environment (as if you called devbox shell via devbox CLI).
  4. Once done, lets VSCode know that the new devbox shell environment is ready so VSCode closes itself.
  5. Subprocess then calls runs code . to open VSCode in the new devbox shell environment.
  6. Subprocess terminates itself.

This "dance" between VSCode and a devbox subprocess gets very fragile and error-prone when I tried testing it in VSCode connected to a remote environment as well as VSCode (in Windows) connecting WSL environment. So at least for the time being we don't have these 2 use cases figured out.
Sorry for disappointing answer but I thought I should at least give you context on why it doesn't work. For your case, I think the subprocess creates a new devbox shell environment, VSCode closes itself, but the subprocess fails to open a new VSCode window.

from devbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.