Skip to content

Instantly share code, notes, and snippets.

@ltfschoen
Created January 15, 2020 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ltfschoen/121dee91b5a15d5f2ca19386240e3fb9 to your computer and use it in GitHub Desktop.
Save ltfschoen/121dee91b5a15d5f2ca19386240e3fb9 to your computer and use it in GitHub Desktop.
ubuntu-18.04-vm-setup
  • Install Virtual Box from: http://download.virtualbox.org/virtualbox/

    • Download/install v6.1
    • Download/install Extension Pack
    • Download Guest Edition
  • Download Ubuntu 18.04 64bit ISO - https://ubuntu.com/download/desktop

  • Virtual Box > Welcome > New > Enter name: ubuntu64bit1804; choose Linux; choose Ubuntu 64-bit; use 4000 MB memory (half of your host machine)

  • Choose "Create a virtual hard disk" VirtalBox type, of fixed size 15GB (at least 4GB will be used with installation files)

  • Change settings:

    • Settings > General > Advanced > Shared Clipboard > Bidirectional
    • Settings > General > Advanced > Drag and Drop > Bidirectional
    • System > Motherboard > Boot Order > "Check" Network
    • System > Processor > 2 CPUS (half the amount of CPUs your host machine has)
    • Display > Video Memory > 128 MB (or approx half what your graphics card has)
    • Display > Screen > Enable 3D Acceleration
    • Display > Scale Factor > 130%
    • Storage > Click "Add Hard Disk" under "Controller IDE" > Primary Master
    • Storage > Click "Add Optical Drive" under "Controller IDE" > Primary Slave
      • Choose the Virtual Box 6.1 Guest Additions ISO image
    • Network > Port Forwarding > Forward ports 4000, 8080, 5432, 3000 from 127.0.0.1 to same
    • Ports > Enable USB 3
    • Shared Folders > ~/Public, rename Folder name to: public, enable Auto Mount

Click Start > Install Ubuntu, English US keyboard, Minimal installation, Erase Disk and Install Ubuntu

View a folder on the desktop which is the shared folder that you created for access to your local machine fromn the VM.

Open the "Terminal" application (bash terminal)

Run the following to install guest additions and enable clipboard sharing (since we configured the VM to use Bidirectional clipboard sharing). If you get error Could not get lock /var/lib/dpkg/lock, then the Software Update and associated dialog window needs to be closed first.

sudo apt-get update &&
sudo apt-get install -y xorg-video-abi-23 &&
sudo apt-get install -y xserver-xorg-core &&
sudo apt-get install -y virtualbox-guest-utils &&
sudo apt-get install -y virtualbox-guest-x11 &&
sudo VBoxClient --clipboard

Copy some text from the local machine (i.e. CMD+C), and paste the text in the VM by "right-click > Paste" (i.e. CMD+V shortcut in the VM does not work).

  • Install dependencies
sudo apt-get install -y curl git wget xclip vim
sudo apt update &&
sudo apt install -y software-properties-common apt-transport-https wget &&
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" &&
sudo apt update &&
sudo apt install -y code &&
code
  • Set VSCode as default text editor
sudo update-alternatives --set editor /usr/bin/code
  • Install VSCode Extensions
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension eg2.tslint
code --install-extension msjsdiag.debugger-for-chrome
code --install-extension robertohuertasm.vscode-icons
code --install-extension infeng.vscode-react-typescript
code --install-extension Orta.vscode-jest
code --install-extension PeterJausovec.vscode-docker
code --install-extension rust-lang.rust
code --list-extensions
  • Install NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
source ~/.bashrc
command -v nvm
nvm list
nvm install v10.16.3
nvm use v10.16.3
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
  • Install Yarn Version Manager
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.js | node
source ~/.yvm/yvm.sh
  • Setup Github SSH keys associated with current device
ssh-keygen -t rsa -b 4096 -C "Luke Schoen <ltfschoen@gmail.com>"
cat /home/ltfschoen/.ssh/id_rsa.pub
cd downloads
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
sudo apt update
sudo apt upgrade -y
google-chrome
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
sudo apt-get remove docker docker-compose docker-engine docker.io
sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker

sudo apt-get update
sudo apt-get install \
  apt-transport-https \
  ca-certificates \
  curl \
  gnupg-agent \
  software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo docker run hello-world

sudo usermod -aG docker $USER
docker --version
  • View Free Space
df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment