# Bare Metal virtualbox cloud init system services issue

**URL:** <https://forums.suse.com/t/bare-metal-virtualbox-cloud-init-system-services-issue/4867>\
**Category:** RancherOS\
**Created:** [December 10, 2016, 10:50am UTC](https://forums.suse.com/t/bare-metal-virtualbox-cloud-init-system-services-issue/4867 "2016-12-10T10:50:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SecretiveMop](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SecretiveMop](https://forums.suse.com/u/SecretiveMop)\
**Post date:** [December 10, 2016, 10:50am UTC](https://forums.suse.com/t/bare-metal-virtualbox-cloud-init-system-services-issue/4867/1 "2016-12-10T10:50:50Z")

</div>

Greetings,  
after looking at the following topics:

> [@Launch system service via cloud-init](http://forums.suse.com/t/launch-system-service-via-cloud-init/1129):
>
> I’m trying to launch a new system service in system-docker via cloud-init. I am under the impression that I can put a compose yml into a cloud-config file. I am running on EC2, thus all this is passed via the EC2 user-data. The compose yml below when put into the EC2 user-data starts the desired container, but in the user docker, not the system docker. What am I doing wrong, or can this not be achieved this way? #cloud-config rightlink: restart: always net: host image: rightscale/rightlin…

and

> [@RancherOS wont boot after adding a system-service?](http://forums.suse.com/t/rancheros-wont-boot-after-adding-a-system-service/705):
>
> I just added and enabled a nano container as a system-service, after attempting a reboot RancherOS hangs during the boot sequince. Boot hangs with the last entry on the screen being “ip\_tables: © 2000-2006 Netfilter Core Team” Im running RancherOS on bare metal as my only OS, like a “desktop” pc. I fallowed the RancherOS docs and saved the system service .yml file in /var/lib/rancher/conf/ but i fear some how this has currupted the boot sequence and bricked my whole install? Any advice on r…

I decided to start a new topic since neither completely answer my current question.  
I added an entry for an ssh container service to my cloud init, the install goes without a hitch but the boot process will stop while displaying the following line and just hang:

/go/src/github.com/rancher/os/vendor/github.com/docker/libcompose/project/project.go:578 +0x5a2

here is my rancher section in cloud-config.yml:

```
rancher:
 services:
  sshd:
   container_name: sshd
   restart: always
   build: /files/ssh
   image: sshd
   ports:
    - "192.168.125.2:666:22"
   volumes:
    - /mnt/v1:/home/u1/v1:ro
    - /mnt/v2:/home/u2/v2
    - /mnt/v3:/home/u3/v3:ro

```

So, what am I doing wrong?

**[EDIT]  
I use write\_files to put the necessary dockerfile in the /files/ssh folder, I’ve also verified that they actually get put there [/EDIT]**

---

<div class="post-metadata">

**Author:** ![SecretiveMop](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SecretiveMop](https://forums.suse.com/u/SecretiveMop)\
**Post date:** [December 11, 2016, 11:16pm UTC](https://forums.suse.com/t/bare-metal-virtualbox-cloud-init-system-services-issue/4867/2 "2016-12-11T23:16:54Z")

</div>

So an update,  
first regarding docker options:  
adding a -g /PATH arg to docker will prevent you from pulling or building images from a local file it seems,  
furthermore, I haven’t been able to run a service using the cloud-config yml services entry while exposing it’s ports.

Adding a service that build from a path: couldn’t make it work  
adding a service that pulls an imagae: works  
adding a service that pulls an image AND run it while exposing ports: doesn’t work

On the topic about labels: while reading the documentation I got the feeling that labels weren’t necessary, the ARE. If anyone finds this post you need to specify the after or before label.

The scope label can indeed only work with system scope, as advertised in the documentation.
