amazon-ec2virtualizationkvmminishift

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


I provisioned a CentOS VM on ec2 and installed Minishift but it doesn't start and I realize this has something to do with nested virtualization.

What exactly should I do to use this existing CentOS VM on ec2 to run minishift ?

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

I am going to deploy only projects for experimenting.

I am connecting using 'ssh' from my Windows laptop.

-- 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

Solution

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

    GCP supports nested virtualization which is required to install Minishift. I think this was the reason for the failure of my procedure. Not sure if this is supported by AWS ec2 instances.

    There may be other ways to install Minishift.

    I am posting instructions to install MiniShift on a GCP VM instance. Please note this is a collection of guidelines I found by searching. So they are available else where but I am answering because this really worked for me and it was easy.

    I have deployed a sample successfully.

    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
    

    My script looked like this. I added the last line and saved it.

    #!/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
    

    Restart xrdp

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

    Change password for root

    sudo su
    passwd
    

    Windows Remote Desktop connection

    Once I connected to the GCP VM instance's public IP I was able to login using the credentials root/password

    enter image description here

    Start firefox from the linux desktop and login to OpenShift

    enter image description here