Skip to content

Commit

Permalink
+ add wsl2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
BacLuc committed Jul 27, 2023
1 parent ec13f07 commit fd6c8ff
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
- hosts: all

pre_tasks:
- ansible.builtin.include_tasks: tasks/wsl-check-if-wsl.yml
- ansible.builtin.include_tasks: tasks/ubuntu_apt.yml
- ansible.builtin.include_tasks: tasks/ubuntu_desktop.yml
when: not wsl_is_wsl
- ansible.builtin.include_tasks: tasks/virtualbox_additions.yml
when: not wsl_is_wsl
- ansible.builtin.include_tasks: tasks/basicsetup.yml
- ansible.builtin.include_tasks: tasks/buildtools.yml
- ansible.builtin.include_tasks: tasks/java.yml
Expand Down
8 changes: 8 additions & 0 deletions ansible/tasks/wsl-check-if-wsl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- name: Check if running in wsl 2
ansible.builtin.shell: wsl.exe -- ls
ignore_errors: true
changed_when: true
register: wsl_is_wsl_command
- name: Set facts if running in wsl
ansible.builtin.set_fact:
wsl_is_wsl: '{{ true if (wsl_is_wsl_command.rc == 0) else false }}'
40 changes: 40 additions & 0 deletions docs/wsl2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
WSL 2
=======

WSL 2 bietet die Möglichkeit, einen Linux-Kernel parallel zu Windows auszuführen.
Der Zugriff auf das Windows-Dateisystem ist möglich, jedoch etwas langsam.
Deshalb sollte man seine Dateien im WSL 2 Filesystem bearbeiten.
Mit den neuesten Versionen von Windows 10 und Windows 11 können auch
GUI-Anwendungen ausgeführt werden.
Es wird empfohlen, eine separate Ubuntu WSL 2 Instanz für den Jumpstart zu erstellen,
um mögliche Probleme mit anderen Projekten zu vermeiden,
falls du WSL2 bereits verwendest.

!!! Achtung !!!
------------

Falls in einem Projekt schon eine VirtualBox VM verwendet wird,
kann dies zu Problemen führen.
In diesem Fall die Variante [VirtualBox](./virtualbox.md)
verwenden.


Installation
------------

1. WSL 2 über Windows Store installieren: [WSL 2 in Windows Store](https://www.microsoft.com/store/productId/9P9TQF7MRM4R)
2. \
a. Falls noch keine WSL 2 Instanz da ist: Ubuntu über Windows Store installieren: [Ubuntu 22.04 in Windows Store](https://www.microsoft.com/store/productId/9PN20MSR04DW)\
b. Sonst: Eine zusätzliche WSL 2 Instanz mit ubuntu 22 erstellen: <https://endjin.com/blog/2021/11/setting-up-multiple-wsl-distribution-instances>\
3. `git clone https://github.com/scs/jumpstart-vm.git`
4. `cd jumpstart-vm`
5. `./provision.sh`. Achtung: Dieser Schritt installiert sehr viele Pakete in der VM
und dauert entsprechend sehr lange.
6. Sicherstellen, dass systemd aktiviert ist:
```bash
cat << 'EOF' | sudo tee /etc/wsl.conf
[boot]
systemd=true
EOF
```

0 comments on commit fd6c8ff

Please sign in to comment.