Skip to content

Instantly share code, notes, and snippets.

@robneville73
Last active August 27, 2021 13:44
Show Gist options
  • Save robneville73/a5b6768aa8f52caf644ab7811003eaff to your computer and use it in GitHub Desktop.
Save robneville73/a5b6768aa8f52caf644ab7811003eaff to your computer and use it in GitHub Desktop.
Setting up VS Code Remote Development

General

  • Install VS Code
  • Install Remote SSH plugin for VS Code
  • Click green connection bit in lower left corner of vs code
  • Provide SSH login target, i.e. ssh [email protected]
  • VS Code will prompt for password
  • Once connected, green connection bit should show SSH:1.2.3.4 to indicate that you're connected
  • Once connected, click on open folder, vs code will do an ls in the home directory, choose trunk
  • You're good to go
  • If you open a terminal within vs code, you'll automatically be dropped in as rarch in the home dir
  • If you right-click on a directory in the tree, you can choose, "Open in Integrated Terminal" and it will open a terminal and cd into that directory
  • You can have multiple terminals running at the same time

Git

  • Make sure your credentials are saved on the VM
  • Be aware that the Git tab in vs code may not instantly show changes...that is to say, you may need to hit the little refresh icon first

Vue Dev

  • Open ui dir in integrated terminal
  • You will likely need to tweak inotify settings for live reload to not complain about hitting a system limit for file watchers see https://stackoverflow.com/questions/55763428/react-native-error-enospc-system-limit-for-number-of-file-watchers-reached
    • insert the new value into the system config echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
    • check that the new value was applied cat /proc/sys/fs/inotify/max_user_watches
  • you will need the IP of your remote VM mapped in DNS to dev.retailarchitects.com in your local etc/hosts file (note: this isn't currently possible on ChromeOS so you'll have to create a .env.local and override WEBPACK_PROXY to your VM's address)
  • yarn install then yarn serve
  • point your browser to http://dev.retailarchitects.com:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment