<div dir="ltr">You should decode the ROOT_PASSWORD inside that script, something in the lines of:<div><br></div><div><div style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">#!/bin/bash</div><div style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">

PASS=$(echo "$ROOT_PASSWORD" | base64 -d)</div><div style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">usermod -p "$PASS" root</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Wed, Apr 2, 2014 at 3:13 PM, Leszek Master <span dir="ltr"><<a href="mailto:keksior@gmail.com" target="_blank">keksior@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div class=""><span style="font-family:arial,sans-serif;font-size:13px">I'm trying to do this on ubuntu, i did what you said i've created file names init.sh upload it to Files and named there init.sh too. Next i applied it to template ($FILE[IMAGE_ID=10]) added ROOT_PASSWORD base 64 encoded and it doesn't work :(</span><div style="font-family:arial,sans-serif;font-size:13px">


<br></div><div style="font-family:arial,sans-serif;font-size:13px">My init.sh:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><div class="">

<div>#!/bin/bash</div>
<div>usermod -p "$ROOT_PASSWORD" root</div><div><br></div></div><div>But it didn't work.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">2014-04-02 11:37 GMT+02:00 Jaime Melis <span dir="ltr"><<a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>></span>:<br>


</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Leszek,</div><div><div class="h5"><div><br></div>Create a script, call it "init.sh", upload it to the Files & Kernel tab (as a Context type). Select it under the Context -> Files section of the VM Template.<div>




<br></div><div>Whatever you put inside that init.sh script will get executed. </div><div><br></div><div>The contents of the script depend on the distro you are using, but if you're using CentOS 6, for instance, you might want to write something like this:</div>




<div><br></div><div>> #!/bin/bash</div><div>> echo "root:$ROOT_PASSWORD" | passwd<br></div><div><br></div><div>And then you can specify the custom variable ROOT_PASSWORD in the VM Template.</div><div><br>



</div>
<div>Please note that it's recommended to use base64 encoding for this type of things, since otherwise it might lead to character problems.</div><div><br></div><div><br></div><div><br></div></div></div></div><div><div class="h5">

<div class="gmail_extra">


<br><br><div class="gmail_quote"><div>On Wed, Apr 2, 2014 at 11:09 AM, Leszek Master <span dir="ltr"><<a href="mailto:keksior@gmail.com" target="_blank">keksior@gmail.com</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>

<div dir="ltr">How can i push root password to a VM for example using context?</div>
<br></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888"><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Jaime Melis<br>Project Engineer<br>
OpenNebula - Flexible Enterprise Cloud Made Simple<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a></div>

</div>
</font></span></div></div></blockquote></div><br></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Jaime Melis<br>Project Engineer<br>OpenNebula - Flexible Enterprise Cloud Made Simple<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a></div>

</div>
</div>