DSVM WSL2 Documentation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

WSL2 Configuration:

• Update ubuntu repositories:

sudo apt update


sudo apt upgrade

• Admin privileges without sudo:

sudo visudo
username ALL=(ALL) NOPASSWD:ALL

• WSL configuration for default user at any system:

sudo nano /etc/wsl.conf


[user]
default = miraz

• Enable systemd for WSL2:

git clone https://github.com/Miraz4300/systemd-for-wsl2.git


cd systemd-for-wsl2
sudo bash wsl2-systemd.sh
• Install GDB for linux:

sudo apt-get install build-essential gdb


sudo apt install unixodbc-dev

ANACONDA SETUP:

• After installing Anaconda:

Remove spyder

sudo /anaconda/bin/python3 -m pip uninstall spyder spyder-kernels pyodbc

Check outdated list

sudo /anaconda/bin/python3 -m pip list –outdated

(optional) Force update python packages to latest version:

sudo /anaconda/bin/python3 -m pip install -U ipykernel ipython ipywidgets jupyter-


client jupyter-console jupyter-core jupyter-server jupyterlab jupyterlab-pygments
jupyterlab-server jupyterlab-widgets nbclassic nbclient nbconvert nbformat notebook

Clean pip cache

sudo /anaconda/bin/python3 -m pip cache purge


• Install Nodejs:

cd ~
curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh
sudo bash /tmp/nodesource_setup.sh
sudo apt install nodejs

• Install JupyterHub:

sudo /anaconda/bin/python3 -m pip install jupyterhub


sudo npm install -g configurable-http-proxy

sudo mkdir -p /anaconda/etc/jupyterhub/


cd /anaconda/etc/jupyterhub/
sudo /anaconda/bin/jupyterhub --generate-config

[configuration file] sudo nano /anaconda/etc/jupyterhub/jupyterhub_config.py

sudo mkdir -p /anaconda/etc/systemd


sudo nano /anaconda/etc/systemd/jupyterhub.service
Jupyterhub.service:

[Unit]
Description=JupyterHub
After=syslog.target network.target

[Service]
User=root
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/anaconda/bi
n"
ExecStart=/anaconda/bin/jupyterhub -f /anaconda/etc/jupyterhub/jupyterhub_config.py

[Install]
WantedBy=multi-user.target

sudo ln -s /anaconda/etc/systemd/jupyterhub.service /etc/systemd/system/jupyterhub.service

sudo systemctl daemon-reload


sudo systemctl enable jupyterhub.service
sudo systemctl start jupyterhub.service
sudo systemctl status jupyterhub.service

sudo chown -R miraz /anaconda

Extensions:

• sudo /anaconda/bin/python3 -m pip install jupyter_contrib_nbextensions


• sudo /anaconda/bin/jupyter contrib nbextension install --sys-prefix
• sudo /anaconda/bin/jupyter nbextension enable scratchpad/main --sys-prefix
• sudo /anaconda/bin/jupyter nbextension list

sudo /anaconda/bin/python3 -m pip install jupyterlab-git


Troubleshoot:
sudo /anaconda/bin/jupyter server extension list
sudo /anaconda/bin/jupyter labextension list

sudo /anaconda/bin/jupyter labextension install @jupyterlab/git

sudo -E jupyter labextension install @jupyterlab/toc

sudo /anaconda/bin/python3 -m pip install jupyterlab_github


sudo /anaconda/bin/python3 -m pip install jupyter-dash
sudo /anaconda/bin/python3 -m pip install pyviz_comms
sudo /anaconda/bin/python3 -m pip install jupyterlab_latex

DOCKER SETUP:
1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

sudo apt-get update

sudo apt-get install \


ca-certificates \
curl \
gnupg \
lsb-release

2. Add Docker’s official GPG key:


sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o
/etc/apt/keyrings/docker.gpg
3. Use the following command to set up the repository:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg]
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >
/dev/null

4. Update the apt package index, and install the latest version of Docker Engine, containerd, and
Docker Compose, or go to the next step to install a specific version:

sudo apt-get update


sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

without admin: sudo usermod -aG docker ${USER}

Setting up NVIDIA Container Toolkit:

cudNN INSTALL

AWS CLI INSTALL:


curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt install unzip
unzip awscliv2.zip
sudo ./aws/install

AZURE CLI INSTALL:


curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

HEROKU CLI INSTALL

sudo curl https://cli-assets.heroku.com/install-ubuntu.sh | sh

You might also like