Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code Remote - Containers: change default root directory

I am using Remote-Containers extension on VSCode to work directly on my running containers. The project hierarchy of my container looks like this:

angular_container
    /usr/
        src/
            app/
                frontend/
                    my-source-files

I right-click my container and select the 'Attach Visual Studio Code' option. By default, this opens the /usr/src/app/src/ directory on my container, which doesn't exist. Is there a way to change this setting so that VSCode opens the /usr/src/app/ directory instead? The Remote - Containers extension settings does not specify anything like this.

like image 865
wO_o Avatar asked Apr 17 '26 05:04

wO_o


1 Answers

Maybe, you selected it by default but you can change it:

Open the command list: Shift + Ctrl + P

Search for this command and select it: Remote-Containers: Open attached container configuration file

Select your container from the list, this will open your configuration.

Something like this:

{
    "workspaceFolder": "/root",
    "extensions": [
        "ms-python.python",
        "ms-toolsai.jupyter"
    ]
}

Change the workspaceFolder with your desired.

Save and re attach the container.

like image 176
oskararenas Avatar answered Apr 19 '26 10:04

oskararenas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!