SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Setup a Dev environment
that Feels like $HOME
Stefan Scherer, SEAL Systems AG
https://www.youtube.com/watch?v=Zi0eofqAkXU
Agenda
• Windows 10
• Choose your shell
• Choose your editor
• Vagrant
• Docker
• .dotfiles
Choose your shell
CMD PowerShell bash
• Windows Subsystem for Linux
• Run Linux binaries on Windows
• Not just like Cygwin
• Real ELF binaries, packages, ...
What is WSL?
Install WSL
• Open Control Panel
• Turn Windows features on or off
• Select Windows Subsystem for Linux
• Open Admin PowerShell
Enable-WindowsOptionalFeature `
-Online –FeatureName `
Microsoft-Windows-Subsystem-Linux
• Reboot
Setup a Dev environment that feels like $HOME on Windows 10
Install Ubuntu
https://www.microsoft.com/de-de/store/p/ubuntu/9nblggh4msv6
First Ubuntu shell
Setup a Dev environment that feels like $HOME on Windows 10
•Editors
•bash
•git, ssh, ...
Files
•Editors
•bash
•git, ssh, ...Files
✔
Feeling at $HOME?
Coming $HOME
sudo mkdir /Users
cd $HOME/..
windowsuser=$(cmd.exe /c echo %USERNAME% | tr -d 'r')
sudo cp -r $USER /Users/$windowsuser
sudo chown $USER:$USER /Users/$windowsuser
sudo sed -i "s,$HOME,/Users/$windowsuser," /etc/passwd
exit
Coming $HOME – the lazy way
curl https://stefanscherer.github.io/wsl/home.sh | sh
Feeling at $HOME!
•Editors
•bash
•git, ssh, ...Files
✔
Activate metadata for chmod/chown
sudo vi /etc/wsl.conf
[automount]
options = "metadata,umask=22,fmask=11,uid=1000,gid=1000"
• Now close the bash terminal and start another Ubuntu shell.
Shared code folder
echo $HOME # -> eg. /Users/stefan.scherer
mkdir /mnt/c$HOME/code
ln -s /mnt/c$HOME/code $HOME/code
• Now you can clone Git repos in WSL
• And edit with Windows editors like Atom or VSCode
Install editors of choice
iwr -useb https://chocolatey.org/install.ps1 | iex
choco install -y atom
choco install -y visualstudiocode
Happy coding
Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10
•VMware Workstation
•Vagrant VMware Utility
•Vagrant
•Vagrant VMware plugin
•Other Vagrant plugins
•some Patches ...
Install VMware and Vagrant utility
choco install -y vmwareworkstation
choco install -y vagrant-vmware-utility
• Workaround for Vagrant 2.1.0: Add a symlink
mkdir mntcUsers
cmd /c mklink /D mntcUsers$env:USERNAME `
Users$env:USERNAME
Prepare Windows – the lazy way
curl.exe https://stefanscherer.github.io/wsl/prep.ps1 | iex
Install Vagrant in WSL
mkdir -p /mnt/c$HOME/.vagrant.d
ln -s /mnt/c$HOME/.vagrant.d ~/.vagrant.d
sudo chown $USER:$USER ~/.vagrant.d
chmod 755 ~/.vagrant.d
wget https://releases.hashicorp.com/vagrant/2.1.0/vagrant_2.1.0_x86_64.deb
sudo dpkg -i vagrant_2.1.0_x86_64.deb
• Add this to your ~/.bashrc
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS=1
Prepare Vagrant VMware
sudo ln -s 
/mnt/c/ProgramData/HashiCorp/vagrant-vmware-desktop 
/opt/vagrant-vmware-desktop
vagrant plugin install vagrant-vmware-desktop
vagrant plugin license vagrant-vmware-desktop ./license.lic
Patch Vagrant 2.1.0 for VMware
wget
https://raw.githubusercontent.com/StefanScherer/dotfiles/mast
er/bin/vmrun.exe-helper
sudo cp vmrun.exe-helper '/usr/bin/C:Program Files
(x86)VMwareVMware Workstationvmrun.exe'
sudo ln -s '/usr/bin/C:Program Files (x86)VMwareVMware
Workstationvmrun.exe' /usr/bin/vmrun
Install Vagrant VMware – the lazy way
curl https://stefanscherer.github.io/wsl/vagrant.sh | sh
Run Vagrant boxes
cd ~/code
mkdir tst
vagrant init bento/ubuntu-18.04
vagrant up
Use shared folders
• Bind mounts work in the Windows user‘s directory
• Usable with the shared code folder
vagrant ssh
touch /vagrant/xxx
exit
ls xxx
Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10
•VMware Workstation
•docker-machine.exe
•Docker Machine VMware
plugin •Docker CLI
•Docker Compose
•some helpers ...
Install Docker Machine
choco install -y docker-machine
choco install -y docker-machine-vmwareworkstation
Install Docker CLI and Compose
curl https://get.docker.com | sh
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin/docker-compose
Install Docker tools – the lazy way
curl https://stefanscherer.github.io/wsl/docker.sh | sh
Create a Docker Machine
docker-machine.exe create -d vmwareworkstation default
Switch to a Docker Machine
eval $(docker-machine.exe env --shell bash default | 
sed 's,,/,g' | sed 's,C:,/mnt/c,g')
docker version
dm default
Use bind mounts in Docker
• Bind mounts work in the Windows user‘s directory
• Usable with the shared code folder
cd ~/code
docker run -it -v $(pwd):/test ubuntu bash
touch /test/xxx
exit
ls xxx
Start and stop Docker Machine
docker-machine.exe start default
docker-machine.exe stop default
docker-machine.exe ls
dm
dm
dm
Setup a Dev environment that feels like $HOME on Windows 10
What are .dotfiles?
• Save your .bashrc et al files in a GitHub repo
• Restore them easily in your VM‘s or in WSL
• Install looks like
cd ~/code
git clone https://github.com/StefanScherer/dotfiles
cd dotfiles && ./sync.sh
What are .dotfiles?
Aliases
z - "z foo" - cd to most frecent dir matching foo
.. - one dir up
... - two dirs up
.... - three dirs up
..... - four dirs up
dm start default Docker Machine shortcuts
dm default
dm stop default
Setup a Dev environment that feels like $HOME on Windows 10
Questions?
Thank you!
Stefan Scherer
@stefscherer

Contenu connexe

Tendances

WSL2 and Docker Desktop
WSL2 and Docker DesktopWSL2 and Docker Desktop
WSL2 and Docker DesktopStefan Scherer
 
#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with DockerElton Stoneman
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwiliodotCloud
 
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Bauen und Verteilen von Multi-Arch Docker Images für Linux und WindowsBauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Bauen und Verteilen von Multi-Arch Docker Images für Linux und WindowsStefan Scherer
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterdotCloud
 
#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with DockerElton Stoneman
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerJürgen Gutsch
 
Getting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes ServiceGetting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes ServiceSean Whitesell
 
Hooking Docker With Selenium
Hooking Docker With SeleniumHooking Docker With Selenium
Hooking Docker With SeleniumSujith Vakathanam
 
WinOps 2017 - Docker on Windows, the Beginner's Guide
WinOps 2017 - Docker on Windows, the Beginner's GuideWinOps 2017 - Docker on Windows, the Beginner's Guide
WinOps 2017 - Docker on Windows, the Beginner's GuideElton Stoneman
 
Build Your Own SaaS using Docker
Build Your Own SaaS using DockerBuild Your Own SaaS using Docker
Build Your Own SaaS using DockerJulien Barbier
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CDHenry Huang
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantMitchell Hashimoto
 
The Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOpsThe Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOpsKontena, Inc.
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyAjeet Singh Raina
 
What’s New in Docker - Victor Vieux, Docker
What’s New in Docker - Victor Vieux, DockerWhat’s New in Docker - Victor Vieux, Docker
What’s New in Docker - Victor Vieux, DockerDocker, Inc.
 

Tendances (20)

WSL2 and Docker Desktop
WSL2 and Docker DesktopWSL2 and Docker Desktop
WSL2 and Docker Desktop
 
Docker for a .NET web developer
Docker for a .NET web developerDocker for a .NET web developer
Docker for a .NET web developer
 
#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
 
Docker, OSS and Azure
Docker, OSS and AzureDocker, OSS and Azure
Docker, OSS and Azure
 
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Bauen und Verteilen von Multi-Arch Docker Images für Linux und WindowsBauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
 
#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
Getting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes ServiceGetting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes Service
 
Hooking Docker With Selenium
Hooking Docker With SeleniumHooking Docker With Selenium
Hooking Docker With Selenium
 
WinOps 2017 - Docker on Windows, the Beginner's Guide
WinOps 2017 - Docker on Windows, the Beginner's GuideWinOps 2017 - Docker on Windows, the Beginner's Guide
WinOps 2017 - Docker on Windows, the Beginner's Guide
 
Azure Container Services
Azure Container Services Azure Container Services
Azure Container Services
 
Build Your Own SaaS using Docker
Build Your Own SaaS using DockerBuild Your Own SaaS using Docker
Build Your Own SaaS using Docker
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
 
The Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOpsThe Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOps
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology
 
What’s New in Docker - Victor Vieux, Docker
What’s New in Docker - Victor Vieux, DockerWhat’s New in Docker - Victor Vieux, Docker
What’s New in Docker - Victor Vieux, Docker
 
Scalable QA With Docker
Scalable QA With DockerScalable QA With Docker
Scalable QA With Docker
 

Similaire à Setup a Dev environment that feels like $HOME on Windows 10

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with dockerJohan Janssen
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
Run Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantRun Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantJulien Barbier
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerJohn Rofrano
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a containerJohan Janssen
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easyMarco Silva
 
Simplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackSimplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackB1 Systems GmbH
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsMicael Gallego
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool boxbpowell29a
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersSagar Acharya
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantAntons Kranga
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 

Similaire à Setup a Dev environment that feels like $HOME on Windows 10 (20)

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Run Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantRun Docker On Windows Using Vagrant
Run Docker On Windows Using Vagrant
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
 
Vagrant
VagrantVagrant
Vagrant
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a container
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
 
Simplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackSimplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStack
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 

Plus de Stefan Scherer

Azure Saturday - Build and Deploy multi-arch Docker Images
Azure Saturday - Build and Deploy multi-arch Docker ImagesAzure Saturday - Build and Deploy multi-arch Docker Images
Azure Saturday - Build and Deploy multi-arch Docker ImagesStefan Scherer
 
Docker Meetup Mannheim: Multiarch docker images for cross-platform apps
Docker Meetup Mannheim: Multiarch docker images for cross-platform appsDocker Meetup Mannheim: Multiarch docker images for cross-platform apps
Docker Meetup Mannheim: Multiarch docker images for cross-platform appsStefan Scherer
 
Swarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP Nodes
Swarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP NodesSwarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP Nodes
Swarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP NodesStefan Scherer
 
Build and deploy multiarch Linux and Windows Container images
Build and deploy multiarch Linux and Windows Container imagesBuild and deploy multiarch Linux and Windows Container images
Build and deploy multiarch Linux and Windows Container imagesStefan Scherer
 

Plus de Stefan Scherer (6)

Azure Saturday - Build and Deploy multi-arch Docker Images
Azure Saturday - Build and Deploy multi-arch Docker ImagesAzure Saturday - Build and Deploy multi-arch Docker Images
Azure Saturday - Build and Deploy multi-arch Docker Images
 
Docker Meetup Mannheim: Multiarch docker images for cross-platform apps
Docker Meetup Mannheim: Multiarch docker images for cross-platform appsDocker Meetup Mannheim: Multiarch docker images for cross-platform apps
Docker Meetup Mannheim: Multiarch docker images for cross-platform apps
 
Swarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP Nodes
Swarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP NodesSwarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP Nodes
Swarm 2 Go - Build A Portable Multi-Arch Data Center with Pi and UP Nodes
 
Build and deploy multiarch Linux and Windows Container images
Build and deploy multiarch Linux and Windows Container imagesBuild and deploy multiarch Linux and Windows Container images
Build and deploy multiarch Linux and Windows Container images
 
DockerCon 2016 Recap
DockerCon 2016 RecapDockerCon 2016 Recap
DockerCon 2016 Recap
 
Docker on Windows
Docker on WindowsDocker on Windows
Docker on Windows
 

Dernier

Evaluation Methods for Social XR Experiences
Evaluation Methods for Social XR ExperiencesEvaluation Methods for Social XR Experiences
Evaluation Methods for Social XR ExperiencesMark Billinghurst
 
Injection Power Cycle - The most efficient power cycle
Injection Power Cycle - The most efficient power cycleInjection Power Cycle - The most efficient power cycle
Injection Power Cycle - The most efficient power cyclemarijomiljkovic1
 
electricity generation from food waste - based bioenergy with IOT.pptx
electricity generation from food waste - based bioenergy with IOT.pptxelectricity generation from food waste - based bioenergy with IOT.pptx
electricity generation from food waste - based bioenergy with IOT.pptxAravindhKarthik1
 
pulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptxpulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptxNishanth Asmi
 
The Art of Cloud Native Defense on Kubernetes
The Art of Cloud Native Defense on KubernetesThe Art of Cloud Native Defense on Kubernetes
The Art of Cloud Native Defense on KubernetesJacopo Nardiello
 
presentation by faizan[1] [Read-Only].pptx
presentation by faizan[1] [Read-Only].pptxpresentation by faizan[1] [Read-Only].pptx
presentation by faizan[1] [Read-Only].pptxkhfaizan534
 
Artificial organ courses Hussein L1-C2.pptx
Artificial organ courses Hussein  L1-C2.pptxArtificial organ courses Hussein  L1-C2.pptx
Artificial organ courses Hussein L1-C2.pptxHusseinMishbak
 
Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...
Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...
Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...J. Agricultural Machinery
 
Field Report on present condition of Ward 1 and Ward 2 of Pabna Municipality
Field Report on present condition of Ward 1 and Ward 2 of Pabna MunicipalityField Report on present condition of Ward 1 and Ward 2 of Pabna Municipality
Field Report on present condition of Ward 1 and Ward 2 of Pabna MunicipalityMorshed Ahmed Rahath
 
Flutter GDE session GDSC ZHCET AMU, aligarh
Flutter GDE session GDSC ZHCET AMU, aligarhFlutter GDE session GDSC ZHCET AMU, aligarh
Flutter GDE session GDSC ZHCET AMU, aligarhjamesbond00714
 
Research paper publications: Meaning of Q1 Q2 Q3 Q4 Journal
Research paper publications: Meaning of Q1 Q2 Q3 Q4 JournalResearch paper publications: Meaning of Q1 Q2 Q3 Q4 Journal
Research paper publications: Meaning of Q1 Q2 Q3 Q4 JournalDr. Manjunatha. P
 
Chapter 2 Canal Falls at Mnnit Allahabad .pptx
Chapter 2 Canal Falls at Mnnit Allahabad .pptxChapter 2 Canal Falls at Mnnit Allahabad .pptx
Chapter 2 Canal Falls at Mnnit Allahabad .pptxButcher771
 
Introduction to Data Structures .
Introduction to Data Structures        .Introduction to Data Structures        .
Introduction to Data Structures .Ashutosh Satapathy
 
A brief about Jeypore Sub-station Presentation
A brief about Jeypore Sub-station PresentationA brief about Jeypore Sub-station Presentation
A brief about Jeypore Sub-station PresentationJeyporess2021
 
Wave Energy Technologies Overtopping 1 - Tom Thorpe.pdf
Wave Energy Technologies Overtopping 1 - Tom Thorpe.pdfWave Energy Technologies Overtopping 1 - Tom Thorpe.pdf
Wave Energy Technologies Overtopping 1 - Tom Thorpe.pdfErik Friis-Madsen
 
Final PPT.ppt about human detection and counting
Final PPT.ppt  about human detection and countingFinal PPT.ppt  about human detection and counting
Final PPT.ppt about human detection and countingArbazAhmad25
 
Support nodes for large-span coal storage structures
Support nodes for large-span coal storage structuresSupport nodes for large-span coal storage structures
Support nodes for large-span coal storage structureswendy cai
 

Dernier (20)

Evaluation Methods for Social XR Experiences
Evaluation Methods for Social XR ExperiencesEvaluation Methods for Social XR Experiences
Evaluation Methods for Social XR Experiences
 
Injection Power Cycle - The most efficient power cycle
Injection Power Cycle - The most efficient power cycleInjection Power Cycle - The most efficient power cycle
Injection Power Cycle - The most efficient power cycle
 
electricity generation from food waste - based bioenergy with IOT.pptx
electricity generation from food waste - based bioenergy with IOT.pptxelectricity generation from food waste - based bioenergy with IOT.pptx
electricity generation from food waste - based bioenergy with IOT.pptx
 
pulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptxpulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptx
 
Update on the latest research with regard to RAP
Update on the latest research with regard to RAPUpdate on the latest research with regard to RAP
Update on the latest research with regard to RAP
 
The Art of Cloud Native Defense on Kubernetes
The Art of Cloud Native Defense on KubernetesThe Art of Cloud Native Defense on Kubernetes
The Art of Cloud Native Defense on Kubernetes
 
presentation by faizan[1] [Read-Only].pptx
presentation by faizan[1] [Read-Only].pptxpresentation by faizan[1] [Read-Only].pptx
presentation by faizan[1] [Read-Only].pptx
 
Artificial organ courses Hussein L1-C2.pptx
Artificial organ courses Hussein  L1-C2.pptxArtificial organ courses Hussein  L1-C2.pptx
Artificial organ courses Hussein L1-C2.pptx
 
Caltrans view on recycling of in-place asphalt pavements
Caltrans view on recycling of in-place asphalt pavementsCaltrans view on recycling of in-place asphalt pavements
Caltrans view on recycling of in-place asphalt pavements
 
Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...
Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...
Investigating the Efficiency of Drinking Water Treatment Sludge and Iron-Base...
 
Field Report on present condition of Ward 1 and Ward 2 of Pabna Municipality
Field Report on present condition of Ward 1 and Ward 2 of Pabna MunicipalityField Report on present condition of Ward 1 and Ward 2 of Pabna Municipality
Field Report on present condition of Ward 1 and Ward 2 of Pabna Municipality
 
Flutter GDE session GDSC ZHCET AMU, aligarh
Flutter GDE session GDSC ZHCET AMU, aligarhFlutter GDE session GDSC ZHCET AMU, aligarh
Flutter GDE session GDSC ZHCET AMU, aligarh
 
Research paper publications: Meaning of Q1 Q2 Q3 Q4 Journal
Research paper publications: Meaning of Q1 Q2 Q3 Q4 JournalResearch paper publications: Meaning of Q1 Q2 Q3 Q4 Journal
Research paper publications: Meaning of Q1 Q2 Q3 Q4 Journal
 
Chapter 2 Canal Falls at Mnnit Allahabad .pptx
Chapter 2 Canal Falls at Mnnit Allahabad .pptxChapter 2 Canal Falls at Mnnit Allahabad .pptx
Chapter 2 Canal Falls at Mnnit Allahabad .pptx
 
Introduction to Data Structures .
Introduction to Data Structures        .Introduction to Data Structures        .
Introduction to Data Structures .
 
A brief about Jeypore Sub-station Presentation
A brief about Jeypore Sub-station PresentationA brief about Jeypore Sub-station Presentation
A brief about Jeypore Sub-station Presentation
 
Wave Energy Technologies Overtopping 1 - Tom Thorpe.pdf
Wave Energy Technologies Overtopping 1 - Tom Thorpe.pdfWave Energy Technologies Overtopping 1 - Tom Thorpe.pdf
Wave Energy Technologies Overtopping 1 - Tom Thorpe.pdf
 
Final PPT.ppt about human detection and counting
Final PPT.ppt  about human detection and countingFinal PPT.ppt  about human detection and counting
Final PPT.ppt about human detection and counting
 
Support nodes for large-span coal storage structures
Support nodes for large-span coal storage structuresSupport nodes for large-span coal storage structures
Support nodes for large-span coal storage structures
 
FOREST FIRE USING IoT-A Visual to UG students
FOREST FIRE USING IoT-A Visual to UG studentsFOREST FIRE USING IoT-A Visual to UG students
FOREST FIRE USING IoT-A Visual to UG students
 

Setup a Dev environment that feels like $HOME on Windows 10

  • 1. Setup a Dev environment that Feels like $HOME Stefan Scherer, SEAL Systems AG
  • 3. Agenda • Windows 10 • Choose your shell • Choose your editor • Vagrant • Docker • .dotfiles
  • 4. Choose your shell CMD PowerShell bash
  • 5. • Windows Subsystem for Linux • Run Linux binaries on Windows • Not just like Cygwin • Real ELF binaries, packages, ... What is WSL?
  • 6. Install WSL • Open Control Panel • Turn Windows features on or off • Select Windows Subsystem for Linux • Open Admin PowerShell Enable-WindowsOptionalFeature ` -Online –FeatureName ` Microsoft-Windows-Subsystem-Linux • Reboot
  • 14. Coming $HOME sudo mkdir /Users cd $HOME/.. windowsuser=$(cmd.exe /c echo %USERNAME% | tr -d 'r') sudo cp -r $USER /Users/$windowsuser sudo chown $USER:$USER /Users/$windowsuser sudo sed -i "s,$HOME,/Users/$windowsuser," /etc/passwd exit
  • 15. Coming $HOME – the lazy way curl https://stefanscherer.github.io/wsl/home.sh | sh
  • 18. Activate metadata for chmod/chown sudo vi /etc/wsl.conf [automount] options = "metadata,umask=22,fmask=11,uid=1000,gid=1000" • Now close the bash terminal and start another Ubuntu shell.
  • 19. Shared code folder echo $HOME # -> eg. /Users/stefan.scherer mkdir /mnt/c$HOME/code ln -s /mnt/c$HOME/code $HOME/code • Now you can clone Git repos in WSL • And edit with Windows editors like Atom or VSCode
  • 20. Install editors of choice iwr -useb https://chocolatey.org/install.ps1 | iex choco install -y atom choco install -y visualstudiocode
  • 24. •VMware Workstation •Vagrant VMware Utility •Vagrant •Vagrant VMware plugin •Other Vagrant plugins •some Patches ...
  • 25. Install VMware and Vagrant utility choco install -y vmwareworkstation choco install -y vagrant-vmware-utility • Workaround for Vagrant 2.1.0: Add a symlink mkdir mntcUsers cmd /c mklink /D mntcUsers$env:USERNAME ` Users$env:USERNAME
  • 26. Prepare Windows – the lazy way curl.exe https://stefanscherer.github.io/wsl/prep.ps1 | iex
  • 27. Install Vagrant in WSL mkdir -p /mnt/c$HOME/.vagrant.d ln -s /mnt/c$HOME/.vagrant.d ~/.vagrant.d sudo chown $USER:$USER ~/.vagrant.d chmod 755 ~/.vagrant.d wget https://releases.hashicorp.com/vagrant/2.1.0/vagrant_2.1.0_x86_64.deb sudo dpkg -i vagrant_2.1.0_x86_64.deb • Add this to your ~/.bashrc export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS=1
  • 28. Prepare Vagrant VMware sudo ln -s /mnt/c/ProgramData/HashiCorp/vagrant-vmware-desktop /opt/vagrant-vmware-desktop vagrant plugin install vagrant-vmware-desktop vagrant plugin license vagrant-vmware-desktop ./license.lic
  • 29. Patch Vagrant 2.1.0 for VMware wget https://raw.githubusercontent.com/StefanScherer/dotfiles/mast er/bin/vmrun.exe-helper sudo cp vmrun.exe-helper '/usr/bin/C:Program Files (x86)VMwareVMware Workstationvmrun.exe' sudo ln -s '/usr/bin/C:Program Files (x86)VMwareVMware Workstationvmrun.exe' /usr/bin/vmrun
  • 30. Install Vagrant VMware – the lazy way curl https://stefanscherer.github.io/wsl/vagrant.sh | sh
  • 31. Run Vagrant boxes cd ~/code mkdir tst vagrant init bento/ubuntu-18.04 vagrant up
  • 32. Use shared folders • Bind mounts work in the Windows user‘s directory • Usable with the shared code folder vagrant ssh touch /vagrant/xxx exit ls xxx
  • 35. •VMware Workstation •docker-machine.exe •Docker Machine VMware plugin •Docker CLI •Docker Compose •some helpers ...
  • 36. Install Docker Machine choco install -y docker-machine choco install -y docker-machine-vmwareworkstation
  • 37. Install Docker CLI and Compose curl https://get.docker.com | sh curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o docker-compose chmod +x docker-compose sudo mv docker-compose /usr/local/bin/docker-compose
  • 38. Install Docker tools – the lazy way curl https://stefanscherer.github.io/wsl/docker.sh | sh
  • 39. Create a Docker Machine docker-machine.exe create -d vmwareworkstation default
  • 40. Switch to a Docker Machine eval $(docker-machine.exe env --shell bash default | sed 's,,/,g' | sed 's,C:,/mnt/c,g') docker version dm default
  • 41. Use bind mounts in Docker • Bind mounts work in the Windows user‘s directory • Usable with the shared code folder cd ~/code docker run -it -v $(pwd):/test ubuntu bash touch /test/xxx exit ls xxx
  • 42. Start and stop Docker Machine docker-machine.exe start default docker-machine.exe stop default docker-machine.exe ls dm dm dm
  • 44. What are .dotfiles? • Save your .bashrc et al files in a GitHub repo • Restore them easily in your VM‘s or in WSL • Install looks like cd ~/code git clone https://github.com/StefanScherer/dotfiles cd dotfiles && ./sync.sh
  • 45. What are .dotfiles? Aliases z - "z foo" - cd to most frecent dir matching foo .. - one dir up ... - two dirs up .... - three dirs up ..... - four dirs up dm start default Docker Machine shortcuts dm default dm stop default