Minikube on Windows and HyperV: Stuck on prompt "minikube login" - hyper-v

I'm "extremely" new to Kubernetes, and I wanted to try it out on my local machine, which is running Windows 10 along with HyperV. I saw that minikube is used for local development, and I was able to find in on Chocolatey, so I installed it using that:
choco install minikube -y
(I think this also installs kubectl)
The problem I have is that I'm not able to start it; I'm running the following command:
minikube start --vm-driver=hyperv
I have an external switch configured in HyperV (I found it as a suggestion somewhere), but when I run the command, it's stuck in Creating VM ...
I thought maybe it would give me a clue if I look at the VM created in HyperV, and when I open that, I see the following:
So, it seems that it's waiting for input, and that's why it's stuck! I tried searching for the problem, but to no avail.
I would appreciate any help
PS: It seems to me that if I wait long enough, the following message appears on the console:
Temporary Error: provisioning: error getting ssh client: Error dialing
tcp via ssh client: ssh: handshake failed: ssh: unable to authenticate,
attempted methods [none publickey], no supported methods remain

So, somehow by chance, I think I found how to resolve the issue.
First thing is that: the fact the VM is displaying that prompt (minikube login) seems to be normal, and it does NOT prevent the minikube start from succeeding.
To resolve the issue, this is what I did:
Delete ~/.kube directory
Delete ~/.minikube directory (in case it exists)
The MOST IMPORTANT step: stop/start the Hyper-V Virtual Machine Management Windows service
These steps seem to have solved the issue for me
PS: I used this command to start minikube and enable verbose logging:
minikube start --vm-driver hyperv -v 7 --alsologtostderr

Farzad, what resources have you used for setting up the minikube? Can you please clarify what do you mean by "unable to start". Are the regular kubectl commands working?
For example kubectl get nodes? That is of course if below steps won't help you.
The screenshot you shared shows a running VM:
Minikube runs a single-node Kubernetes cluster inside a VM on your
laptop for users looking to try out Kubernetes or develop with it
day-to-day.
You mentioned that you've created the vSwitch, you should be using a flag that is pointing minikube to use that external vSwitch:
minikube start --vm-driver hyperv --hyperv-virtual-switch "vSwitch name"
You also mentioned choco, did you install kubernetes-cli (as you did not mention it in the question)? It might be the reason why your commands do not work (seems like the new version downloads kubectl with choco install minikube):
kubectl is a command line interface for running commands against
Kubernetes clusters
At this moment I recommend stoping the minikube VM:
minikub stop
Delete the cluster
minikube delete
Sometimes regular minikube stop, minikube delete does not work so you might have to manually turn off the minikubeVM in Hyper-V, then I recommend to go to c:\users\%username%\ and delete .kube and .minikube.
Use cuninst minikube
Restart and install again as specified in the minikube documentation:
choco install minikube
choco install kubernetes-cli
As for the error you mentioned, let's try to run the cluster properly, and if this persists, we will take care of it.

Try this:
kubectl config use-context minikube

I encountered the same issue. The reason was I chose the wrong disk file to start my VM after creating it in Virtual Box.

This solved my issue.
minikube delete
minikube start --vm-driver hyperv -v 7 --alsologtostderr

Related

Cannot deploy smart contract with Eris / Monax

I'm following the Getting Started Tutorial, using eris version 0.12.0
I stuck at the point where to deploy the smart contract ~/.eris/apps/idi/idi.sol
eris pkgs do --chain simplechain --address $addr
By random I get either of following two errors:
Performing action. This can sometimes take a wee while
Could not perform pkg action service: Could not perform pkg action: Docker: {"m
ssage":"Cannot link to a non running container: /simplechain-a49e7fc2-45d4-44df
83bf-1dfab6246c13 AS /interactive-67fff395-600b-4161-912b-df11dc6b2807/chain"}
or:
Performing action. This can sometimes take a wee while
Could not perform pkg action service: Docker: {"message":"Invalid container name
(.eris_tmp_-798bc8a1-70bb-45fd-ac23-8468503cdbad), only [a-zA-Z0-9][a-zA-Z0-9_.
-] are allowed"}
When I install eris version 0.11.4 the error looks like this:
Performing action. This can sometimes take a wee while
Sorry, the marmots were unable to load the eris-pm jobs file. Please check your
path.
ERROR => Unsupported Config Type ""
Container interactive-39ac3a49-52fa-4f1d-953e-1662b1af7f21 exited with status 1
I restarted Docker Quickstart Terminal several times and also deleted the default VM in VirtualBox.
What I'm doing wrong? Thanks for help!
In addition to David's answer, you also should run
eval $(docker-machine env eris) to activate the docker-image.
I had been missing the eris docker-machine running. You can check this with
docker-machine ls
And you can recreate it with:
docker-machine create -d virtualbox eris
Thanks to quick help from Monax / Eris team.

epmd error for host myhost: address (cannot connect to host/port) on windows 10

I am trying to install rabbitmq. The installation of both erlang i.e OTP 18.1 file was done successfulyl and also rabbitmq installation completed successfully. But when I try to connect rabbitmq, I get the following error:
C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.5.6\sbin>rabbitmq-plugins.bat enable rabbitmq_management
Plugin configuration unchanged.
Applying plugin configuration to rabbit#INLN50899724A... failed.
* Could not contact node rabbit#INLN50899724A.
Changes will take effect at broker restart.
* Options: --online - fail if broker cannot be contacted.
--offline - do not try to contact broker.
C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.5.6\sbin>rabbitmq-server restart
ERROR: epmd error for host INLN50899724A: address (cannot connect to host/port)
Click below to see the image containing error
Error Empd Rabbitmq
I may be replying really late, but still I'm facing this issue. So it may help somebody event while installing rabbitmq version 3.6.5. To change the node name, open "rabbitmq-env.bat" under "installation dir\sbin" and change RABBITMQ_NODENAME to "rabbit#localhost" (line number 90 in rabbitmq 3.6.5). But make sure you remove the windows service, do change the nodename, install service and start it. This worked for me.
No other options worked for me which were marked as right answer in stackoverflow!
Remove the RabbitMQ service. Uninstall RabbitMQ. Kill the epmd.exe process. Delete your c:\users\\AppData\Roaming\RabbitMQ Directory.
Go to Control Panels -> System -> Advanced -> Environment Variables
Add a variable named RABBITMQ_NODENAME and set it to rabbit#localhost
Reinstall RabbitMQ.
Navigate to the RabbitMQ sbin directory (or run the command from the start menu) and run rabbitmqctl status.
You should no longer see the (cannot connect to host/port) error.
And yes, this will fix your Cisco AnyConnect VPN related installation issues.
open C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.15\sbin\rabbitmq-server.bat
Add the below command as the first line in
set RABBITMQ_NODENAME=rabbit#localhost
refer attached image
For Windows Machine:
Go in C:\Users\<YourUserName>\AppData\Roaming\RabbitMQ
Create a file rabbitmq-env.conf
Add the following:
CONFIG_FILE=C:\Users\<YourUserName>\AppData\Roaming\RabbitMQ\rabbitmq
NODE_IP_ADDRESS=127.0.0.1
NODENAME=rabbit#localhost
The above is my env-config, for this particular issue setting
the nodename will be sufficient.
Turn off you firewall & start the rabbitmq, it will work. After running it one time, even if you turn on the firewall, it will work.
This works for me in Windows 10 machine.
in your shell
$ export RABBITMQ_NODENAME=rabbit#localhost
$ /sbin/rabbitmq-server -detached
change rabbit#INLN50899724A
to rabbit#localhost and try again.
Or, edits your hosts file so that INLN50899724A points to 127.0.0.1
For using rabbit mq on windows 10 for similar error I did below
set RABBITMQ_NODENAME=rabbit#localhost
in the path where rabbit MQ is installed i.e for me it was in C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.5\sbin>
and then started
.\rabbitmq-server start
Also, I had changed the host to point to my computer name in c:\Windows\System32\Drivers\etc
127.0.0.1 yourhostnamehere

virsh console hangs whenever I connect to Virtual Machine

Whenever I try to connect to VM using virsh console <vm name> my screen hangs and displays:
Connected to domain <vm name>
Escape character is ^]
I have found many solutions on the internet but nothing has worked for me and I am even not able to find the /etc/init directory as CentOS 7 has a different directory structure.
I need /etc/init directory to create a script which I found on the internet as a solution.
I am using only ssh connection and no GUI and I do not have any access to the physical machine.
I think you should start a console (e.g. ttyS0 ).
For example on my Debian 8 I enable it with systemd:
systemctl enable getty#tty1.service
Enable Serial Console on CentOS/RHEL 7
On the virtual machine, add ‘console=ttyS0‘ at the end of the kernel lines in the /boot/grub2/grub.cfg file:
grubby --update-kernel=ALL --args="console=ttyS0"
Note: Alternatively, you can edit the /etc/default/grub file, add console=ttyS0 to the GRUB_CMDLINE_LINUX variable and execute
grub2-mkconfig -o /boot/grub2/grub.cfg
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial –speed115200 –unit=0 –word=8 –parity=no –stop=1"
I had the same issue right after virt-install, then after trying to connect to the guest, too. I tried all the suggested solutions but none of them helped. Then I realized that I forgot to install KVM. A simple 'yum -y install kvm' resolved the issue.

Crashplan on FreeNAS missing /var/lib/crashplan/.ui_info

So I spent a few weeks on this problem now. I've been trying to get CrashPlan running on a headless FreeNAS server. I have found lots a tutorial to do this. However the fact is that I'm missing the .un_info file on my FreeNAS server after installing CrashPlan.
I have searched the whole file system to try and find the elusive .ui_info file.
I've tried creating it manually with information copied from desktop PC but that does not help me resolve my CrashPlan Pro app connecting to the Crashplan server service on FreeNAS.
INFO:
FreeNAS 9.3 STABLE
Crashplan 3.6.3_1 Plugin
The crashplan remote access behaviour changed several times during the last updates, however with version 3.6.3_1 you should find the .ui_info file in
/var/lib/crashplan/.ui_info
Although the jail version is 3.6.3 it's possible that Crashplan updated itself, please check this with:
tail -f /usr/pbi/crashplan-amd64/share/crashplan/log/service.log.0
In the end you want your Crashplan to update itself anyway. If the update process produces an error related to bash, please run:
pkg update
pkg install bash
ln -siv /usr/local/bin/bash /bin/bash
And restart crashplan while checking the log output with the tail -f command from above:
service crashplan restart
If you finally reach a recent version (>4.4.1), its time to remotely connect to crashplan.
The only change on the server necessary for the easiest method without ssh tunnel is the serviceHost tag in /usr/pbi/crashplan-amd64/share/crashplan/conf/my.service.xml.
<serviceUIConfig>
<serviceHost>0.0.0.0</serviceHost>
Either do this everytime you want to connect, because the token will change after every crashplan restart or use my script from here (for OS X): https://gist.github.com/Phlogi/8654e353786ed1cf0858
Copy /var/lib/crashplan/.ui_info to the correct place on your desktop machine and edit the IP address at the end (to your servers address), for example:
4339,7f1d655f-*****,192.168.1.20
That's it, you can start crashplan on your remote machine and it will connect properly, there are no other changes neccessary. Latest crashplan (>4.4.1) will actually use the IP address from .ui_info.
Install JRE. You will need to add --no-check-certificate to the JRE wget line in the install.sh file

Vagrant stuck in "Waiting for VM to Boot"

I want to preface this question by mentioning that I have indeed looked over most if not all vagrant "Waiting for VM to Boot" troubleshooting threads:
Things I've tried include:
vagrant failed to connect VM
https://superuser.com/questions/342473/vagrant-ssh-fails-with-virtualbox
https://github.com/mitchellh/vagrant/issues/410
http://vagrant.wikia.com/wiki/Usage
http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time
And more.
Here's how I setup my Vagrant:
Note: We are using Vagrant 1.2.2 since we do not at the moment have time to change configs to newer versions. I am also using VirtualBox 4.2.26.
My office has an /official/ folder which includes things such as Vagrantfile inside. Inside my Vagrantfile are these custom settings:
config.vm.box = "my_box"
config.ssh.private_key_path = "~/.ssh/github_rsa"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.ssh.max_tries = 300
config.vm.provision :shell, :inline => "/etc/init.d/networking restart"
I installed our custom box (called package.box) via vagrant box add my_box absolute_path/package.box which went without a hitch.
Running vagrant up, I would look at the "preview" of the VirtualBox, and it would simply be stuck at the login page. My Terminal would also only say: Waiting for VM to boot. This can take a few minutes. As far as I know, this is an SSH issue. Or my private key issues, though in my Vagrantfile I explicitly pointed to my private key location.
Interesting Notes:
Running dhclient within the VirtualBox GUI, it says command no found. Running sudo dhclient eth0 was one of the suggested fixes.
This fix: https://superuser.com/a/343775/298915 of "modify the /etc/rc.local file to include the line sh /etc/init.d/networking restart just before exit 0." did nothing to fix the issue.
Conclusion:
Having tried to re-install everything thinking I messed up a file, it did not seem to ameliorate the issue. I am unable to work with this issue. Could someone give me some insight?
So after around twelve hours of dejected troubleshooting, I was able to (finally) get the VM to boot.
Setup your private/public keys using the link provided. My box is a Debian Linux 3.2.0-4-amd64, so instead of /root/.ssh/id_rsa.pub, you have to use /home/vagrant/.ssh/id_rsa.pub (and the respective id_rsa path for the private key).
Note: make sure your files have the right permissions. Check using ls -l path, and change using chmod. Your machine may not have /home/vagrant/.ssh/authorized_keys, so generate that file with touch /home/vagrant/.ssh/authorized_keys.
Boot your VM using the VirtualBox GUI using (through either Vagrantfile boot-GUI command, or starting your VM using VirtualBox). Login using vagrant and vagrant when prompted.
Within the GUI, manually start dhclient using sudo dhclient eth0 -v. Why is it off by default? I have no idea. I found out that it was off when I tried to wget the private/public keys in the tutorial above, but was unable to.
Go to your local machine's command line and reload vagrant using vagrant reload. It should boot, and no longer hang at "Waiting for VM to Boot."
This worked for me. Though it may be different for other machines, for whatever reason Vagrant likes to break.
Suggestion: can this be saved as a script so we don't need to manually do this everytime?
EDIT: Update to the latest version of Vagrant, and you will never see this issue again. About time, huh?