Monday 24 June 2019

Hyper-V problems on Windows 10 - docker/kubernetes on windows troubleshot

I've run into problems with running docker/kubernetes on my company machine (full of extra policies and vpn). I wanted to persist some of the things which helped me to go through it. I've found some articles in the network but still it took me many hours before I've manage to fix those - might save someone some time.

These are the main messages tormenting me before I've found solution:


Service 'Hyper-V Host Compute Service (vmcompute)' cannot be started due to the following error: Cannot start service vmcompute on computer '.'
Virtual Machine Management service failed to start.
An error occurred while attempting to connect to server "MY-PC-NAME". Check that the Virtual Machine service is running and that you are authorized to connect to the server. Hyper-V encountered an error trying to access an object on computer 'MY-PC-NAME' because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running.
... + others
Last but my favorite ;)
Error Not Found 
Let me try to point out the main checkpoints you should check on your way to greatness:
a) BIOS (if you are lucky enough to have access to it ;) ) - you should be having option for Hyper-V enabled
b) HYPER-V feature - Control Panel -> Programs and Features -> Turn Windows features on or off -select checkbox-> Hyper-V (install everything in that leaf)
c) SERVICES - run powershell and execute to have a look if everything is running smoothly (for me it was not - I've looked for log events and found that services were failing)
Get-Service "Hyper-V Virtual Machine Management"
Get-Service "Hyper-V Host Compute Service"
d) Windows Security -> App & browser control -scroll down-> Exploit protection settings -> Program settings -search from bottom for  C:\Windows\System32\vmcompute.exe-> Right Click - Edit -> Control flow guard (CFG) -uncheck-> Override system settings
e) restart windows / services
f) SERVICES - run powershell and double check if services are ok now (you might need to change autostart on some of them - run services.msc for that)
Get-Service "Hyper-V Virtual Machine Management"
Get-Service "Hyper-V Host Compute Service"
If you reached to a place where Hyper-V is working you can go with installation of Docker which from here is rather straight forward ;) There in newer version there is also Kubernetes which if enabled started without problems.

Friday 14 May 2010

GeeCON 2010

I was THERE ;) and I have to say a part of seeing few people I have not seen for a while it was realy worth it.

Among the best speakers was Dawid Weiss (my former profesor ;). I must say great Job! I went here to see the the foreign guests but you did the show! Your topic (Java in high-performance computing) was hard and you managed to do a real show. Not some boring presentation which would put to sleep. In matter of fact on some presentation person next me was snoring realy laudly ;) Few more speakers had to say something that was realy interesting and left me something to think about but there were few which I knew and my expectations where higher ;(

There was no presentation on google (there should be about BigTables but it was canceled ;( I really missed that. I conclude from meetings that more and more important becomes lanugages other then Java (often runned on JVM) ruby, scala, python... Another thing is modularity and clean code - OSGi (which In my opinion could be shown better), jdk7 modules. Ive seen some cool things Apache Camel and Vaadin (looks nice and the ecosystem idea! :)

Finally on the last presentation which I did not expect too much and WoooW. Mark Struberg was speaking about JSR-299 Context and Dependency Injection (wtf? this is the title of presentation?). He was speaking in very calm manner (way to calm - no life - no entusiasm) but he introduced some realy cool features which will be avaliable out of the box from jee like Interceptors (similar to spring ones). For me its re-incarnation of aspects :) I was interested in aspects few years back but nothing serius was born then.

Last but not leased there were realy interesting speaches about programing teams and relationships in teams and the second speach about rock programmers. Those presentations left something to think about :)

And the most pleasent news for me was that I won book in the end ;) (although I did not win the netbook ;(

Core-Java-II-Advanced-Features

Monday 10 May 2010

Windows XP - customization

I had to install computer with windows xp once again and I was board to deth by looking on the same stuff over and over again. I did google to lookup for some - freshness ;)



And its realy diffrent ;)

Friday 2 April 2010

HTML5 - WebGL - quake2 demo

WebGL - HTML5 - Quake2 - they are kidding right?! ;)

project page



I will update when I will run it :P

Wednesday 31 March 2010

HTML5 - demo1

Test elementu canvas.


Sunday 28 March 2010

JNI Example - Eclipse, Dev-Cpp

I wanted to test JNI by preparing simple example. I did had a lot of problems with it. Especially with creating proper DLL :( That is why I wanted to live something behind - maybe someone will have less problems. This is a simple example not tutorial about JNI.


Software:


  • Eclipse GALILEO - Java IDE - here

  • Dev-Cpp - C++ IDE - here



Plan:


  • Java part.

    • Create java project.

    • Create java class with native methods.

    • Generate cpp header.

    • Create java class which will load library and use our native class



  • C++ part.

    • Create c++ project.

    • Create c++ class and implement it.






Java part


After opening eclipse IDE create new Java project (File->New->Other->Java Project). Name: jni_hello_world. Create new class (File->New->Class) in default package (empty package) named MyFirstWrapper.



public class MyFirstWrapper {
native public String first(String parameter);
}

Create cpp directory in main project. Using eclipse External Tools Configuration (on the main toolbar there is play icon with red toolbox - running external tools) we add new configuration. Name: generate JNI header, location: c:\Program Files\Java\jdk1.7.0\bin\javah.exe, working directory: ${workspace_loc:/jni_hello_world/cpp} (use browse workspace directory), arguments: -jni MyFirstWrapper. After running it refresh the project (F5 on project). There should be created header file MyFirstWrapper.h in cpp directory.



/* DO NOT EDIT THIS FILE - it is machine generated */
#include
/* Header for class MyFirstWrapper */

#ifndef _Included_MyFirstWrapper
#define _Included_MyFirstWrapper
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: MyFirstWrapper
* Method: first
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_MyFirstWrapper_first
(JNIEnv *, jobject, jstring);

#ifdef __cplusplus
}
#endif
#endif

Now lets create new class named Runner in default package.



public class Runner {
static public void main(String[] args) throws Exception {
System.loadLibrary("MyFirst");
MyFirstWrapper wrapper = new MyFirstWrapper();
System.out.println(wrapper.first("world!"));
}
}

Using eclipse Run Configuration (on the main toolbar there is play icon) we add new configuration. On the main tab: name: Runner, project: jni_hello_world, main class: Runner. On the arguments tab: vm arguments: -Djava.library.path=cpp. Apply.


Now we are missing the dll so we go to the second part in dev-cpp.



C++ part


Open dev-cpp and create new project (File->New->Project). Choose on tab basic: Dynamic DLL, name: MyFirst, language C++, then OK and save it in your workspace in cpp directory (e.g. c:\workspaces\playground\jni_hello_world\cpp\MyFirst.dev). Now lets close without saving all generated tabs (right click on tab and close all). Add header file (right click on project and add to project - choose MyFirstWrapper.h). Create new file and save it as MyFirstWrapper.cpp (right click on project and new file then CTRL+S).



#include
#include
#include
#include
#include
#include "MyFirstWrapper.h"

JNIEXPORT jstring JNICALL Java_MyFirstWrapper_first
(JNIEnv *env, jobject obj, jstring parameter) {

jboolean isCopy;
const char *param = env->GetStringUTFChars(parameter, JNI_FALSE);
char temp[127];

sprintf(temp, "Hello %s!", param);
jstring result = env->NewStringUTF(temp);

env->ReleaseStringUTFChars(parameter, param);

return result;
}

Now we have to setup the project options. Open project properties (right click on project and project options). Tab Directories, subtab Include Directories add C:\Program Files\Java\jdk1.7.0\include and C:\Program Files\Java\jdk1.7.0\include\win32 (click the folder icon, choose folder and add button).


Hit in menu Execute->Rebuild All and there should be MyFirst.dll created.


Finally refresh the project in Eclipse and hit the earlier prepared runner configuration. The End. If you found it usefull live me a note ;) Maybe I will write something more when I will play around.

Sunday 26 October 2008

First commit

There was first commit - about 2 days of work. Core API created and example application with 2 entry points:

* HelloWorld - plugin manager and simple plugin
* ExceptionHandler - application, plugin manager, exception trigger plugin, exception hadling plugin (event communication)

Now I will foucus to document the work that Ive done. In next step review and some unit test would be a good idea.