How to setup a home VPN

10/12/2018
  1. Download and install VirtualBox
  2. Create a new VM called vpn with all default settings.
  3. On VirtualBox change the networking mode. Edit Settings -> Network. Change Attached to to be Bridged Adapter. This lets the VM get its own IP.
  4. Install an OS. I’m using Ubuntu 18.04.1 LTS Server
  5. Run the install command from openvpn-install

Launch VM on macOS start

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.mcgilldevtech.vpn</string>
    <key>ProgramArguments</key>
    <array>
      <string>VBoxHeadless</string>
      <string>-s</string>
      <string>vpn</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>mcgillns</string>
    <key>WorkingDirectory</key>
    <string>/Users/mcgillns</string>
    <key>StandardErrorPath</key>
    <string>/usr/local/var/log/vpnvm.log</string>
    <key>StandardOutPath</key>
    <string>/usr/local/var/log/vpnvm.log</string>
  </dict>
</plist>