- install pip3
sudo apt install python3-pip -y - install venv wrapper
pip3 install virtualenvwrapper - create venv directory folder
mkdir $HOME/.virtualenv - add to ~/.basrhc
export WORKON_HOME=$HOME/.virtualenvs VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 . /usr/local/bin/virtualenvwrapper.sh
- open new shell and create venv
mkvirtualenv yad2
Forked from ScriptAutomate/Install-WSLAndUbuntu.ps1
Last active
November 8, 2020 13:51
-
-
Save thecreed/7fe84b7cf50f19cf943e3e119722e7e1 to your computer and use it in GitHub Desktop.
Enable WSL and Install Ubuntu 20.04
as root run:
-
add new user
useradd eslutsky -
add sudo privileges
usermod -G 27 eslutsky -
add home dir for user
mkhomedir_helper esutsky -
add to docker user
sudo usermod -aG docker eslutsky -
set password for user
passwd esutsky -
installs
apt-get install nfs-common
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| - BIOS of host machine also needs to be configured to allow hardware virtualization | |
| - Windows 10 Pro or otherwise is needed; Windows 10 Home Edition CANNOT get WSL | |
| - This gist WSLv2, but can use WSLv1 instead. I needed v1 as I run Windows 10 in a VM in Virtualbox. | |
| - WSLv2 has been giving me problems in Virtualbox 6.1, but WSLv1 works properly. | |
| - vbox has issues with the GUI settings when it comes to nested virtualization on certain systems, | |
| so run the following if needing to give a VM this enabled setting: | |
| VBoxManage modifyvm <vm-name> --nested-hw-virt on | |
| #> | |
| ## IN AN ELEVATED SHELL | |
| ## Right-click PowerShell -> Run As Administrator | |
| # Enable Needed Virtualization | |
| dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
| dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
| Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All | |
| # Download Ubuntu 20.04 Focal Fosa | |
| Invoke-WebRequest -Uri https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64-wsl.rootfs.tar.gz -OutFile $ENV:HOMEDRIVE$ENV:HOMEPATH\Downloads\ubuntu-20.04-focal-wsl.tar.gz -UseBasicParsing | |
| # Setup reserved directory path for WSL VM | |
| mkdir c:\UbuntuFocal | |
| # Configure WSL for incoming VM | |
| # For more information about WSL: https://docs.microsoft.com/en-us/windows/wsl/about | |
| wsl --set-default-version 2 # Change to '1' if not able to support 2 | |
| # Import into WSL | |
| wsl.exe --import UbuntuFocal C:\UbuntuFocal $ENV:HOMEDRIVE$ENV:HOMEPATH\Downloads\ubuntu-20.04-focal-wsl.tar.gz | |
| wsl # Drops straight into default VM. Will be UbuntuFocal is WSL alternate VM didn't already exist | |
| # fix the clock in the WSL `hwclock --hctosys` | |
| # change default username https://github.com/microsoft/WSL/issues/3974#issuecomment-636375135 | |
| Function WSL-SetDefaultUser ($distro, $user) { Get-ItemProperty Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\*\ DistributionName | Where-Object -Property DistributionName -eq $distro | Set-ItemProperty -Name DefaultUid -Value ((wsl -d $distro -u $user -e id -u) | Out-String); }; | |
| WSL-SetDefaultUser UbuntuFocal eslutsky | |
| ## BONUS: Docker Desktop | |
| # Checkout the Install-ChocoStarterPackages gist for setting up choco (and other things): | |
| # - https://gist.github.com/ScriptAutomate/02e0cf33786f869740ee963ed6a913c1 | |
| # Once chocolatey / choco is installed, and WSL is already configured with UbuntuFocal, | |
| # run the following command from PowerShell, and not from within WSL: | |
| # choco install docker-desktop -y |
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
and then you change your shell to zsh
chsh -s `which zsh`
and then restart
sudo shutdown -r 0
This problem is explained in depth in this issue
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment