Skip to content

Commit

Permalink
Update to 24.04 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
TeroKeso authored May 13, 2024
1 parent 16d574d commit 8d29232
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 63 deletions.
7 changes: 2 additions & 5 deletions HAMK_BASIC_Software_MacUsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ Open a terminal and run the following command to install VScode Addons/Extension
```
code --install-extension ms-vscode.powershell
code --install-extension vsls-contrib.gistfs
code --install-extension hashicorp.terraform
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
code --install-extension GitHub.copilot-nightly
code --install-extension GitHub.copilot-labs
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot
```

## Apple UI changes
Expand Down Expand Up @@ -183,5 +182,3 @@ Third option is to use HAMK Vcommander service, but compared to Parallels and Vm

** Warp terminal **
* [Warp terminal](https://www.warp.dev/) and [New *incredible* macOS terminal! (warp + starship + zsh)](https://www.youtube.com/watch?v=NfggT5enF4o)


90 changes: 35 additions & 55 deletions Windows_11_WSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
* WSL will be installed to your computer and in the default setting it will download latest Ubuntu
> If you already have wsl installed you should make sure that it is updated. Use command wsl --update to update it.
```
```bash
wsl --install
```
![Installing WSL](assets/wslupdate.png "WSL --install")


## Set default WSL version and check installed distributions
```

```bash
wsl --set-default-version 2
wsl --list --verbose
```
Expand All @@ -29,39 +30,42 @@ wsl --list --verbose


## Lets install Ubuntu 20.04 and Debian Distripution. We will use Ubuntu as main platform and Debian for testing.
```
wsl --install --web-download --distribution Ubuntu-20.04

```bash
wsl --install --web-download --distribution Ubuntu-24.04

wsl --install --web-download --distribution Debian

wsl --setdefault Ubuntu-20.04
wsl --setdefault Ubuntu-24.04
```

# Updating WSL distripution using Powershell

```
```bash
wsl -d Ubuntu -u root bash -c 'apt update ; apt upgrade -y'
wsl -d Ubuntu-20.04 -u root bash -c 'apt update ; apt upgrade -y'
wsl -d Ubuntu-24.04 -u root bash -c 'apt update ; apt upgrade -y'
```


## Enabling systemd to your default WSL distribution Ubuntu-20.04
## Enabling systemd to your default WSL distribution Ubuntu-24.04
We are starting to use systemd, which brings WSL Linux closer to a virtual machine or physical installation

```
wsl -u root -d Ubuntu-20.04 bash -c "touch /etc/wsl.conf"
wsl -u root -d Ubuntu-20.04 bash -c "echo [boot] >> /etc/wsl.conf"
wsl -u root -d Ubuntu-20.04 bash -c "echo systemd=true >> /etc/wsl.conf"
wsl -t Ubuntu-20.04
```bash
wsl -u root -d Ubuntu-24.04 bash -c "touch /etc/wsl.conf"
wsl -u root -d Ubuntu-24.04 bash -c "echo [boot] >> /etc/wsl.conf"
wsl -u root -d Ubuntu-24.04 bash -c "echo systemd=true >> /etc/wsl.conf"
wsl -t Ubuntu-24.04
```
## Limiting amount of memory and cpu WSL can use. Change values as needed
Start Powershell with **NORMAL** user rights and copy all command in to it.

```
```bash
$contentToAdd = @"
[wsl2]
memory=4GB # Limits VM memory in WSL 2 to 4 GB
processors=2 # Makes the WSL 2 VM use two virtual processors
[experimental]
autoMemoryReclaim=true
"@

New-Item $home\.wslconfig
Expand All @@ -73,32 +77,32 @@ notepad++ $home\.wslconfig

## Export and import a Ubuntu distribution to a TAR file

```
wsl --export Ubuntu "G:\My Drive\Ubuntu_wsl_backup.tar"
```bash
wsl --export Ubuntu "G:\My Drive\Ubuntu_wsl_backup_24.04.tar"
```

Import a new distribution

```
wsl --import Ubuntu-backup "c:\temp\" "G:\My Drive\Ubuntu_wsl_backup.tar"
```bash
wsl --import Ubuntu-24.04-Base "c:\temp\" "G:\My Drive\Ubuntu_wsl_backup_24.04.tar"
```
![Installing Debian to WSL](assets/WSL_export_inport.png "WSL Debian")
## Uninstalling command is --unregister
## Uninstalling command is --unregister (Use only if needed)
No need to remove WSL distribution if everything is working
```
wsl --unregister Ubuntu-20.04
```bash
wsl --unregister Ubuntu-24.04
wsl --unregister Debian
```
# Problem Solving
Update Windows computer and WSL. Start Powershell with Administrator rights as many times is needed. Go through repairs in order and test regularly.
```
```bash
# Install Windows update modules
Install-Module PSWindowsUpdate -Confirm
Set-ExecutionPolicy -Scope Process -ExecutionPolicy unrestricted
Expand All @@ -113,56 +117,32 @@ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
## Let's check that WSL is installed
```
```bash
wsl --install
```
## Update WSL kernel
```
```bash
wsl --update
```
## Reinstall Ubuntu, Debian and Docker images. THIS WILL RESULT IN LOST DATA if you have not save data on your host machine!
```
```bash
Stop-Process -Name "Docker Desktop" -Force
wsl --unregister Ubuntu-20.04
wsl --unregister Ubuntu-24.04
wsl --unregister Ubuntu
wsl --unregister Debian
wsl --unregister docker-desktop-data
wsl --unregister docker-desktop
wsl --set-default-version 2
wsl --install --web-download --distribution Ubuntu-20.04
wsl --install --web-download --distribution Debian
Start-Sleep -Seconds 10 #Waiting WSL to activate
wsl -d Ubuntu-20.04 -u root bash -c 'apt update ; apt upgrade -y'
wsl --setdefault Ubuntu-20.04
wsl --install --web-download --distribution Ubuntu-24.04
```

## Convert WSL 1 to WSL 2

List all installed Ubuntu WSL intance

```
wsl --list --verbose
```

Find what WSL install is running in 1 and convert it to 2

```
wsl --set-version Ubuntu 2
wsl --set-version Ubuntu-20.04 2
Now we need to update WSL Ubuntu-24.04 to update
```bash
wsl -d Ubuntu-24.04 -u root bash -c 'apt update ; apt upgrade -y'
wsl --setdefault Ubuntu-24.04
```

Fix the default
```
wsl --set-default-version 2
```

![WSL1to2](assets/WSL_WSL1to2.png "WSL1to2")



# Hyper-V still not working?
Forcing Hyper-v to start using Windows bootloader.
Expand Down
5 changes: 2 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ choco install powershell-core git vscode putty greenshot notepadplusplus winscp
```
code --install-extension ms-vscode.powershell
code --install-extension vsls-contrib.gistfs
code --install-extension hashicorp.terraform
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
code --install-extension GitHub.copilot-nightly
code --install-extension GitHub.copilot-labs
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot
```
## Step 4: Create GitHub Account

Expand Down

0 comments on commit 8d29232

Please sign in to comment.