Install RancherOS on VirtualBox: How to share public key to VM

0

For testing purpose, I want to install RancherOS on a VirtualBox VM. To install it, a cloud-config.yml file with public key is required to manage the system using SSH.

What's the easiest/reliable way to copy my prepared cloud-config.yml from host to VM?

Installing guest addons doesn't seem possible, since it's not a standard distribution like Ubuntu, CentOS or similar. Blog posts like this use a jump server, which doesn't seem to be a clean solution. I think there must be a better way to prepare a RancherOS server?

Lion

Posted 2018-11-06T21:49:24.920

Reputation: 203

Answers

0

With VitualBox you can access host from VM by host ip directly, there are two ways to copy your cloud-config.yaml to your VM:

  1. scp: scp is a builtin command in rancheros.

    #scp -r <user>@<host_ip>:/cloud-confg.yaml .   (be sure sshd service is active in host)
    
  2. python: run a simple http server in the folder with cloud-config.yaml file in.

    #python3 -m http.server   (in host)
    #wget <host_ip>:8000/cloud-config.yaml    (in vm)
    or
    #ros install -c http://<host_ip>:8000/cloud-config.yaml -d /dev/sda   (in vm)
    

In addition, use docker-machine to install rancheros in virtualbox vm is recommanded.

xshrim

Posted 2018-11-06T21:49:24.920

Reputation: 1