Importazione di Rocky Linux in WSL o WSL2
Images for other versions
If you are looking for WSL instructions for another version of Rocky Linux, select the version you want from the top menu and then refer to the WSL instructions under "Interoperability."
Prerequisiti¶
You must enable the Windows-Subsystem for Linux feature. Do this with one of these options:
- A newer WSL version with extra features is available in the Microsoft Store. Utilizzare questa versione più recente ogni volta che è possibile.
- Open an administrative Terminal (either PowerShell or Command-Prompt) and
run
wsl --install(ref.) - Go to the graphical Windows Settings and enable the optional feature
Windows-Subsystem for Linux
Questa funzione dovrebbe essere disponibile su tutte le versioni di Windows 10 e 11 supportate.
WSL version
Assicurasi che la versione di WSL sia aggiornata, poiché alcune funzionalità sono state introdotte solo nelle ultime versioni. Se non si è sicuri, eseguire wsl --update.
Passi¶
Immagini WSL installabili (preferibile)¶
-
Scaricare l'immagine WSL dal CDN o da un altro mirror più vicino:
-
Esistono diverse opzioni per l'installazione di un'immagine
.wsl: -
Doppio clic sull'immagine per installarla con il nome predefinito dell'immagine.
- Installare l'immagine tramite riga di comando:
```sh wsl --install --from-file <path-to/Rocky-9-WSL-Base.latest.x86_64.wsl> --name <machine-name> ```
Immagini container convenzionali¶
-
Ottenere il rootfs del container. Questo è possibile in diversi modi:
-
Scaricare l'immagine dal CDN:
-
Extract the image from either Docker Hub or Quay.io (ref.)
```sh <podman/docker> export rockylinux:10 > rocky-10-image.tar ``` -
(optional) You will have to extract the .tar file from the
.tar.xzfile if you are using one of the latest WSL versions -
Creare la directory in cui il WSL memorizzerà i suoi file (per lo più da qualche parte nel profilo utente)
-
Finally, import the image into WSL (ref.):
-
WSL:
```sh wsl --import <machine-name> <path-to-vm-dir> <path-to/rocky-9-image.tar.xz> --version 1 ``` -
WSL 2:
```sh wsl --import <machine-name> <path-to-vm-dir> <path-to/rocky-9-image.tar.xz> --version 2 ```
WSL vs. WSL 2
In generale, WSL 2 dovrebbe essere più veloce di WSL, anche se questo può variare a seconda del caso d'uso.
Windows Terminal
If you have Windows Terminal installed, the new WSL distro name will appear as an option on the pull-down menu, which is quite handy for launching in the future. You can then customize it with colors, fonts, and other elements.
systemd
The WSL image is systemd-enabled by default. If you want to use the container images or build your own, you will only need to add systemd=true to the boot section in the /etc/wsl.conf file. (ref.)
Author: Lukas Magauer