You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
The MIT License (MIT)
2
-
Copyright (c) 2019 Kai Salmen
2
+
Copyright (c) 2021 Kai Salmen
3
3
4
4
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copy file name to clipboardExpand all lines: README.md
+35-44Lines changed: 35 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
-
Automated WSL 2 Development Machine
1
+
Automated creation of WSL 2 Development Machine
2
2
===
3
3
4
-
Welcome to the WSL Tooling repository.
4
+
Welcome to the WSL Tooling repository. The aim of this project is to supply with the ability to autpmatically install a fully working WSL 2 development environment just by invoking a powershell script even without the `wsl --install` flag.
5
5
6
-
This is a guide for an almost automatic setup and configuration of Ubuntu LTS for Windows Subsystem for Linux V2.
7
-
The aim is to create a development environment that combines the best of both worlds without the need for an extra Virtual machine.
6
+
I have fully reworked and updated the whole installation. Once your Windows is capabale of running WSL 2 instances, the Ubuntu LTS WSL 2 installation is fully automatic.
8
7
9
8
10
9
## Preparation
11
-
This repository must be available on your local disk.
10
+
This repository must be clone on your local disk.
12
11
13
12
### Enable Windows Subsystem for Linux V2 support
14
13
***This step is only required if WSL support was never activated before on your Windows machine***
@@ -30,62 +29,54 @@ Set the default WSL version to 2. Open a powershell with administrative privileg
30
29
## Installation
31
30
32
31
### Download and Install Ubuntu LTS (20.04)
33
-
If not already done, open a new powershell with administrative privileges and install Ubuntu LTS.
34
-
You need to provide a name (`<wslName>`) of the new wsl,
35
-
the directory (`<wslInstallationPath>`) where the vhdx disk of the new WSL is stored,
36
-
and you need to provide a `<username>` of the default user:
32
+
If not already done, open a new powershell with administrative privileges and install Ubuntu LTS. You **need** to provide four arguments. If you don't specify them on command line, then the script will ask:
33
+
-`<wslName>`: Provide a name for the WSL that is goind to be created (e.g. `devbox`)
34
+
-`<wslInstallationPath>`: The directory where the vhdx disk of the new WSL is stored
35
+
-`<username>`: the name of the user that is used when WSL distro is launched without `-u`
36
+
-`<installAllSoftware>`: Tell if all software packages (see [Available Software](#Available-Software)) shall be installed or if `false` only a fully updated system with configured user is supplied
installUbuntuLTS.ps1 devbox D:\WSL2\devbox kai true
39
40
```
40
41
42
+
### Available Software Package
43
+
If don't want to install all packages during initial WSL creation, you can install them one buy one. They are available here [./scripts](./scripts). These are currently available
44
+
- Ubunut Base Package (git virt-manager firefox dbus-x11 x11-apps make unzip) ([scripts/install/installBasePackage.sh](./scripts/install/installBasePackage.sh))
- Google Chrome ([scripts/install/installChrome.sh](./scripts/install/installChrome.sh))
41
52
42
-
### Further information
43
-
It is possible to have different distributions at the same time. Use this [resource from Microsoft](https://docs.microsoft.com/en-us/windows/wsl/wsl-config) as starting point for further reading.
44
53
45
-
## Configuration
46
-
Inside the "Ubuntu 18.04" application change directory to where this repository has been checked out (all Windows drives are available under `/mnt`).
47
-
Automatically pre-configure Ubuntu 18.04 with the following script [setupWslUbuntu1804.sh](setupUbuntuLTS.sh):
48
-
- It updates the system and removes unnecessary packages afterwards
49
-
- It installs OpenJDK-8, Apache maven 3.6.x, node.js LTS from nodesource and makes them available system wide
50
-
- It configures dbus for XServer usage including setup of environment variables in `/etc/profile.d`
51
-
- It install git, virt-manager and firefox
52
-
After the setup is complete and you restarted Ubuntu, Windows drives are available at `/` (e.g. `/c/Windows`).
54
+
Firefox and other tools can be installed directly with Ubuntu's package manager `apt`. Some of the above scripts also use `apt` and apply additional configuration.
53
55
54
-
**Hint:** Firefox does not work properly with remote X. Set `browser.newtab.preload` to `false` in `about:config` to fix this issue."
56
+
#### Removal
57
+
Not available yet, but with fast a internet connection and fast SSD you have the WSL recreated in approx. five minutes. :sunglasses:
55
58
56
-
### Available Scripts
57
-
More scripts are available for automated installation and configuration in the [./scripts](./scripts) directory:
Firefox and other tools can be installed directly with Ubuntu's package manager `apt`. Some of the above scripts also use `apt` and apply additional configuration.
60
+
## Usage
65
61
66
-
This list will be expanded in the future.
62
+
### X-Server
63
+
I recommend to use [VcXsrv](https://sourceforge.net/projects/vcxsrv/) (also available via chocolatey) to connect to user interfaces launched from WSL on display 0. The WSL linux setup configures everything properly. Use the following Powershell script to launch (it assume vcxsrv is installed at default location `C:\Program Files\VcXsrv\vcxsrv.exe`):
64
+
```powershell
65
+
.\scripts\xserver\xerver.ps1
66
+
```
67
67
68
68
### Certificates
69
69
Copy any certificates you require under `/usr/local/share/ca-certificates/` and the run the command:
70
70
```bash
71
71
sudo update-ca-certificates
72
72
```
73
73
74
-
## Windows Integration
75
-
76
-
### X-Server
77
-
Use [VcXsrv](https://sourceforge.net/projects/vcxsrv/) to connect to user interfaces launched from WSL on display 0. The setup configures everything properly. Just use the XLaunch in Mulit-Window mode and you are ready to go.
Use a console emulator like [ConEmu](https://conemu.github.io/) for a better working environment.
85
-
86
-
## Known issues
87
-
When you use a VPN the wrong primary name resolution host is likely contained in `/etc/resolv.conf`. Comment the home/local address DNS host preventing proper name resolution in the connected VPN network.
74
+
## Misc
75
+
- My Terminal recommendation in 2021 clearly is [Microsoft Terminal](https://github.com/microsoft/terminal)
76
+
- Overview of [WSL commands and launch configurations](https://docs.microsoft.com/en-us/windows/wsl/wsl-config)
77
+
- For Development wiht Visual Studio Code use the `Remote - WSL` extension
0 commit comments