title: Elixir: Set cookie and hostname for release created using mix escript.build
body: <p>When running iex interactively, one can use</p>
  
  <pre><code>iex --cookie &lt;cookie&gt; --name &lt;hostname&gt;
  </code></pre>
  
  <p>How do I set the same values for <code>cookie</code> and <code>name</code> when running an executable created using <code>mix escript.build</code>?</p>
  
  <p>I figured out that I need to create a <code>vm.args</code> file with the following contents</p>
  
  <pre><code>## Name of the node
  -name name@host
  
  ## Cookie for distributed erlang
  -setcookie cookie
  </code></pre>
  
  <p>So I created a <code>vm.args</code> file in the same directory as the executable file. But when I print <code>Node.self()</code>, I get <code>:nonode@nohost</code>. </p>
  
  <p>So where do I store <code>vm.args</code> so that it is read by the executable?</p>