# START\_SCRIPT doesnt work

**URL:** <https://forum.opennebula.io/t/start-script-doesnt-work/9541>\
**Category:** Installation & Configuration\
**Created:** [May 18, 2021, 7:48am UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541 "2021-05-18T07:48:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeyc](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeyc](https://forum.opennebula.io/u/jeyc)\
**Post date:** [May 18, 2021, 7:48am UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/1 "2021-05-18T07:48:09Z")

</div>

Hello,

I’m trying to deploy a server using a template that contains a start\_script = “touch /root/TEST.txt” in the context section but it doesn’t work, any suggestions?

Thank you.

---

<div class="post-metadata">

**Author:** ![darkfritz2](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/darkfritz2/32/6494_2.png) [@darkfritz2](https://forum.opennebula.io/u/darkfritz2)\
**Post date:** [May 25, 2021, 8:42am UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/2 "2021-05-25T08:42:26Z")

</div>

my start script looks like this and works:

#!/bin/bash

if [-d “/etc/this\_folder”]; then  
:  
else  
mkdir /etc/this\_folder  
fi

i put a bash script in the start script to rule everytime the VM power ups.

---

<div class="post-metadata">

**Author:** ![jeyc](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeyc](https://forum.opennebula.io/u/jeyc)\
**Post date:** [May 25, 2021, 12:00pm UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/3 "2021-05-25T12:00:57Z")

</div>

Hello, dont work for me ☹ . My template is:

CONTEXT = [  
CONTEXT = “true”,  
DNS = “8.8.8.8”,  
ETH0\_GATEWAY = “192.168.4.1”,  
ETH0\_IP = “192.168.4.48”,  
ETH0\_MASK = “255.255.255.192”,  
ETH0\_NETWORK = “192.168.4.0”,  
ETH0\_SEARCH\_DOMAIN = “mydomain.es”,  
HOSTNAME = “redhatAnsible”,  
START\_SCRIPT\_BASE64 = “#!/bin/bash  
touch /root/TEST.txt” ]  
CPU = “1”  
DESCRIPTION = “Máquina virtual creada con ansible”  
DISK = [  
DRIVER = “qcow2”,  
IMAGE = “redhat7.9\_ansible”,  
IMAGE\_UNAME = “oneadmin” ]  
GRAPHICS = [  
KEYMAP = “es”,  
LISTEN = “0.0.0.0”,  
TYPE = “VNC” ]  
HYPERVISOR = “kvm”  
INPUTS\_ORDER = “”  
LOGO = “images/logos/redhat.png”  
MEMORY = “1024”  
MEMORY\_UNIT\_COST = “MB”  
NIC = [  
NETWORK = “VLAN 1111”,  
NETWORK\_UNAME = “oneadmin” ]  
OS = [  
ARCH = “x86\_64”,  
BOOT = “disk0” ]  
SCHED\_RANK = “-RUNNING\_VMS”  
SCHED\_REQUIREMENTS = "ID=“5"”  
VCPU = “1”

there is any error?

Thank you.

---

<div class="post-metadata">

**Author:** ![ahuertas](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ahuertas/32/7487_2.png) [@ahuertas](https://forum.opennebula.io/u/ahuertas)\
**Post date:** [May 25, 2021, 2:11pm UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/4 "2021-05-25T14:11:31Z")

</div>

Hello @jeyc,

The problem is that your `START_SCRIPT_BASE64` is not in base64 form, you should have something like: `IyEvYmluL2Jhc2gKdG91Y2ggL3Jvb3QvVEVTVC50eHQK`.

Best,  
Álex.

---

<div class="post-metadata">

**Author:** ![darkfritz2](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/darkfritz2/32/6494_2.png) [@darkfritz2](https://forum.opennebula.io/u/darkfritz2)\
**Post date:** [May 25, 2021, 2:32pm UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/5 "2021-05-25T14:32:31Z")

</div>

Go to Templates - VMs - select your VM template  
Then “update” - “context” - and there you enter the bash script  
after that you click on the “update” button and then you’ll see in the template the BASE64 hash mentioned by Alex above me.

---

<div class="post-metadata">

**Author:** ![jeyc](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeyc](https://forum.opennebula.io/u/jeyc)\
**Post date:** [May 26, 2021, 5:57am UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/6 "2021-05-26T05:57:49Z")

</div>

Hello,

I have tried the following:  
 ![imagen](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/3/3b9ce312f3c7cd742b3d2cf849110291c2501f30.png)

and I have also tried the following:  
 ![imagen](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/4/4c2dac60fa9040a840f601274022cbfaaf24b816.png)

but dont work for me ☹

Thank you.

---

<div class="post-metadata">

**Author:** ![jeyc](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeyc](https://forum.opennebula.io/u/jeyc)\
**Post date:** [May 26, 2021, 10:19am UTC](https://forum.opennebula.io/t/start-script-doesnt-work/9541/7 "2021-05-26T10:19:43Z")

</div>

Hello,

I have managed to make it work by installing the one\_context package in the virtual machine and restarting it, but curiously I have lost the IP address. I’m still investigating.

Thank you.
