(ec2 上的 Minishift CentOS VM)启动 VM 时出错:获取主机状态时出错:意外的 EOF

( Minishift CentOS VM on ec2 ) Error starting the VM: Error getting the state for host: unexpected EOF

我在 ec2 上配置了一个 CentOS VM 并安装了 Minishift 但它没有启动,我意识到这与嵌套虚拟化有关。

我到底应该怎么做才能在 ec2 上使用这个 existing CentOS VM 来 运行 minishift?

在云 VM 上安装 MiniShift 的可靠方法是什么?

我将只部署用于试验的项目。

我正在使用 Windows 笔记本电脑上的“ssh”进行连接。

-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'kvm' is supported on this platform ... OK
-- Checking if KVM driver is installed ...
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ...
   Checking driver binary is executable ... OK
-- Checking if Libvirt is installed ... OK
-- Checking if Libvirt default network is present ... OK
-- Checking if Libvirt default network is active ... OK
-- Checking the ISO URL ... OK
-- Checking if provided oc flags are supported ... OK
-- Starting the OpenShift cluster using 'kvm' hypervisor ...
-- Starting Minishift VM .... FAIL E0812 12:08:28.036276   17936 start.go:494] Error starting the VM: Error getting the state for host: unexpected EOF. Retrying.
Error starting the VM: Error getting the state for host: unexpected EOF

What is a proven way to install MiniShift on a cloud VM ?

GCP 支持 nested virtualization,这是安装 Minishift 所必需的。我认为这是我的程序失败的原因。不确定 AWS ec2 实例是否支持此功能。

可能还有其他安装 Minishift 的方法。

我正在发布在 GCP VM 实例上安装 MiniShift 的说明。请注意 这是我通过搜索找到的指南集合。所以它们在其他地方可用,但我正在回答,因为这对我来说真的很有效而且很容易。

我已成功部署示例。

gcloud compute disks create minishiftdisk \
 --image-project ubuntu-os-cloud \
 --image-family ubuntu-1804-lts --zone asia-south1-a



 gcloud compute images create nested-vm-image \
  --source-disk minishiftdisk --source-disk-zone asia-south1-a \
  --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"



  gcloud compute instances create minishift-vm \
  --zone asia-south1-a \
  --machine-type=n1-standard-2 \
  --boot-disk-size=50GB \
  --min-cpu-platform "Intel Skylake" \
  --image nested-vm-image



  sudo apt-get update
  sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system

curl -L https://github.com/minishift/minishift/releases/download/v1.34.1/minish
ift-1.34.1-linux-amd64.tgz -O

tar xvzf minishift-1.34.1-linux-amd64.tgz
sudo cp minishift-1.34.1-linux-amd64/minishift /usr/local/bin/

sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v
0.10.0/docker-machine-driver-kvm-ubuntu16.04 -o /usr/local/bin/docker-machine-driver-kvm



sudo chmod +x /usr/local/bin/docker-machine-driver-kvm

minishift start

radhakrishnan_mohan@minishift-vm:~$ minishift oc-env
export PATH="/home/radhakrishnan_mohan/.minishift/cache/oc/v3.11.0/linux:$PATH"
# Run this command to configure your shell:
# eval $(minishift oc-env)
radhakrishnan_mohan@minishift-vm:~$ eval $(minishift oc-env)
radhakrishnan_mohan@minishift-vm:~$ oc get pods
No resources found.

sudo apt install -y xfce4 xfce4-goodies firefox
sudo apt install -y xrdp

radhakrishnan_mohan@minishift-vm:~$ echo xfce4-session > ~/.xsession

radhakrishnan_mohan@minishift-vm:~$ sudo nano /etc/xrdp/startwm.sh

我的脚本是这样的。我添加了最后一行并保存了它。

#!/bin/sh
# xrdp X session start script (c) 2015, 2017 mirabilos
# published under The MirOS Licence
if test -r /etc/profile; then
        . /etc/profile
fi
if test -r /etc/default/locale; then
        . /etc/default/locale
        test -z "${LANG+x}" || export LANG
        test -z "${LANGUAGE+x}" || export LANGUAGE
        test -z "${LC_ADDRESS+x}" || export LC_ADDRESS
        test -z "${LC_ALL+x}" || export LC_ALL
        test -z "${LC_COLLATE+x}" || export LC_COLLATE
        test -z "${LC_CTYPE+x}" || export LC_CTYPE
        test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION
        test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT
        test -z "${LC_MESSAGES+x}" || export LC_MESSAGES
        test -z "${LC_MONETARY+x}" || export LC_MONETARY
        test -z "${LC_NAME+x}" || export LC_NAME
        test -z "${LC_NUMERIC+x}" || export LC_NUMERIC
        test -z "${LC_PAPER+x}" || export LC_PAPER
        test -z "${LC_TELEPHONE+x}" || export LC_TELEPHONE
        test -z "${LC_TIME+x}" || export LC_TIME
        test -z "${LOCPATH+x}" || export LOCPATH
fi
if test -r /etc/profile; then
        . /etc/profile
fi
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession
startxfce4

重启 xrdp

radhakrishnan_mohan@minishift-vm:~$ sudo service xrdp restart

更改根密码

sudo su
passwd

Windows 远程桌面连接

连接到 GCP VM 实例的 public IP 后,我就可以使用凭据 root/password

登录

从 linux 桌面启动 firefox 并登录 OpenShift