TL:DR – I can’t currently get this installation to work.
Introduction
These instructions are based on the official bosh instructions listed at https://bosh.io/docs/bosh-lite/ but also include my comments on areas that work well, don’t work, or need some gentle crowbar action to make work! As Cloud Foundry describes itself as an opinionated PaaS, I feel empowered to have my own opinions here, and so should you! Let me know in the comments or on Twitter (@digitalteddysol) if you run into issues, or if something’s been fixed or changed.
- Download the Windows BOSH cli from https://bosh.io/docs/cli-v2/#install
- Move the downloaded file to somewhere on the PATH (I have a c:\Program Files\Cloud Foundry folder, this seemed appropriate.
- Rename the file to “bosh” (unless of course you want to type in that long filename you downloaded every time)
- In a terminal window check the version:
Succeededbosh -v
version 3.0.1-712bfd7-2018-03-13T23:26:43Z
Handily, when you look at the “additional dependencies” page for BOSH you see the following listed under Windows:Windows The create-env and destroy-env commands are not yet supported on Windows. Feel free to give it a try (and let us know if you have feedback), but we would recommend using a Linux-based virtual machine to run those commands instead.
So, at this point we’ve stepped into an area of the map marked “Here be Dragons”. That’s not to say it won’t work, and to be honest we’re here trying it to see how it can, but it’s the first step of warnings that we might see some odd behaviours compared to an installation on MacOS or Linux.
- The next step is to install VirtualBox. The bosh instructions so to install the base version and then “if you encounter problems” then install the Extension Pack. Personally, whenever I’ve installed VirtualBox I’ve installed the Extension Pack, it contains so many handy little necessities that I’d only not install it if space was an absolute premium.A key thing here is that there’s a known working version of 5.1.x, so if you have an existing install make sure you run
VBoxManage --version
As the Windows install of VirtualBox doesn’t add the VirtualBox directory to the path you’ll need to go hunting for where you installed it and run that command from that folder. - Similarly to the previous `cf-release` version of Cloud Foundry there’s a presumption that every machine in the known multiverse already has Git installed on it. To be fair, most development machines do, but not all and so if you’re new to this game and don’t have Git installed then at this point it’s critical you surf on over to https://git-scm.com/downloads and install it.
- The next three lines in the instructions won’t work on Windows without modification. On Linux based systems (including MacOS) a tilde can be used as an alias for the User’s home folder. This will also work in Windows Powershell, but not in a bog standard command prompt. Additionally the -p parameter (that allows you to make a whole folder tree in one go) isn’t implemented, so we’ll need to iterate that.The equivalent commands for a Windows command prompt will be:
git clone https://github.com/cloudfoundry/bosh-deployment %USERPROFILE%/workspace/bosh-deployment
cd %USERPROFILE%
mkdir deployments
cd deployments
mkdir vbox
cd vbox
As Microsoft becomes ever more Linux friendly I suspect we’ll see more and more of these little gaps closed in Windows 10, but for now it just needs that little bit of extra work to navigate the filesystem.
- Again, by doing the tilde shuffle we can make the `create-env` command from the bosh-lite instructions more Windows friendly
bosh create-env %USERPROFILE%/workspace/bosh-deployment/bosh.yml --state ./state.json -o %USERPROFILE%/workspace/bosh-deployment/virtualbox/cpi.yml -o %USERPROFILE%/workspace/bosh-deployment/virtualbox/outbound-network.yml -o %USERPROFILE%/workspace/bosh-deployment/bosh-lite.yml -o %USERPROFILE%/workspace/bosh-deployment/bosh-lite-runc.yml -o %USERPROFILE%/workspace/bosh-deployment/uaa.yml -o %USERPROFILE%/workspace/bosh-deployment/credhub.yml -o %USERPROFILE%/workspace/bosh-deployment/jumpbox-user.yml --vars-store ./creds.yml -v director_name=bosh-lite -v internal_ip=192.168.50.6 -v internal_gw=192.168.50.1 -v internal_cidr=192.168.50.0/24 -v outbound_network_name=NatNetwork
At this point, go and make a cup of tea/coffee or go for lunch, this command downloads all the various releases from the Internet and validates them, so it takes a little bit of time.
This… partially works.
$>bosh create-env %USERPROFILE%/workspace/bosh-deployment/bosh.yml --state ./state.json -o %USERPROFILE%/workspace/bosh-deployment/virtualbox/cpi.yml -o %USERPROFILE%/workspace/bosh-deployment/virtualbox/outbound-network.yml -o %USERPROFILE%/workspace/bosh-deployment/bosh-lite.yml -o %USERPROFILE%/workspace/bosh-deployment/bosh-lite-runc.yml -o %USERPROFILE%/workspace/bosh-deployment/uaa.yml -o %USERPROFILE%/workspace/bosh-deployment/credhub.yml -o %USERPROFILE%/workspace/bosh-deployment/jumpbox-user.yml --vars-store ./creds.yml -v director_name=bosh-lite -v internal_ip=192.168.50.6 -v internal_gw=192.168.50.1 -v internal_cidr=192.168.50.0/24 -v outbound_network_name=NatNetwork
Deployment manifest: 'C:\Users\Graham\workspace\bosh-deployment\bosh.yml'
Deployment state: './state.json'
Started validating
Downloading release 'bosh'... Finished (00:00:20)
Validating release 'bosh'... Finished (00:00:00)
Downloading release 'bosh-virtualbox-cpi'... Finished (00:00:53)
Validating release 'bosh-virtualbox-cpi'... Finished (00:00:01)
Downloading release 'bosh-warden-cpi'... Finished (00:00:26)
Validating release 'bosh-warden-cpi'... Finished (00:00:00)
Downloading release 'os-conf'... Finished (00:00:00)
Validating release 'os-conf'... Finished (00:00:00)
Downloading release 'garden-runc'... Finished (00:00:36)
Validating release 'garden-runc'... Finished (00:00:00)
Downloading release 'uaa'... Finished (00:01:09)
Validating release 'uaa'... Finished (00:00:00)
Downloading release 'credhub'... Finished (00:00:38)
Validating release 'credhub'... Finished (00:00:00)
Validating cpi release... Finished (00:00:00)
Validating deployment manifest... Finished (00:00:00)
Downloading stemcell... Finished (00:01:39)
Validating stemcell... Finished (00:00:00)
Finished validating (00:05:51)
Started installing CPI
Compiling package 'golang-1.10-linux/48c842421b6f05acf88dc6ec17f7574dade28a86'...[CLI] 2018/06/08 10:33:26 ERROR – Panic: UseIsolatedEnv is not supported on Windows
********************
goroutine 1 [running]:
runtime/debug.Stack(0xdb0620, 0xc0423ea0e0, 0xc0423c24a0)
/usr/local/go/src/runtime/debug/stack.go:24 +0x80
main.handlePanic()
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/main.go:110 +0x22b
panic(0xcb7b40, 0xc0423c24a0)
/usr/local/go/src/runtime/panic.go:458 +0x251
github.com/cloudfoundry/bosh-cli/cmd.Cmd.Execute.func1(0xc04221c188)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cmd/cmd.go:47 +0xee
panic(0xcb7b40, 0xc0423c24a0)
/usr/local/go/src/runtime/panic.go:458 +0x251
github.com/cloudfoundry/bosh-cli/vendor/github.com/cloudfoundry/bosh-utils/system.execCmdRunner.buildComplexCommand(0x1337280, 0xc0421b9f60, 0xe3b5bc, 0x4, 0xc04237fe80, 0x2, 0x2, 0xc0423a8ff0, 0x1, 0xc0423d1740, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/vendor/github.com/cloudfoundry/bosh-utils/system/exec_cmd_runner.go:88 +0x204
github.com/cloudfoundry/bosh-cli/vendor/github.com/cloudfoundry/bosh-utils/system.execCmdRunner.RunComplexCommand(0x1337280, 0xc0421b9f60, 0xe3b5bc, 0x4, 0xc04237fe80, 0x2, 0x2, 0xc0423a8ff0, 0x1, 0xc0423d1740, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/vendor/github.com/cloudfoundry/bosh-utils/system/exec_cmd_runner.go:21 +0x77
github.com/cloudfoundry/bosh-cli/vendor/github.com/cloudfoundry/bosh-utils/system.(*execCmdRunner).RunComplexCommand(0xc042179ca0, 0xe3b5bc, 0x4, 0xc04237fe80, 0x2, 0x2, 0xc0423a8ff0, 0x1, 0xc0423d1740, 0x56, ...)
:9 +0x9d
github.com/cloudfoundry/bosh-cli/installation/pkg.(*compiler).Compile(0xc0423926c0, 0x1335e60, 0xc0423d1680, 0x0, 0x0, 0x0, 0x0, 0xc0424e1800, 0x0, 0x0)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/installation/pkg/compiler.go:109 +0xbb6
github.com/cloudfoundry/bosh-cli/state/job.(*dependencyCompiler).compilePackages.func1(0x1388900, 0xed2ac4465)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/state/job/dependency_compiler.go:115 +0x77
github.com/cloudfoundry/bosh-cli/ui.(*stage).Perform(0xc0424dc7d0, 0xc0424dc820, 0x4e, 0xc04237fc80, 0x2, 0xc0424dc820)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/ui/stage.go:47 +0x15f
github.com/cloudfoundry/bosh-cli/state/job.(*dependencyCompiler).compilePackages(0xc0423a8960, 0xc0423a8ab0, 0x3, 0x3, 0x132e120, 0xc0424dc7d0, 0x3, 0x0, 0x0, 0xc042436200, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/state/job/dependency_compiler.go:133 +0x30b
github.com/cloudfoundry/bosh-cli/state/job.(*dependencyCompiler).Compile(0xc0423a8960, 0xc0421d65b0, 0x1, 0x1, 0x132e120, 0xc0424dc7d0, 0x0, 0x0, 0xc04220a008, 0xc042436200, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/state/job/dependency_compiler.go:50 +0x1fc
github.com/cloudfoundry/bosh-cli/installation.(*packageCompiler).For(0xc04237f9a0, 0xc0421d65b0, 0x1, 0x1, 0x132e120, 0xc0424dc7d0, 0x13, 0xc04247cf30, 0xc042382300, 0x33, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/installation/package_compiler.go:38 +0x93
github.com/cloudfoundry/bosh-cli/installation.(*installer).Install(0xc0422f3380, 0xc042388148, 0x4, 0xc042436200, 0xe, 0xc0423d8180, 0x13, 0xc04247cf30, 0xc042382300, 0x33, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/installation/installer.go:70 +0x44b
github.com/cloudfoundry/bosh-cli/cpi/release.CpiInstaller.installCpiRelease.func1(0x132e120, 0xc0424dc7d0, 0x32262a50, 0x136bd80)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cpi/release/installer.go:37 +0xab
github.com/cloudfoundry/bosh-cli/ui.(*stage).PerformComplex(0xc04238ee10, 0xe46417, 0xe, 0xc0423a8990, 0x1327da0, 0xc0423a0a60)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/ui/stage.go:68 +0x2c9
github.com/cloudfoundry/bosh-cli/cpi/release.CpiInstaller.installCpiRelease(0x2110400, 0xc042383300, 0x1327ae0, 0xc042394420, 0x0, 0x132dfa0, 0xc0422f3380, 0xc042388148, 0x4, 0xc042436200, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cpi/release/installer.go:39 +0x1ab
github.com/cloudfoundry/bosh-cli/cpi/release.CpiInstaller.WithInstalledCpiRelease(0x2110400, 0xc042383300, 0x1327ae0, 0xc042394420, 0x0, 0xc042388148, 0x4, 0xc042436200, 0xe, 0xc0423d8180, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cpi/release/installer.go:50 +0x153
github.com/cloudfoundry/bosh-cli/cmd.(*DeploymentPreparer).PrepareDeployment(0xc0420a65a0, 0x132e120, 0xc04238ee10, 0x0, 0x0, 0x0)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cmd/deployment_preparer.go:203 +0xcc3
github.com/cloudfoundry/bosh-cli/cmd.(*CreateEnvCmd).Run(0xc04220cfd8, 0x132e120, 0xc04238ee10, 0x133a540, 0xc04224a180, 0xc042310000, 0x1364, 0x1e00, 0xc04224b800, 0x32, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cmd/create_env.go:25 +0x283
github.com/cloudfoundry/bosh-cli/cmd.Cmd.Execute(0xef6550, 0xd3389c, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/cmd/cmd.go:74 +0x1f30
main.main()
/tmp/build/734c03a2/gopath/src/github.com/cloudfoundry/bosh-cli/main.go:35 +0x764
********************
Exit code 1
This error is consistent across both the command prompt and PowerShell.
As the following line is hardcoded into both the cpi_cmd_runner.go and compiler.go source files:
UseIsolatedEnv: true,
as well as a few test files, the only assertion that I can make at this point is that it’s currently not possible to deploy a bosh-lite version of cf-deployment directly onto Windows 10.
That’s not to say we can’t get Cloud Foundry running on a Windows 10 box, just that doing it directly isn’t currently a viable option.