-
Notifications
You must be signed in to change notification settings - Fork 678
Expand file tree
/
Copy pathwsl_ubuntu.txt
More file actions
73 lines (41 loc) · 1.33 KB
/
wsl_ubuntu.txt
File metadata and controls
73 lines (41 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
1️⃣ Verified WSL was installed (Docker proved WSL 2 works)
wsl -l -v
(Showed docker-desktop → confirms WSL 2 enabled)
2️⃣ Created a workspace on Windows
mkdir C:\wsl
cd C:\wsl
3️⃣ Downloaded Ubuntu 22.04 WSL root filesystem (manual, no Store)
curl.exe -L -o ubuntu-22.04.tar.gz https://mirrors.huaweicloud.com/repository/ubuntu-cloud-images/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz
✔ File size ≈ 325 MB (correct)
4️⃣ Imported Ubuntu into WSL 2
wsl --import Ubuntu-22.04 C:\wsl\Ubuntu-22.04 C:\wsl\ubuntu-22.04.tar.gz --version 2
5️⃣ Launched Ubuntu explicitly
wsl -d Ubuntu-22.04
✔ Logged in as root initially
6️⃣ Created a normal Linux user
adduser himanshu
usermod -aG sudo himanshu
✔ User created
✔ Added to sudo group
7️⃣ Verified user groups
id himanshu
Output included:
groups=himanshu,sudo
8️⃣ Tested logging in as the new user
su - himanshu
sudo whoami
✔ sudo works
9️⃣ Configured WSL behavior (systemd + default user)
sudo nano /etc/wsl.conf
File contents:
[boot]
systemd=true
[user]
default=himanshu
Saved and exited nano.
🔟 Restarted WSL from Windows (required)
wsl --shutdown
1️⃣1️⃣ Verified coexistence with Docker Desktop
wsl opens docker-desktop (expected, acceptable)
Ubuntu is entered explicitly via:
wsl -d Ubuntu-22.04