0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PC起動時に自動でVSCode + WSLを立ち上げる方法(スタートアップ登録)

Posted at

はじめに

最近、プログラミングの機会が増えてきて、PCを起動するたびに

  • VSCodeを開く
  • WSLに接続する

という操作を繰り返すのが面倒になってきました。

そこで、PCを起動したら自動で VSCode + WSL を立ち上げるように設定したので、その方法を共有します。
今回は Ubuntu(WSL)を使っている場合の例です。

手順

1. スタートアップフォルダを開く

  1. Win + R を押して、「ファイル名を指定して実行」ダイアログを開きます。
  2. 以下を入力して「OK」を押します:
shell:startup

スタートアップフォルダが開きます。特に設定していなければ空のはずです。


2. VSCodeをWSL(Ubuntu)で起動するショートカットを作成

  1. スタートアップフォルダ内で右クリック → 新規作成 → ショートカットを選びます。
  2. 表示されたウィンドウに、以下のように入力します:
code --folder-uri "vscode-remote://wsl+Ubuntu/home/yourname"

yourname の部分は自分のユーザー名に置き換えてください。

  1. 「次へ」を押し、ショートカットに任意の名前を付けて「完了」を押します。

3. 完了!

これで設定完了です。
PCを再起動すると、VSCodeが自動的に立ち上がり、その時点でWSL(Ubuntu)にも接続された状態になっているはずです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?