RancherOS initialization issue

Sorry i am new to RancherOS and I have some issues to use it in VMWare Fusion.
I started the RancherOS VM which is booted from ISO file and would like to install RancherOS to harddisk via command
$ ros install -c CONF_YML -d /dev/sda

I need to create a config yaml file containing my public key in order to let me SSH to RancherOS after installed the system to hard disk. But the public key is quite long and VMWare Fusion console doesn’t support copy/paste. What is the proper way to create such configuration file in the console? Since there is no default password thus SCP doesn’t work.

What I am doing now is to start a TFTPD container and mount a local folder into the container, and use TFTP to upload my config file into RancherOS VM. But this is quite cumbersome. Is there any other nice way to upload the config file?

If I’m on the console of a newly booted RancherOS, I tend to use scp or
wget to pull the config.yml to that host.

1 Like

Being behind a corporate proxy, I ended-up having to first change the rancher user password with sudo chpasswd rancher, then follow that up with pushing the config via scp to the machine.

My approach is to run a simple web server on my laptop and then use wget to download the cloud-config.yml.

The exact details are

I have a file index.php that contains the cloud-config.yml framework - including ssh keys, storage, networking additional containers (consul, gitlab-ci etc).

I run php -S make turn the current directory into the root of a web server - typically on port 9000.

I boot a host from the CD, then at the initial prompt I run (for example)

wget -O - ‘http://10.0.1.255:9000/?node=23&dc=us’ | sh

That download a cloud-config.yml to the local system and then its a matter of installing using ros install…

Obviously the magic is in the index.php file…

I’ve used this automation to rebuild multiple clusters as I’ve refined the configuration of the cluster - having to boot the hardware is the longest part.

It also makes it easy to keep the cluster configuration checked into git…

If I have control of the network, I use pixicore and a variation on
https://github.com/rancher/os/blob/master/scripts/run#L167 to boot the
servers with the cloud-init pre-specified - and that cloud-init contains a
variation on
https://github.com/rancher/os/blob/master/tests/assets/cloud_config_install_test/cloud-config.yml
so that it auto installs using the cloud-init I want them to run with.