![在 VirtualBox 上安装 RancherOS:如何与虚拟机共享公钥](https://linux22.com/image/1574317/%E5%9C%A8%20VirtualBox%20%E4%B8%8A%E5%AE%89%E8%A3%85%20RancherOS%EF%BC%9A%E5%A6%82%E4%BD%95%E4%B8%8E%E8%99%9A%E6%8B%9F%E6%9C%BA%E5%85%B1%E4%BA%AB%E5%85%AC%E9%92%A5.png)
答案1
使用 VitualBox,您可以直接从虚拟机通过主机 ip 访问主机,有两种方法可以将您的 cloud-config.yaml 复制到您的虚拟机:
scp:scp 是 rancheros 中的内置命令。
#scp -r <user>@<host_ip>:/cloud-confg.yaml . (be sure sshd service is active in host)
python:在包含 cloud-config.yaml 文件的文件夹中运行一个简单的 http 服务器。
#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)
此外,建议使用 docker-machine 在 virtualbox vm 中安装 rancheros。