Skip to content

Instantly share code, notes, and snippets.

@somebody32
Last active December 17, 2015 18:19
Show Gist options
  • Save somebody32/5652474 to your computer and use it in GitHub Desktop.
Save somebody32/5652474 to your computer and use it in GitHub Desktop.
Setting up Parallels VM for dev env
  1. Create Parallels VM and install guest OS (Ubuntu 12.10 in my example). Do not shutdown the VM or quit Parallels. We'll do this later.
  2. I'm creating for an each VM it's own folder inside ~/Code. This machine will be for the "ACMEProject", so I'll place it inside ~/Code/ACMEProject
  3. Create .vm_config config file inside ~/Code/ACMEProject:
```shell
__VM_NAME=ACMEProject # VM Name
__VM_HOST=10.211.55.2 # VM IP here, Get it from parallels settings
__VM_FW_PORTS="3000 9292" # Any ports that you need to forward from host to VM. 3000 and 9292 in this example
```
  1. Get VM_control script from here (https://github.com/Somebody32/somdots/blob/master/vm_control.sh) and call it from you ZSH file (bash maybe good too, but I've tested it under ZSH only)

    source $HOME/.somdots/vm_control.sh
  2. Inside ~/Code/ACMEProject do vs. This will ssh you to the VM

  3. Setup NFS Sharing from the VM to the host, do this INSIDE THE VM:

    sudo apt-get install nfs-kernel-server 

    add to the /etc/exports:

    /home/vagrant/ACMEProject 10.211.55.2(rw,async,insecure,no_subtree_check,all_squash,anonuid=1000,anongid=1000)

    10.211.55.2 — your host IP

  4. Create code folder inside ~/Code/ACMEProject, control script automatically mount ~/ACMEProject on the VM to it

  5. Down the VM, quit Parallels

  6. Inside ~/Code/ACMEProject try do vu, this will up the machine, mount the code folder, and forward all ports

  7. SSH to it: vs and hack, hack, hack

  8. Down it via vd or halt entirelly — vh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment