I'm tired of stuff not working with Windows and dual boots are apparently not a thing in my university, VMs drain too many resources, some students have Linux/Mac PCS... So I adopted docker
- Link to the docker hub page
- Quickly pull it via:
docker pull danysk/docker-linux-didattica:latest
docker pull danysk/linux-didattica
docker run --rm --net=host --env="DISPLAY" -v <WHERE_TO_LOCALLY_PERSIST>:/home/user --volume="$HOME/.Xauthority:/.Xauthority:rw" -it danysk/linux-didattica
Install VcXsrv, configure it as explained here.
On a cmd/powershell run ipconfig
and find your IP address.
docker pull danysk/linux-didattica
set-variable -name DISPLAY -value <YOUR_IP>:0.0
docker run --rm "<WHERE_TO_LOCALLY_PERSIST>:/home/user" --volume="$HOME/.Xauthority:/.Xauthority:rw" -e DISPLAY=$DISPLAY -it danysk/linux-didattica
- Download the
*.tar.zstd.*
files from the release page - Join them back into a single compressed archive:
- Bash (requires a UNIX-like shell:
sh
,bash
,zsh
,fish
... won't work on Powershell or Cmd):cat *.tar.zstd.* > wsl.tar.zstd
- Cmd:
copy /b wsl.tar.zstd.00 + wsl.tar.zstd.01 + wsl.tar.zstd.02 wsl.tar.zstd
(add all the downloaded files)
- Bash (requires a UNIX-like shell:
- Decompress the tarball into a
wsl.tar
file- If you have Z-standard installed, simply:
unzstd wsl.tar.zstd
- If
unzstd
is not installed, but you have access tozstd
orzstd.exe
, run:zstd -d wsl.tar.zstd
- If you prefer a graphical tool, check out PeaZip
- If you have Z-standard installed, simply:
- Import in WSL2 (replace
PATH_TO_THE_WLS_FILE_SYSTEM
with a valid path):wsl --import didattica PATH_TO_THE_WLS_FILE_SYSTEM wsl.tar --version 2
- Launch VcXsrv with the configuration mentioned before
- Use the Powershell command
Get-NetIPAddress -AddressFamily ipv4
to get your IP address - Run the following in Powershell, substituting
<YOUR_IP>
with your IP address:
$DISPLAY="<YOUR_IP>:0.0"
$env:DISPLAY=$DISPLAY
$env:WSLENV="DISPLAY/u"
wsl -d didattica -u user zsh
- Install Docker following the instructions provided here
- beware that Mac machines with Apple Chips require installing Rosetta first
brew install xquartz
-
Reboot your Mac after installing
xquartz
-
Start the XQuartz application
-
Open then preferences dialog of the XQuartz application, go to the Security section, and enable the flag Allow connections from network clients, as depicted below (more details here):
-
Start XQuartz application
-
Run the following commands in your shell
export IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
xhost +$IP
docker run --rm --name linux-didattica --net=host -e "DISPLAY=$IP:0" -e XAUTHORITY=/.Xauthority -v <WHERE_TO_LOCALLY_PERSIST>:/home/user --volume="$HOME/.Xauthority:/.Xauthority:rw" -v /tmp/.X11-unix:/tmp/.X11-unix -it danysk/linux-didattica