VSCode secret folder hitting disk quota

For all of you using vscode out there, how do you deal with the .vscode-server directory in your home directory? It is making me exceed my allocation very regularly and it is a bit cumbersome.

My solution was to regularly delete it and let VSCode reinstall vscode-server. FWIW I haven’t had to do this in a little while, because I think Microsoft might have improved vscode-server to grow less in latest versions, but not sure.

VSCode leaves around lots of copies of stuff in .vscode-server/cli/servers. I’ve often gone and manually removed all but the most recent, but I can’t guarantee that won’t delete some customisation settings.

There is an VSCode extension that claims to address some of these issues:

I just installed it and it seemed to clean up old servers and reduced space used from 3.2G to 1.1G.

Oh that looks promising @Aidan ! I think I messed up my vscode though because I straight deleted everything in the server folder and now I can’t open sessions. Ugh

I have no idea if this works for VS Code specifically, but there’s a thing called XDG Config which might help solve this.

The TLDR; is that config, by default, goes in ~/.config. If a system supports it (and this is the bit where I don’t know if VS Code will specifically or whether Gadi will ignore it (I don’t think it will), you could configure it:

ie. export XDG_CONFIG_HOME="/scratch/p73/ct1163/.config" in bash config would move my config to scratch.

Obviously moving all of your persistent config to scratch might not necessarily be the best idea. You might find moving it to your area in a project might work?

TBH, this is fraught with potential issues, but if you have a safe place to put your config it might be helpful. Take this as a ā€˜maybe worth exploring’ rather than a suggestion!

N.B. A cursory search indicated that to configure your vscode-server path you might want to instead do eg. (on your local machine):

{
  "remote.SSH.serverInstallPath": {
    "gadi": "/scratch/p73/ct1163/.vscode-server"
  }
}

If you’re having to continually delete and reinstall VS Code to make this work, then there’s probably no harm in doing this specifically. I’ve left the XDG config stuff in as it’s also useful to know about - ~/.config can often get surprisingly large.

There is a setting to define where .vscode-server is installed, and I’ve had that on /scratch/ for some time without apparent issue (I guess the old files get deleted after some time, but it hasn’t caused me issues so far).

Go to your vscode settings, then search ā€œServer Install Pathā€ and select add.

Alternatively, in your user settings.json add:

    "remote.SSH.serverInstallPath": {
        "gadi.nci.org.au": "/scratch/<your_project_and_user_path>"
    },

You can also just make ~/.vscode-server a symlink to a location on scratch or gdata.