Skip to content

Instantly share code, notes, and snippets.

@josephbolus
Created October 25, 2024 20:31
Show Gist options
  • Save josephbolus/de6730e4d9c0c558af201254b70a3501 to your computer and use it in GitHub Desktop.
Save josephbolus/de6730e4d9c0c558af201254b70a3501 to your computer and use it in GitHub Desktop.
#!/bin/bash
# https://docs.rockylinux.org/guides/interoperability/import_rocky_to_wsl/
sudo dnf upgrade --refresh
dnf upgrade --refresh
sudo
dnf install -y nano mc passwd sudo dnf-plugin-config-manager wget dnf-plugins-core tree dos2unix epel-release NetworkManager iproute
su root
sudo mc
ls
sudo dnf config-manager --set-enabled crb
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
clear
dnf update -y && sudo dnf upgrade -y && dnf install iptables-legacy -y && update-alternatives --config iptables
sudo dnf update -y && sudo dnf upgrade -y && sudo dnf install iptables-legacy -y && sudo update-alternatives --config iptables
sudo dnf install -y docker-ce docker-ce-cli containerd.io
sudo dnf remove -y docker-ce docker-ce-cli containerd.io
ls
# Docker Compose
curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Configure Docker to start on boot with systemd
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
mkdir wsl-distrod
cd wsl-distrod/
clear
curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh" && chmod +x install.sh && sudo ./install.sh install
sudo /opt/distrod/bin/distrod enable
sudo dnf install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
docker ps
sudo usermod -aG docker ${USER}
docker ps
su -s ${USER}
touch /home/jbolus/.Xauthority
cat .Xauthority
sudo dnf install xorg-x11-xauth
clear
chromium-browser
read -r -p "Enter username: " USERNAME
adduser $USERNAME
passwd $USERNAME
usermod -aG wheel $USERNAME
echo "-> All done."
echo "-> Update Windows Terminal setting to auto login $USERNAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment