Friday, January 18, 2019

Running Centos on Windows

once you have upgraded to Windows PRO, you can install https://docs.docker.com/docker-for-windows/install/ Docker for Windows

Then open your Git Bash shell and run:

winpty docker run --name centos -i -t -d centos

If the container is stopped, you can simply

docker start centos

and login again:

winpty docker exec -ti centos bash


So you can have a "REAL" Centos on Windows... cool...





VirtualBox and Hyper-V on Windows 10 PRO

I have recently installed Windows PRO. During installation of Hyper-V, it duly warns you that you will no longer be able to use VirtualBox. Which is true, because when I start a VM in VirtualBOx I get the message:


WHvCapabilityCodeHypervisorPresent is FALSE! Make sure you have enabled the 'Windows Hypervisor Platform' feature. (VERR_NEM_NOT_AVAILABLE).
VT-x is not available (VERR_VMX_NO_VMX).


Apparently all you need to do to re-enable VirtualBox is:


open CMD as Administrator
bcdedit /set hypervisorlaunchtype off

reboot your machine

To restore Hyper-V you simply run:
bcdedit /set hypervisorlaunchtype on


I haven't tested yet but it should work IMHO



bcdedit is this https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcdedit-command-line-options

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  fr-FR
inherit                 {globalsettings}
badmemoryaccess         Yes
default                 {current}
resumeobject            {b32f6aed-59a4-11e8-b3f7-b9390bbf0244}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description             Windows 10
locale                  fr-FR
inherit                 {bootloadersettings}
recoverysequence        {b32f6aef-59a4-11e8-b3f7-b9390bbf0244}
displaymessageoverride  Recovery
recoveryenabled         Yes
badmemoryaccess         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {b32f6aed-59a4-11e8-b3f7-b9390bbf0244}
nx                      OptIn
bootmenupolicy          Standard
hypervisorlaunchtype    Auto




Wednesday, January 16, 2019

Installing spring boot CLI and spring cloud on centos

wget http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.1.2.RELEASE/spring-boot-cli-2.1.2.RELEASE-bin.zip
unzip spring-boot-cli-2.1.2.RELEASE-bin.zip

vi .bash_profile

export SPRING_HOME=/home/centos/spring-2.1.2.RELEASE/
PATH=$PATH:$SPRING_HOME
export PATH



to test, type:

spring version

Spring CLI v2.1.2.RELEASE

See also https://gist.github.com/diegopacheco/7623d6da015f588e4f11bee17d483569


vi app.groovy

@RestController
class WebApplication {

@RequestMapping("/")
String home() {
"Hello World!"
}

}


spring run app.groovy
curl http://localhost:8080/

Now you can install Spring Cloud:

spring install org.springframework.cloud:spring-cloud-cli:2.0.0.RELEASE



spring cloud configserver

I get

Caused by: java.lang.NoSuchMethodError: org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler.option(Ljava/util/Collection;Ljava/lang/String;)Ljoptsimple/OptionSpecBuilder;


ridiculous....
see here https://github.com/spring-cloud/spring-cloud-cli/issues/80


If I install an older version of Spring CLI, it works:
http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.0.0.RELEASE/spring-boot-cli-2.0.0.RELEASE-bin.zip



More information on the Spring Cloud command here https://spring.io/blog/2016/11/02/introducing-the-spring-cloud-cli-launcher