This repository includes the vagrant configuration that reads all your VM configuration from the configuration file config.yml and builds and manage the development machine in a single workflow.
- Install requirements from above.
- Install vagrant plugins
# Launch terminal and install vagrant plugin as below
# Plugin disk size
$ vagrant plugin install vagrant-disksize
# Plugin virtual box guest add-on
$ vagrant plugin install vagrant-vbguest- Clone or download this project
git clone [email protected]:sajalshres/linux-dev-box.git
cd linux-dev-box-
Create
config.yamlfrom config.yaml.example as per the requirements.- On minimum, you need to update following properties:
- name: Preferred name for machine
- cpus: Number of CPUs (Recommended is 2)
- memory: 4096 GB Recommended
- ports: This will allow you to access the port from localhost. If you are running a web server in port 8000, and want to access the same in local browser, you can set host: 8000 and guest: 8000. This will map the port 8000 from the local machine to the vagrant box in port 8000.
- ssh: Generate ssh key in your default location (profile)
- provisioners: They include set of tools that will be installed during provisioning. You can disable each by setting enable:
false - note: Fot setting git, you'll need to get the token from GitHub developer settings. Otherwise, set git and repositories provisioners to
false.
- On minimum, you need to update following properties:
-
Create and Configure guest machine
# Same directory where repository is cloned
vagrant upNote: If you get error for ubuntu cloud image, update the base_box_version from https://app.vagrantup.com/ubuntu/boxes/bionic64
- To re-run softwares, run provision as below.
# Same directory where repository is cloned
vagrant up --provision
# OR
vagrant provisionKNOWN ISSUES If the command line gets stuck in "ssh auth method: private key" or get "time out while waiting for the machine to boot", try reducing the number of cpus to 1 under vm in your config.yaml file.
To launch in dev box in GUI:
- Launch Virtulbox, it will list your machine running.
- Click
showicon - Login with
vagrantuser. Note: pass is same. - On first boot, Desktop will ask for configuration, choose default.
$ ssh vagrant@localhost -p 2222
- Launch vscode
- Install
Remote Developmentpack or justRemote - SSH - Open command palette by clicking view ->
Command Palette...orctrl+shift+p - Type and select:
Remote-SSH: Open Configuration File - Select the default or user configuration file
- And content as below:
Host You-Machine-Name
HostName localhost
User vagrant
Port 2222
- Open command palette by clicking view ->
Command Palette...orctrl+shift+p - Type and select:
Remote-SSH: Connect to host
- Launch a terminal
- Verify evrything is installed as below:
$ node -v
v13.14.0
$ npm -v
6.14.4
$ docker --version
Docker version 19.03.8, build afacb8b7f0
$ docker-compose --version
docker-compose version 1.25.3, build d4d1b42b
$ python3.7 --version
Python 3.7.7
ls ~/Git/
# If git was enabled in config file
$ ssh -T [email protected]
Hi sajalshres! You've successfully authenticated, but GitHub does not provide shell access.This project is still a Work-In-Progress(WIP) We are currently building a script to install all the prerequisites in a single
powershellorpythonscript
- Sajal Shrestha