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?

More than 5 years have passed since last update.

Proxy 配下の Windows 10 で、WSL や Hyper-V 環境が proxy をちゃんと使うように設定する

Posted at

前提

  • 企業内ネットワーク環境で、Proxy 経由でないとインターネットへ出られない
  • Proxy そのものの設定は変更できない
  • 話を簡単にするために、全プロトコル同一 Proxy
  • Proxy にユーザ認証は無い

やりたいこと

  • WSL のディストリビューションが普通にインターネットから更新出来るようにしたい
  • VSCode のリモート WSL が普通に動くようにしたい
  • VSCode のリモート SSH で Hyper-V 上の環境が普通に動くようにしたい

設定

WSL

apt.conf 設定

プロキシサーバが立っていてそのままネットに出られない場合、apt.conf を作らないと apt-get 等でソフトウェアのインストールや更新が行えない

  • /etc/apt.conf
Acquire::http::proxy "http:<fqdn>:<port>";

wget

VSCode の Remote WSL で拡張機能を入れる際に内部的に wget を使っているので、.wgetrc を書く。

  • ~/.wgetrc
use_proxy=on
http_proxy=http://<fqdn>:<port>
https_proxy=http://<fqdn>:<port>
HTTP_PROXY=http://<fqdn>:<port>
HTTPS_PROXY=http://<fqdn>:<port>

bash

bashrc にも書いておく。

  • ~/.bashrc
export http_proxy=http://<fqdn>:<port>
export https_proxy=$http_proxy
ALL_PROXY=$http_proxy

Hyper-V 仮想マシン

基本的に、上記 WSL と同様。

参考情報: https://gist.github.com/taoy/eaf225e4459af23f8cc1be59937407da

Docker Desktop

設定パネルに proxy 項目があるのでそこで設定。

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?