0
0

More than 1 year has passed since last update.

NFSでホームディレクトリが同期されているサーバに対するVScodeのremotessh方法

Last updated at Posted at 2021-10-09

状況

VSCodeはログインユーザのホームディレクトリ配下に~/.vscode-serverを生成するので、ここがNFSで複数マシン間で同期されていると不具合を起こす場合があります。

解決方法

  1. サーバにログインして~/.vscode-serverがもしあれば消します。fuser等を駆使してプロセスをkillしないとdevice or resource busyエラーが出てsudo rm出来ない場合があります。
  2. VSCodeのRemoteSSHで普通に接続します。そうするとサーバに~/.vscode-serverが新しく生成されるはずです。この状態で通常は問題ないのですが、複数マシン間でこのディレクトリが同期されるゆえに他のサーバに接続できなくなるときがあります。それを防ぐために~/.vscode-serverを同じサーバ上のNFS同期されていない場所に移動させます。rsync -a ~/.vscode-server /foo/bar
  3. 最後にln -s /foo/bar ~/.vscode-serverでシンボリックリンクを貼っておけば大丈夫です
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0