microsoft / microsoft/WSL

bash not picking up /etc/environment

Open
#1,405 40 comments 41 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

When setting up http_proxy="http://my.proxyserver.example.com" and other such environment variables in /etc/environment they are not exported when opening a new bash session.

for example:
user@mycomputer:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
ftp_proxy="http://my.proxyserver.example.com:1234"
http_proxy="http://my.proxyserver.example.com:1234"
https_proxy="http://my.proxyserver.example.com:1234"
no_proxy=example.com,*.example.com,10.0.0.0/8,192.168.0.0/16,127.0.0.0/8,localhost"
socks_proxy="http://my.proxyserver.example.com:1235"

exit bash, re-open, and do a printenv they are not listed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by placing the proxy variables in /etc/environment, opening a new bash session, and checking printenv. Start by tracing how WSL initializes the environment for bash and whether /etc/environment is read; done means the configured variables appear in a fresh session without manual export.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.