SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

WSL2 and Docker Desktop
WSL2 and Docker DesktopWSL2 and Docker Desktop
WSL2 and Docker Desktop
Stefan Scherer
 
Docker for a .NET web developer
Docker for a .NET web developerDocker for a .NET web developer
Docker for a .NET web developer
Maurice De Beijer [MVP]
 
#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker
Elton Stoneman
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
dotCloud
 
Docker, OSS and Azure
Docker, OSS and AzureDocker, OSS and Azure
Docker, OSS and Azure
Elton Stoneman
 
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
Stefan Scherer
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
dotCloud
 
#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker
Elton 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 & docker
Jürgen Gutsch
 
Getting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes ServiceGetting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes Service
Sean Whitesell
 
Hooking Docker With Selenium
Hooking Docker With SeleniumHooking Docker With Selenium
Hooking Docker With Selenium
Sujith 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 Guide
Elton Stoneman
 
Azure Container Services
Azure Container Services Azure Container Services
Azure Container Services
WinWire Technologies Inc
 
Build Your Own SaaS using Docker
Build Your Own SaaS using DockerBuild Your Own SaaS using Docker
Build Your Own SaaS using Docker
Julien Barbier
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
Henry Huang
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
The Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOpsThe Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOps
Kontena, 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 Technology
Ajeet 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, Docker
Docker, Inc.
 
Scalable QA With Docker
Scalable QA With DockerScalable QA With Docker
Scalable QA With Docker
Maarten van den Ende
 
WSL2 and Docker Desktop
WSL2 and Docker DesktopWSL2 and Docker Desktop
WSL2 and Docker Desktop
Stefan Scherer
 
#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker#dddsw - Modernizing .NET Apps with Docker
#dddsw - Modernizing .NET Apps with Docker
Elton Stoneman
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
dotCloud
 
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
Stefan Scherer
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
dotCloud
 
#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker#SDD2017 - Modernizing .NET Apps with Docker
#SDD2017 - Modernizing .NET Apps with Docker
Elton 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 & docker
Jürgen Gutsch
 
Getting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes ServiceGetting Started with Azure Kubernetes Service
Getting Started with Azure Kubernetes Service
Sean Whitesell
 
Hooking Docker With Selenium
Hooking Docker With SeleniumHooking Docker With Selenium
Hooking Docker With Selenium
Sujith 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 Guide
Elton Stoneman
 
Build Your Own SaaS using Docker
Build Your Own SaaS using DockerBuild Your Own SaaS using Docker
Build Your Own SaaS using Docker
Julien Barbier
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
Henry Huang
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
The Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOpsThe Automated Container Deployment Pipeline- JAXDevOps
The Automated Container Deployment Pipeline- JAXDevOps
Kontena, 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 Technology
Ajeet 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, Docker
Docker, Inc.
 

Similar to 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
bocribbz
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
Johan 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 Vagrant
Julien Barbier
 
Vagrant
VagrantVagrant
Vagrant
ProfessionalVMware
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
Trevor Roberts Jr.
 
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
John Rofrano
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
moirarandell
 
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
Johan Janssen
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
Marco 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 OpenStack
B1 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 Vagrant
Brian 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 Jenkins
Micael Gallego
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
bpowell29a
 
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
Sagar 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: Vagrant
Antons 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 2014
D
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
Soshi 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 Packer
frastel
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
Johan 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 Vagrant
Julien 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 Docker
John Rofrano
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
moirarandell
 
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
Johan Janssen
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
Marco 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 OpenStack
B1 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 Vagrant
Brian 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 Jenkins
Micael Gallego
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
bpowell29a
 
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
Sagar 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: Vagrant
Antons 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 2014
D
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
Soshi 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 Packer
frastel
 
Ad

More from 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
Stefan 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 apps
Stefan 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 Nodes
Stefan 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 images
Stefan Scherer
 
DockerCon 2016 Recap
DockerCon 2016 RecapDockerCon 2016 Recap
DockerCon 2016 Recap
Stefan Scherer
 
Docker on Windows
Docker on WindowsDocker on Windows
Docker on Windows
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 Images
Stefan 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 apps
Stefan 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 Nodes
Stefan 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 images
Stefan Scherer
 
Ad

Recently uploaded (20)

Building Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdfBuilding Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdf
rabiaatif2
 
Elevate Your Workflow
Elevate Your WorkflowElevate Your Workflow
Elevate Your Workflow
NickHuld
 
Crack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By VivekCrack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By Vivek
Vivek Srivastava
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution ControlDust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Janapriya Roy
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Upstream_processing of industrial products.pptx
Upstream_processing of industrial products.pptxUpstream_processing of industrial products.pptx
Upstream_processing of industrial products.pptx
KshitijJayswal2
 
BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........
jinny kaur
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
BCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdfBCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdf
VENKATESHBHAT25
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis""Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
Infopitaara
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
comparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.pptcomparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.ppt
yadavmrr7
 
Building Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdfBuilding Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdf
rabiaatif2
 
Elevate Your Workflow
Elevate Your WorkflowElevate Your Workflow
Elevate Your Workflow
NickHuld
 
Crack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By VivekCrack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By Vivek
Vivek Srivastava
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution ControlDust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Janapriya Roy
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Upstream_processing of industrial products.pptx
Upstream_processing of industrial products.pptxUpstream_processing of industrial products.pptx
Upstream_processing of industrial products.pptx
KshitijJayswal2
 
BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........
jinny kaur
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
BCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdfBCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdf
VENKATESHBHAT25
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis""Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
Infopitaara
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
comparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.pptcomparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.ppt
yadavmrr7
 

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